Skip to content

feat: Migration from PostgreSQL to MongoDB#15

Merged
rgdevment merged 2 commits intomainfrom
migrate-to-mongo-db
May 22, 2024
Merged

feat: Migration from PostgreSQL to MongoDB#15
rgdevment merged 2 commits intomainfrom
migrate-to-mongo-db

Conversation

@rgdevment
Copy link
Owner

Motivation for Migrating from PostgreSQL to MongoDB

Change Description:

We have decided to migrate our database from PostgreSQL to MongoDB. This change involves adjusting our database configurations, modifying queries, and adapting our data schema.

Reasons for the Migration:

  1. Infrastructure Costs:

    • PostgreSQL requires a more robust and expensive infrastructure to maintain its performance and scalability, especially in a high-traffic public API environment.
    • MongoDB offers a more cost-effective solution, which is crucial since we lack funding for this project and our goal is to keep the API open source.
  2. Scalability and Flexibility:

    • MongoDB efficiently handles large volumes of unstructured and semi-structured data, providing greater flexibility for future changes and expansions.
    • The ability to scale horizontally with MongoDB allows us to handle increased user loads without incurring prohibitive costs.
  3. Ease of Maintenance:

    • Managing MongoDB, especially with managed services like MongoDB Atlas, significantly reduces the maintenance burden and the need for specialized DBA resources.
    • This allows us to focus more on developing new features and improvements rather than database administration.
  4. End User Consumption:

    • A public API needs to be efficient and fast to improve the end-user experience. MongoDB, with its document structure, can offer faster response times for certain queries, directly benefiting users.

Impact of the Change:

  • Data Schema: The migration to MongoDB involves changes in the data schema. We are adapting our document collections to reflect the previous structure in PostgreSQL.
  • Queries and Operations: SQL queries will need to be rewritten using MongoDB's query language, which may require significant adjustments in some operations.
  • Tools and Resources: New tools and resources will be needed for managing and monitoring MongoDB, but this is offset by the overall reduction in infrastructure costs.

Conclusion:

The decision to migrate to MongoDB is strategic to ensure the long-term viability of our public API. With this migration, we not only reduce operational costs but also better position our infrastructure to handle growth and provide a quality service to our users.

@sonarqubecloud
Copy link

@rgdevment rgdevment merged commit a3f2589 into main May 22, 2024
@rgdevment rgdevment deleted the migrate-to-mongo-db branch May 22, 2024 22:35
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.

1 participant