Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify interface to database module #841

Merged
merged 1 commit into from
Jan 18, 2025
Merged

Simplify interface to database module #841

merged 1 commit into from
Jan 18, 2025

Conversation

lorenyu
Copy link
Contributor

@lorenyu lorenyu commented Jan 17, 2025

Ticket

Resolves #752
Contributes to #726

Changes

  • Reduce the number of configurable parameters to the database module by:
    • Reorganizing /infra/modules/database to be a folder of two modules, a "resources" module and a "data" module
    • Move the current database module to be the "resources" module
    • Move all database-related data sources in the service later to be the "data" module
    • Move most database-related parameters in app-config to an internal "interface" module that root modules don't need to know about

Benefits of this approach is that it:

  • Simplifies app-config to only configurations that are intended to be updated by the project vs configurations that are only there to facilitate dependencies between root module
  • Encapsulates the data sources in the service layer's root module
  • Simplifies the creation of the database itself in the database root module

Context for reviewers

See description in changes, but this is a new architectural design I've been discussing with @rocketnova last year that was born out of an idea by @sonicos . I think it solves a couple of problems at once. In addition to simplifying data source access it also helps address the problem stated in #726.

This is purely a refactor PR, there are no functional changes.

Testing

see navapbc/platform-test#156

@lorenyu lorenyu merged commit 3aa617f into main Jan 18, 2025
9 checks passed
@lorenyu lorenyu deleted the lorenyu/datamodule branch January 18, 2025 00:27
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.

Modularize database module
2 participants