ryanhugh / searchneu

Search over Classes, Professors and Employees at NEU!
https://searchneu.com
GNU Affero General Public License v3.0
74 stars 18 forks source link

No-downtime deploy #51

Open ryanhugh opened 6 years ago

ryanhugh commented 6 years ago

It would be pretty cool if we could deploy with no downtime. Currently, there is 1 to 2 seconds of downtime every time the prod branch is pushed. I am thinking that one way we could do this is have two instances of the searchneu backend running on the EC2 server and listening on different ports. Nginx would send requests to both of these instances. Then, when we are updating the server, we can take update these instances one at a time and the the site will be up the entire time.

ryanhugh commented 5 years ago

Now that the backend is ElasticSearch, this could be easier. Give this a read!

https://www.elastic.co/blog/changing-mapping-with-zero-downtime

dajinchu commented 5 years ago

Yeah with elasticsearch we should also make use of index aliases: reindex everything to a new index, then swap the alias to point at the new index, which is an atomic operation