{"id":50706202,"url":"https://github.com/jenting/mag","last_synced_at":"2026-06-09T12:01:45.927Z","repository":{"id":357834707,"uuid":"1238739143","full_name":"jenting/mag","owner":"jenting","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-14T14:22:13.000Z","size":6,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-14T14:29:14.158Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenting.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-14T12:05:28.000Z","updated_at":"2026-05-14T14:22:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jenting/mag","commit_stats":null,"previous_names":["jenting/mag"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jenting/mag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenting%2Fmag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenting%2Fmag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenting%2Fmag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenting%2Fmag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenting","download_url":"https://codeload.github.com/jenting/mag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenting%2Fmag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34105565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-09T12:01:45.224Z","updated_at":"2026-06-09T12:01:45.916Z","avatar_url":"https://github.com/jenting.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# mag\n\nPoC for replicating Redis primary key/value entries to 20 Redis replicas via NATS JetStream and Redpanda Connect.\n\n## Architecture\n\n```\n[Application]\n    │  XADD orders * key \u003ck\u003e value \u003cv\u003e\n    ▼\nredis-primary (port 6379)\n    │\n    └──► connect-publisher  (redis_streams → nats_jetstream)\n                │\n                ▼\n    NATS JetStream  (stream: orders, subject: orders.created)\n                │\n    ┌───────────┼────────────┐  ...  ┐\n    ▼           ▼            ▼       ▼\nconnect-    connect-     connect-  connect-\nreplica-1   replica-2    replica-3 ... replica-20\n    │           │            │           │\nredis-      redis-       redis-      redis-\nreplica-1   replica-2    replica-3   replica-20\n(port 6380) (port 6381)  (port 6382) (port 6399)\n```\n\n`connect-publisher` reads entries from the `orders` Redis Stream on `redis-primary` and publishes them to the `orders.created` NATS JetStream subject. Each `connect-replica-N` uses its own durable NATS consumer (`redis-replica-N-sink`) so every replica independently receives all messages and writes them to its own Redis hash — true event-driven fan-out with no coupling between replicas.\n\n## Files\n\n- `docker-compose.yml` — starts NATS, redis-primary, 20 redis-replica services, connect-publisher, 20 connect-replica services, and the NATS stream initializer.\n- `connect-publisher.yaml` — Redpanda Connect pipeline: reads from the `orders` Redis Stream on redis-primary → publishes to NATS JetStream `orders.created`.\n- `connect-replica.yaml` — Redpanda Connect template (uses `${REDIS_HOST}` and `${NATS_DURABLE}` env vars): subscribes to NATS JetStream `orders.created` → upserts fields in a Redis hash on the target replica.\n\n## Run the PoC\n\n```bash\ndocker compose up -d\n```\n\n## Publish a key/value entry to Redis primary\n\n```bash\ndocker compose exec redis-primary redis-cli XADD orders '*' key order:1 value created\n```\n\n## Verify replication across replicas\n\nCheck a sample of replicas (all should converge within a second):\n\n```bash\ndocker compose exec redis-replica-1  redis-cli HGET orders-created-kv order:1\ndocker compose exec redis-replica-10 redis-cli HGET orders-created-kv order:1\ndocker compose exec redis-replica-20 redis-cli HGET orders-created-kv order:1\n```\n\nYou should see `created` on every replica.\n\nPublish an update:\n\n```bash\ndocker compose exec redis-primary redis-cli XADD orders '*' key order:1 value updated\n```\n\nVerify again — all replicas should show `updated`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenting%2Fmag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenting%2Fmag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenting%2Fmag/lists"}