|
|
|
|
|
by hruk
887 days ago
|
|
Yes, we use this setup for two "branch" services. It is pretty easy to get going, but setting things up to achieve zero-downtime deploys requires a little thought. We're using ECS to manage our containers. What worked best for us is two task definitions, one daemon with only Litestream, another replica task with our web app. The web app task has a placement rule ensuring that Litestream has started before it can be placed, ensuring the database is "in place" before the app starts. Both containers have the same directory on the host mounted as volumes, so they can both access the same database. This series of tests convinced me that this is a safe setup: https://tangentsoft.com/sqlite/doc/trunk/walbanger/README.md This has been working well for us - the db is fast, we can deploy whenever we want, and I don't feel anxious about the host going down. One remaining source of anxiety is updating the machine image of the host - that will cause some downtime, of course. I think the safest strategy will be to increase the size of the ASG the host is in to warm up a second, updated EC2, then drain the first one. |
|
We only have one instance of cron and admin-web. We could make sure they are always on the same host. So reading this made me happy.
Do you have a blog/gist where I can find/steal some of your work?