Saturday 30 March 2019

What does your Relational Database workflow look like during development and production

I'm looking to set up a backend API server in node + an ORM for a MySQL database. Coming from a Django ORM world, I want to know how to do the same in Node in regarding Models and Migrations and what your workflow is.​I've looked at Sequelize and TypeORM. Creating models/entities are pretty straight forward. I'm confused on the migration part. AFAIK, I'm not supposed to let the ORM library automatically "Sync" the models with the database automatically because of potential data loss. I must instead write migrations to do it.​So is it my responsibility to keep the migrations in sync with my Model classes? It seems like a lot of work and headache to take care of the intricacies such as data type and length, foreign keys, indices etc etc. In django, this was automatically done for you and you just look at it to verify. How do you do it?​How often do you find your self writing migration. Do you always have to keep a mental model of the migrations?​And finally, assuming you had 3 environments, "Production Server", "Testing Server" and your "Local Development Environment (your laptop)"What would your development workflow look like when working with node, mysql and an ORM of your choice?​​​

Submitted March 30, 2019 at 04:28PM by Krimson1911

No comments:

Post a Comment