-
Couldn't load subscription status.
- Fork 0
Open
Description
At the moment we deploy only one instance of the service, but in the future we may want to allow to start multiple instances to scale horizontally.
Before doing that we should ensure that the service works correctly even in that case.
In particular:
- alembic migration: it's executed when the container is started, before starting uvicorn. If multiple containers are started at the same time there can be a race condition that could cause the migration to fail. Possible solutions:
- Ensure that the container running the migration acquires a lock. The other containers will wait, then skip the migration because the db is already updated.
- Run the migration as a step of the CI executing the deployment
- Use other mechanisms for leader election
- Run the migration manually (I would avoid that if possible)
- tasks: the container runs some tasks:
- queue_consumers (they consume messages from the oneshot, longrun, storage queues)
- job_chargers (they run periodically and charge the user for the running or finished uncharged oneshot, longrun, storage jobs)
(migrated from BlueBrain/accounting-service#54)
Metadata
Metadata
Assignees
Labels
No labels