Clojure Redeployed

Clojure Redeployed

Slides from a talk I delivered on 28.03.2015 at LambdaCon in Bologna, Italy.

At stylefruits we've been using Clojure on production since late 2012. We've made a lot of mistakes and we've learned a lot. This talk is dedicated to the newest addition to our infrastructure: a Clojure REST-inspired API. Taught by our previous mistakes in the realm of deployment and scalability we've set our requirements high: we're aiming for continuous delivery, high availability, dynamic scaling and pauseless deployments under load. Aside from deployment matters, Clojure proves to be an excellent choice to build a modular and stateless service. In this talk we're going to share our experiences, both good and bad, gained while prototyping, deploying and maintaining our newest project.



Jan Stępień

March 28, 2015


  1. 5.
  2. 6.
  3. 10.

    Expectations set high ▶ short feedback loop ▶ continuous delivery

    ▶ automated and pauseless deployment ▶ ...under load ▶ high availability, dynamic scaling
  4. 18.

    core defines HTTP endpoints each core endpoint ▶ is independent

    ▶ has all dependencies injected ▶ is absolute-path-agnostic ▶ is a value
  5. 28.

    MySQL Elasticsearch logstash 3rd-party API ogrom MySQL Elasticsearch logstash 3rd-party

    API ogrom MySQL Elasticsearch logstash 3rd-party API ogrom MySQL Elasticsearch logstash 3rd-party API ogrom
  6. 32.

    Deployment used to be cumbersome 1. Create an überjar 2.

    Upload to n boxes 3. Restart processes 4. Juggle load balancers
  7. 34.
  8. 35.

    Elastic Beanstalk and its environments ▶ EB wraps EC2 and

    ELB ▶ environments with instances ▶ runs Docker containers
  9. 40.

    Feedback loops are shorter ▶ Productive development environment ▶ Bug

    fixes and features can be deploy the same morning they were asked for
  10. 42.

    Docker and empowered developers ▶ Developers are in control over

    deployment ▶ Reduced dependency on the ops team ▶ Production env ≈ development env
  11. 43.

    There are some trade-o s ▶ Beanstalk allows opening only

    a single port when running Docker containers ▶ Deployment under load vs. JIT compilation ▶ The deployment takes a while: Clojure compile times, JVM start-up time, etc. ▶ There’s no staging environment
  12. 44.

    Ogrom is an improvement ▶ Client teams are happy with

    it ▶ It performs well under load and is durable ▶ Our main web app uses the Ogrom too now
  13. 45.

    Plans for the future ▶ Ring Swagger ▶ Clojure 1.7

    and its reduced compilation time ▶ Clojure(Script) client API
  14. 46.