First
First I would recommend to read the expanding part in the appread book
https://book.appread.io/vertical-scaling
Second, it goes like that. for both use-case I'm recommending decentralizing the Databases and the storage
https://book.appread.io/decentralization
then:
Docker Swarm
https://book.appread.io/docker-swarm
Docker Swarm is the easiest way (after you're getting familiar with it) to deploy scaleable services.
In Docker Swarm you can easily add and remove nodes (servers), and, you can get a quick overview of all your Swarm services with few commands.
The difficult parts of using Swarm are:
- You must keep the managers quorum (more on that you can find in the Swarm chapter)
- Adding & removing nodes
- You can't scale automaticity not the nodes nor the services.
Manual horizontal scaling
https://book.appread.io/horizontal-scaling
In this approach you will create a server that holds only the stateless containers and gather as-many-as-you-need servers behind load balancer.
This way gives you to most easiest way scale up and down, as you'll need to do is to add or remove replicas of the exact same server.
Appwrite executor
One of Appwrite containers is the appwrite-executor which is an internal endpoint for creating and managing OpenRuntime (functions) containers.
This container is not exactly stateless.
In Docker Swarm you can't have more than one container of appwrite-executor because this container holds in-RAM table that contained all the information of the running runtimes.
Meaning if you've replicated this container and function x was created by container x, then in the next time when container y will try to execute function x it will get unathorized error.
In the manual approach, the one you're replicating the whole stateless containers, then, appwrite-executor would work perfectly.
Regarding the main 2 questions
Will function deployment via Appwrite CLI still work? And systematically deploy to all instances of appwrite?
Will updates be easy?
The deployment would be the same no matter what approach you would use.
As for the upgrading check this 👇
Upgrading
When upgrading Appwrite cluster you have two tasks
- Upgrading the image versions.
- Running optional migrations.
For the first one in Docker Swarm it's very easy as you just need to deploy new stack file with all the new versions. For the Manual way you'll need to upgrade one of the instances docker-compose.yml file and then replicate that one again.
For the second task it will be just the same as single-server Appwrite instance.
Just run
docker compose exec appwrite migrate
# In swarm
docker compose exec appwrite-appwrite.1.faef23... migrate