{"id":17052593,"url":"https://github.com/cuchi/mongo-reporting-replica","last_synced_at":"2026-04-19T13:31:51.925Z","repository":{"id":84178611,"uuid":"123481685","full_name":"cuchi/mongo-reporting-replica","owner":"cuchi","description":"Using MongoDB replica sets feature to setup an reporting instance","archived":false,"fork":false,"pushed_at":"2018-03-01T19:21:14.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T05:24:13.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/cuchi.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}},"created_at":"2018-03-01T19:21:04.000Z","updated_at":"2018-03-01T19:28:15.000Z","dependencies_parsed_at":"2023-03-12T21:57:41.331Z","dependency_job_id":null,"html_url":"https://github.com/cuchi/mongo-reporting-replica","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cuchi/mongo-reporting-replica","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuchi%2Fmongo-reporting-replica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuchi%2Fmongo-reporting-replica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuchi%2Fmongo-reporting-replica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuchi%2Fmongo-reporting-replica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuchi","download_url":"https://codeload.github.com/cuchi/mongo-reporting-replica/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuchi%2Fmongo-reporting-replica/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32009089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"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":"2024-10-14T10:09:51.131Z","updated_at":"2026-04-19T13:31:51.908Z","avatar_url":"https://github.com/cuchi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository shows the usage of the Replica Set feature from MongoDB to serve\nwhat we can call a *reporting replica*.\n\nAs the name says, the main purpose of this kind of replica is not to ensure\nhigh availability, but to provide an easy way to get an real-time copy of the\nproduction database. This replica can be queried without any performance impact\non the production evironment.\n\n## Running this example\nYou will need `docker`, `docker-compose` and a local `mongo` client to get this\nexample working.\n\nFirst, start both of the mongodb instances:\n```bash\ndocker-compose up -d mongo mongo-replica\n```\n\nThen, log in the first instance, we will choose this one to be our *primary*\nreplica.\n```bash\nmongo localhost:10001\n```\n\nInitialize the replica set, then add the secondary instance:\n```javascript\nrs.initiate()\nrs.add({ host: 'mongo-replica:27017', hidden: true, priority: 0 })\n```\n\nGet the worker up and running:\n```bash\ndocker-compose up -d worker\n```\n\nYou should be able to see the data being replicated from `localhost:10001` to\n`localhost:10002`.\n\n## What is missing?\n- For the sake of simplicity, there is no authentication setup in this example.\nThis is something I will add later.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuchi%2Fmongo-reporting-replica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuchi%2Fmongo-reporting-replica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuchi%2Fmongo-reporting-replica/lists"}