Principal
What approaches do you use for building a service? Name the main factors from the 12-factor app.
sobes.tech AI
Answer from AI
To build the service, I follow the principles of the 12-factor app, which help create scalable, maintainable, and portable applications. The main factors include:
- Codebase — one repository for code, multiple deploys.
- Dependencies — explicit declaration and isolation of dependencies.
- Config — configuration stored outside the code, for example, in environment variables.
- Backing services — services (databases, queues) are considered attachable resources.
- Build, release, run — clear separation of build, release, and run stages.
- Processes — the application runs as one or more stateless processes.
- Port binding — the service exposes functionality via a port.
- Concurrency — scaling through the process model.
- Disposability — quick startup and proper shutdown of processes.
- Dev/prod parity — minimal differences between development and production environments.
- Logs — logs are considered a stream of events and are not managed by the application itself.
- Admin processes — administrative tasks are run as one-off processes.
These principles help build reliable and flexible services that easily adapt to changes and loads.