How databases are upgraded in production? [over-simplified]
Minor version upgrades of the database are simple but major version upgrades are a big pain, typically a multi-month project. Some things to take care of during version upgrades are
- go through the release doc to understand the breaking changes
- go through the source code and identify the modifications
- make the changes in the codebase and put it in a different branch
- spinup the database with the new version and push old data to it
- test the changes on the new database, leverage integration tests
- setup a parallel replication from the current DB to this new DB
- wait for the new database to catch-up
- flip the connection to the new database with a config change
- run a quick application level sanity
There are a ton of details that I skipped and made it sound super simple, but if you ever get a chance to do this, grab it with both hands. It is scary but worth it.
more about me: arpitbhayani.me subscribe to my YT: youtube.com/c/ArpitBhayani