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

Migrate from Mongoose to Postgres #18

Open
MridulDhiman opened this issue Jan 6, 2025 · 0 comments
Open

Migrate from Mongoose to Postgres #18

MridulDhiman opened this issue Jan 6, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request intermediate considerations of one or more things

Comments

@MridulDhiman
Copy link
Collaborator

Problem Statement

You have to migrate from mongodb database which is currently using mongoose ODM to postgres database using prisma or drizzle as an ORM abstraction layer.

Technical Details

  1. Add abstraction methods so that data layer is separate from business layer and presentation layer.
  2. Normalize the schema design by making separate tables for each embedded documents, and references to be converted to foreign keys, focusing on the transactional workloads. If we still require some flexible schema and nested structure, just add that column of jsonb type
  3. Use Drizzle as an ORM as they are edge compatible.
  4. Use Turso or Neon for your postgres server or setup one locally via docker.
@MridulDhiman MridulDhiman self-assigned this Jan 6, 2025
@MridulDhiman MridulDhiman added enhancement New feature or request intermediate considerations of one or more things labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request intermediate considerations of one or more things
Projects
None yet
Development

No branches or pull requests

1 participant