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

Guarantee relational data integrity #223

Open
mattyg opened this issue Apr 1, 2022 · 0 comments
Open

Guarantee relational data integrity #223

mattyg opened this issue Apr 1, 2022 · 0 comments
Labels
discussion Issues that need more discussion and refinement before they're added to the project board

Comments

@mattyg
Copy link
Collaborator

mattyg commented Apr 1, 2022

I would like to see our "business logic" assumptions about the data models enforced more robustly at the database + ORM layer. It seems the task of verifying these assumptions is bleeding throughout the application, rather than being enforced at the data + orm layer (i.e. before the "business logic" of the application touches any data).

Currently we're at greater risk of our data reaching a "dirty" state -- where the assumptions made about it throughout the application are no longer correct. We also have an increased workload and mental overhead for developers trying to reason about the application behavior.

Overview

  • Explicit data relation between praise, period, and quantification. Currently there are several places where to praise is logically associated with a period. Refactor data model -- make 'quantifications' it's own collection #322
  • Use of db transactions. With db transactions we could execute a bunch of database queries together, and revert them all if any fail. Ensuring that we never reach a "dirty" data state from a partially completed transaction. Mongodb supports transactions only when using replica sets (i.e. 2-3 servers configured as a replica set).
  • Update / deletion cascading
  • Consider moving data relations from ORM layer to database layer. With mongodb having no support for relations, and mongoose picking up that slack on the ORM layer, we still run the risk of "dirty" data from direct changes to the database, or mongoose quirks / limitations.

Issues where this has appeared

@mattyg mattyg added the discussion Issues that need more discussion and refinement before they're added to the project board label Apr 1, 2022
@mattyg mattyg changed the title Concerns about data integrity Guarantee relational data integrity May 29, 2022
@kristoferlund kristoferlund moved this to Icebox / future features in Praise Development Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Issues that need more discussion and refinement before they're added to the project board
Projects
Status: Icebox / future features
Development

No branches or pull requests

1 participant