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

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.

Video: https://vimeo.com/139254964

Jan Stępień

March 28, 2015
Tweet

More Decks by Jan Stępień

Other Decks in Programming

Transcript

  1. Expectations set high ▶ short feedback loop ▶ continuous delivery

    ▶ automated and pauseless deployment ▶ ...under load ▶ high availability, dynamic scaling
  2. core defines HTTP endpoints each core endpoint ▶ is independent

    ▶ has all dependencies injected ▶ is absolute-path-agnostic ▶ is a value
  3. 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
  4. Deployment used to be cumbersome 1. Create an überjar 2.

    Upload to n boxes 3. Restart processes 4. Juggle load balancers
  5. Elastic Beanstalk and its environments ▶ EB wraps EC2 and

    ELB ▶ environments with instances ▶ runs Docker containers
  6. Feedback loops are shorter ▶ Productive development environment ▶ Bug

    fixes and features can be deploy the same morning they were asked for
  7. Docker and empowered developers ▶ Developers are in control over

    deployment ▶ Reduced dependency on the ops team ▶ Production env ≈ development env
  8. 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
  9. 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
  10. Plans for the future ▶ Ring Swagger ▶ Clojure 1.7

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