Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the database architecture from a single monolithic database to three separate databases (management, users, and journey), enabling independent scaling and configuration of each domain.
Changes:
- Split the unified
storepackage into three domain-specific packages:management,users, andjourney - Update all database connection configuration to support three separate database URIs
- Refactor all service handlers and controllers to use the appropriate domain-specific store states
Reviewed changes
Copilot reviewed 104 out of 152 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
internal/store/store.go |
Removed database connection logic; retained only shared types and interfaces |
internal/store/management/store.go |
New management database connection and state initialization |
internal/store/users/store.go |
New users database connection and state initialization |
internal/store/journey/store.go |
New journey database connection and state initialization |
internal/store/users/*.go |
Moved user-related stores from main store to users package |
internal/store/management/*.go |
Moved management-related stores from main store to management package |
internal/store/journey/*.go |
Moved journey-related stores from main store to journey package |
internal/pubsub/consumer/*.go |
Updated handlers to accept domain-specific store states |
internal/http/controllers/v1/management/*.go |
Updated controllers to use management store state |
internal/http/controllers/v1/public/*.go |
Updated public controllers to use both management and users stores |
cmd/lunogram/main.go |
Initialize three separate database connections and states |
docker-compose.yml |
Added environment variables for three database URIs |
docker/postgres/init-databases.sh |
Script to create three separate databases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR splits the data over 3 databases allowing us to configure and scale each database differently.