Backend
Pre-requisites
Required Services
- postgres (live db)
- postgres (replay db)
- postgres (processing db)
- nats (jetstream enable)
- minio (store db snapshot)
- Debezium (nats connector)
Debezium should be configured to capture change data event on postgres (live db). Refer to this document for how to configure debezium with nats or can deploy debezium by this deployment
Running Locally
- Clone the repository:
git clone https://github.com/mssfoobar/rnr.git
-
Each module have their own
{ service_name }.env.sample
file. Copy and remove the.sample
in repository root directory. Provide the necessary variables inside the.env
file. -
Start services by go command
go run cmd/replay-manager/main.go
go run cmd/db-operator/main.go
go run cmd/msg-operator/main.go
go run cmd/transform-message/main.go
go run cmd/schedulejob/main.go
TransformMsg need a migration before running service by executing all sql file in /pkg/transformmsg/db/schema
Running with Docker
The Docker Compose
file to start up Record and Replay
module can be found under rnr
directory in dev-containers
repository. For more information on dev-containers
, please refer to
Local Development.
To run Record and Replay module, navigate to the dev-containers
directory in your local machine and execute the
following:
docker compose --env-file .env -f rnr/compose.yml up -d