How to deploy changes to production without downtime (generic hosting)?

System Information
  • Strapi Version: 4
  • Operating System: Ubuntu
  • Database: Postgres
  • Node Version: 14
  • NPM Version:
  • Yarn Version:

Hello!

What is the recommended way to deploy changes (for example change in some Content Type model) from development to production without downtime?

I’m using this setup.

I have development instance with development postgres database.
On production I have 3 strapi instances (serving both api & admin, using the same production postgres database) and those instances are behind loadbalancer.

Lets say that I have Content Type named: Article (both on development and deployed on production).
Lets assume that I want to change that content type for example I want to add some fields and remove some fields in Article content type.

How to deploy changes to production without downtime?

I’ve done some tests and when I for example update Strapi Production Instance #1 to pull new code for updated models, strapi will update database of course. And from that time Strapi Production Instance #2 and #3 have problems serving Admin panel for example (javascript errors because database was changes but JS model files are not updated).
After I updated code on instance #2 and #3 everything works as expected.

But doing something like this on “working product” will be visible as downtime.

How to properly handle this situation? Thanks for help!

2 Likes

I come and stare at this page every couple weeks. I think I want something like docker, but it seems like a lot.

1 Like