Skip to content

Split the databases#140

Merged
jeroenrinzema merged 2 commits intomainfrom
feat/139
Feb 5, 2026
Merged

Split the databases#140
jeroenrinzema merged 2 commits intomainfrom
feat/139

Conversation

@jeroenrinzema
Copy link
Copy Markdown
Contributor

This PR splits the data over 3 databases allowing us to configure and scale each database differently.

@jeroenrinzema jeroenrinzema requested a review from Copilot February 5, 2026 21:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 store package into three domain-specific packages: management, users, and journey
  • 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

@jeroenrinzema jeroenrinzema merged commit 97feb00 into main Feb 5, 2026
4 checks passed
@jeroenrinzema jeroenrinzema deleted the feat/139 branch February 5, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants