Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vers des applications twelve-factor

ubermuda
October 24, 2014

Vers des applications twelve-factor

La méthodologie "12 factor" (http://12factor.net/) promet des applications SaaS (Software-as-a-Service) plus maintenables et scalables.

Comment ? Pourquoi ? Voyons ensemble quelles sont les préconisations de cette méthodologie développée par des ingénieurs d'Heroku, et comment les appliquer dans des applications basées sur le framework Symfony2, avec l'aide de la technologie la plus prometteuse du moment : Docker.

ubermuda

October 24, 2014
Tweet

More Decks by ubermuda

Other Decks in Technology

Transcript

  1. Use declarative formats for setup automation Clean contract with the

    underlying operating system Suitable for deployment on modern cloud platforms Minimize divergence between development and production Can scale up without significant changes ”
  2. Codebase Dependencies Config Backing services Build, release, run Processes Port

    binding Concurrency Disposability Dev/prod parity Logs Admin processes
  3. Codebase one app = one codebase multiple codebases = a

    distributed system one codebase -> many deploys
  4. Resource handles to the database, Memcached Credentials to external services

    such as Amazon S3 or Twitter Per-deploy values such as the canonical hostname for the deploy ”
  5. A backing service is any service the app consumes over

    the network as part of its normal operation. ”
  6. Datastore (MySQL, PgSQL, Redis, ...) SMTP (Postfix, Mandril, ...) Message

    Queue (RabbitMQ, ZeroMQ, ...) API tierce (Twitter, Facebook, etc)
  7. Objectifs Réduire la friction entre le dev et la prod

    Réduire le "time-to-first-deploy" Faciliter l'intégration continue
  8. web: image: mytepee/web ports: [80] links: [db:db] volumes_from: [cache, config,

    data] environment: [...] db: image: orchardup/mysql environment: [...] cache: image: busybox command: /bin/true volumes: [/root/.composer/cache, /root/.cache/bower] config: image: busybox command: /bin/true volumes: [/app/config] data: image: busybox command: /bin/true volumes: [/app/web/uploads, /app/web/media, ..., /app/app/cache, /app/app/logs] fig.yml Attention à la sécurité !
  9. One-off admin processes should be run in an identical environment

    as the regular long-running processes of the app. ”
  10. Run a one-off command on a service. For example: $

    fig run web python manage.py shell By default, linked services will be started, unless they are already running. If you do not want to start linked services, use `fig run --no-deps SERVICE COMMAND [ARGS...]`. fig.yml