Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can have two app instances writing to the database concurrently, as long as they are running on the same machine. Then it’s possible to deploy a new version without downtime by starting the new binary, switching traffic to the new instance, draining connections to the old instance, and shut it down. That’s kind of how nginx for example upgrades itself without downtime. That’s not the usual way nowadays with containers and VMs, but it was very common before. It’s definitely doable with SQLite, and not very complex.


Your app machine has to be overspecced so it can support running 2 copies of the app at once


No. The number of processes requests in unchanged. They are just dispatched between 2 instances: the new one and the old one. Actually, all new requests are going to the new instance, and only the pending requests are processed by the old instance.


Sure but most applications need a certain amount of memory regardless of the amount of requests they're servicing


Agreed, RAM usage may be slightly elevated during the switch. But it doesn’t seem to be a big issue in practice. nginx for example is updating itself like this and it works fine.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: