|
|
|
|
|
by mattbrewsbytes
2280 days ago
|
|
I'm not familiar with MongoDB to know if it has peculiar behavior so my experience is with traditional RDBMS. You could write the backend/middleware and front-end to handle both situations of if a column/data field is present vs. not. Get that code out there and then deploy your DB changes separate. Once all is working fine, remove the "shim" code that handled if a column was present/not. Most MVC web frameworks have ways to mask the table/column names if needed. It may feel "icky" but recognize it is short term and since you can do rolling updates of your pods, you should be able to deploy software only changes nearly anytime, all the time without interruption. For the DB, if the tables are large then in RDBMS sometimes the DB will lock the table for update which can cause issues. A technique we use is to copy the table, do the migration of say adding a column, apply updates that happened to original table to the copy and then rename the tables so your new migrated table becomes the actual table and original is preserved in case. The rename is usually fast and shouldn't lock out transactions. |
|