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

adapt EntityMapper / DatabaseService to sync + access different CouchDBs ("notification_xxx" as well as "app") #2746

Open
Tracked by #1055
sleidig opened this issue Dec 23, 2024 · 1 comment · May be fixed by #2758
Assignees
Milestone

Comments

@sleidig
Copy link
Member

sleidig commented Dec 23, 2024

For better performance of database requests and sync, we want to store records in different databases rather than putting everything in a single "app" database as the current design enforces.

e.g. storing notification events in a individual CouchDB for each user account separately ("app" db = normal docs; "notifications_user-id-xyz" = NotificationEvent docs)

@sleidig
Copy link
Member Author

sleidig commented Dec 27, 2024

Suggested approach:

  • Keep a single EntityMapperService that can load and transform all entities, for any database
  • Annotate Entity Types specifically, if they should be saved in a different DB than the default "app" database
  • Implement a new DatabaseManager service to route to the right Database service instance for the given entity (or let EntityMapperService handle that?)
  • Create multiple PouchDatabase service instances for each required database, allowing us to keep the Database class implementation unchanged during this refactoring.
  • ... rework the SyncService to also somehow work with this architecture and init syncing for multiple DBs, if necessary

@sleidig sleidig linked a pull request Dec 27, 2024 that will close this issue
@sleidig sleidig moved this from Triage / Analysis to Planned (current "sprint") in All Tasks & Issues Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Planned (current "sprint")
Development

Successfully merging a pull request may close this issue.

1 participant