{"id":14955521,"url":"https://github.com/rajat23/octopus-sharding-postgresql","last_synced_at":"2026-02-02T06:03:47.720Z","repository":{"id":78359396,"uuid":"242742274","full_name":"rajat23/octopus-sharding-postgresql","owner":"rajat23","description":"Sample project to demonstrate the use of Octopus library for database sharding purpose","archived":false,"fork":false,"pushed_at":"2023-03-09T14:24:12.000Z","size":42,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T07:36:32.423Z","etag":null,"topics":["docker","dockercompose","jruby","octopus","postgresql","rails5"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/rajat23.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":"2020-02-24T13:23:39.000Z","updated_at":"2020-06-18T08:23:02.000Z","dependencies_parsed_at":"2023-04-05T14:49:22.074Z","dependency_job_id":null,"html_url":"https://github.com/rajat23/octopus-sharding-postgresql","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"8d6bb21d3655687851eaea1e692d48ccdf68c403"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajat23%2Foctopus-sharding-postgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajat23%2Foctopus-sharding-postgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajat23%2Foctopus-sharding-postgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajat23%2Foctopus-sharding-postgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rajat23","download_url":"https://codeload.github.com/rajat23/octopus-sharding-postgresql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247829874,"owners_count":21003087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["docker","dockercompose","jruby","octopus","postgresql","rails5"],"created_at":"2024-09-24T13:11:16.499Z","updated_at":"2026-02-02T06:03:47.669Z","avatar_url":"https://github.com/rajat23.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\n#### How to Run\n\n1. go to root directory of project\n2. run `docker-compose up --build` to build whole system\n3. go to another window and connect to db using `docker exec -it \u003ccontainer_id_of_db\u003e bash` ( `docker container ls` to see id)\n  * create both databases specified in `config/shards.yml`\n  * run the migration using rake task from web container as specified in step 4 \n  * create table `ar_internal_metadata` for `transport_dev_new` db. refer to same table from `transport_dev` db\n  \n  ```\nCREATE TABLE ar_internal_metadata (\n        key character varying NOT NULL,\n        value character varying,\n        created_at timestamp without time zone NOT NULL,\n        updated_at timestamp without time zone NOT NULL\n    );\n    \n    ALTER TABLE ONLY ar_internal_metadata\n        ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);\n    \n    INSERT INTO ar_internal_metadata(key, value, created_at, updated_at) values('environment', 'development', NOW(), NOW());\n```\n  \n  * clean all rows from `schema_migration_table` from `transport_dev_new` db\n  * Re run he migration using rake task specified in step 4 \n4. go to another window and connect to rails app using `docker exec -it \u003ccontainer_id\u003e bash` ( `docker container ls` to see id)\n  * run `rake db:migrate`\n  * run `rake octopus:copy_schema_versions`\n  \n  \n#### Problems yet to tackle\n1. Creating databases automatically with `rake db:setup`\n2. Running Schema migration for only one shard initially and then for another shard","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajat23%2Foctopus-sharding-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajat23%2Foctopus-sharding-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajat23%2Foctopus-sharding-postgresql/lists"}