Sobes.tech
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:

  1. Codebase — one repository for code, multiple deploys.
  2. Dependencies — explicit declaration and isolation of dependencies.
  3. Config — configuration stored outside the code, for example, in environment variables.
  4. Backing services — services (databases, queues) are considered attachable resources.
  5. Build, release, run — clear separation of build, release, and run stages.
  6. Processes — the application runs as one or more stateless processes.
  7. Port binding — the service exposes functionality via a port.
  8. Concurrency — scaling through the process model.
  9. Disposability — quick startup and proper shutdown of processes.
  10. Dev/prod parity — minimal differences between development and production environments.
  11. Logs — logs are considered a stream of events and are not managed by the application itself.
  12. 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.