Noms

Menu

Migrating Database

Dated - 10 March 2024
 

This weekend, production database was migrated to self hosted shared instance. Main reason for going forward with this update was data redundency and data consistency.

As new changes are frequent, it became an issue to restore database from backups when something went haywire. For developing service like shortCuts it is crucial to have data consistency built in core.

I could have also used a pre configured, managed database service like MongoDb Atlas/Fly postgres but it would add extra latency to shortCuts, best option was creating another instance inside Virtual network. This approach helped me modularize code, separating link storage and server logic, furthermore it helped me simplify maintaince.

This approach helped acquire data redundency reducing risk of data loss. Backup service was also migrated to database instance. shortCuts currently stores data in postgres and mongodb, previously firebase realtime db was used instaead of MongoDb to store analytics data. Primary reason for moving to MongoDb was decreased latency.

Above storage architecture is temporary, I wish to completely migrate storage to no sql database like scyllaDB in future updates.

If you have any suggestions, feature request or would like to collaborate mail me at[email protected]