Infisical’s secret management platform has successfully transitioned its database system from MongoDB to PostgreSQL, making self-setup easier. The project chose MongoDB with Mongoose ORM due to team familiarity but faced challenges as user demand increased. MongoDB’s lack of crucial features like transactions led to difficulties in setting up and finding skilled admins, while developer side desired SQL features like CASCADE. Another issue with MongoDB was the switch to SSPL, limiting cloud service providers from upgrading, affecting Infisical’s users accessing cloud databases.
To address these issues, Infisical opted for PostgreSQL over SQLite for internal database and chose Knex.js as the query builder to have more control over queries. The database migration process took 6 hours, with downtime limited to reading data only. Post-migration, the application saw reduced overhead, resulting in a 50% decrease in database costs. Overall, the migration took 3-4 months and was deemed successful, although caution is advised for others looking to make a similar move.
TLDR: Infisical’s database migration from MongoDB to PostgreSQL improved self-setup ease, control over queries, and reduced costs, despite initial challenges and careful consideration needed for future migrations.
Leave a Comment