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

[wroc_love.rb] Migrating to Clojure. So much fn.

[wroc_love.rb] Migrating to Clojure. So much fn.

Slides from a talk I delivered on 15.03.2014 at wroc_love.rb in Wrocław, Poland.

Migrating a technology stack to a new language is rarely a simple task. It's getting even more challenging when what is changed is not only the language but the whole paradigm. This talk covers a story of stylefruits, where we've been gradually replacing a Ruby-based technology stack serving five million monthly visitors with Clojure. What are the costs and benefits of such a transition? How to make the migration gradual and painless? How to make Ruby and Clojure work with each other on the way? How easy is it to switch from a dynamic, object-oriented language to a functional one based on immutability and laziness? These are just some takeaways from this straight-from-the-trenches report.

Video: https://www.youtube.com/watch?v=Hv4slaRydRM

Jan Stępień

March 15, 2014
Tweet

More Decks by Jan Stępień

Other Decks in Programming

Transcript

  1. ↓ ╭────────────╮ │ http proxy │ ╰────────────╯ ↓ ↓ ╭───────────────╮

    ╭─────────────╮ │ ruby on rails │ ← │ widgets! │ ╰───────────────╯ ╰─────────────╯ ↓ ╭──────╮ │ db │ ╰──────╯
  2. ↓ ╭────────────╮ │ http proxy │ ╰────────────╯ ↓ ↓ ╭───────────────╮

    ╭─────────────╮ │ ruby on rails │ │ widgets! │ ╰───────────────╯ ╰─────────────╯ ↓ ↓ ╭──────╮ ╭─────────────╮ │ db │ ← │ data acc. │ ╰──────╯ ╰─────────────╯
  3. ↓ ╭───────────────────────╮ │ │ │ ╭───────╯ │ ruby on rails

    │ ↓ │ │ ╭─────────────╮ │ │ │ widgets! │ ╰───────────────╯ ╰─────────────╯ ↓ ↓ ╭──────╮ ╭─────────────╮ │ db │ ← │ data acc. │ ╰──────╯ ╰─────────────╯
  4. ↓ ╭───────────────────────╮ │ │ │ ╭───────╯ │ ruby on rails

    │ ↓ │ │ ╭─────────────╮ │ │ │ widgets! │ ╰───────────────╯ ╰─────────────╯ ↓ ↓ ╭──────╮ ╭─────────────╮ │ db │ ← │ data acc. │ ╰──────╯ ╰─────────────╯
  5. ↓ ╭───────────────────────╮ │ │ │ ╭───────╯ │ ruby on rails

    │ ↓ │ │ ╭─────────────╮ │ │ │ clojure │ ╰───────────────╯ ╰─────────────╯ ↓ ↓ ╭──────╮ ╭─────────────╮ │ db │ ← │ data acc. │ ╰──────╯ ╰─────────────╯
  6. +

  7. => (def vector [1 2 3]) => vector [1 2

    3] => (conj vector 4) [1 2 3 4] => vector [1 2 3]
  8. => (def vector [1 2 3]) => vector [1 2

    3] => (conj vector 4) [1 2 3 4] => vector [1 2 3]