We are planning a maintenance window of about 30 minutes on 2020-01-28T22:00:00Z. During that time WaniKani will not be accessible. Our host requires us to do some maintenance on our database.
It seems like they do that a lot. Just curious, can they not update some of the database servers, then update the rest after those are done (switching over the master node as needed)? I’m not super knowledgeable about database stuff, but I figured I’d ask.
Yeah it has been more frequent as of late. They give us a time when they plan to do it. But we are given the option to do it on our timeframe as long as its ahead of the date.
How it is done is we spin up a follower database, which has the updates required. The follower replicates the master. Once it is caught up we can detach the follower from the master and then promote it. It is this period where we need to “freeze” the writes to the database. This swap shouldn’t take more than a few minutes. It is during this period where we need the site to be in maintenance mode. Us being cautious we just say 30 minutes to give us time to deal with any issues.
Even if your host doesn’t require it, it’s always a good idea to do periodic maintenance on databases, like vacuuming in postgresql, etc. They’re terrible at garbage collection.
I don’t know which backend you use, but if you do it right, you can failover without having to bring the application down. Requires a little design and planning first, though. I use mongodb at work and you can fail over to any one of the secondaries and then add a new node to the cluster… pretty sure that works.
To be fair, we have no end of sync problems in postgres. I guess some things are just intractable.
With a master / slave configuration (there is such a thing as a master / master configuration), that doesn’t necessarily work. I also don’t know much about hosting databases (I’m a developer) but this is not as easy as it sounds and could be super error prone. I’d rather have half an hour downtime.