

Using Clojure at MixRadio - jgrodziski
http://dev.mixrad.io/blog/2014/10/19/Clojure-libraries/

======
philbarr
Interesting read! Since you seem to have moved a whole java team to being a
clojure team, could you tell us how that went?

Particularly interested in:

\- developer acceptance (unless they were already all clojure guys?)

\- training materials

\- changes to devOps.

~~~
lebski88
Yep, we moved a whole team of about 30 people over from Java to Clojure. On
the whole it was fairly painless, considering how big a shift that was anyway.

It's hard to know where we started seriously advocating a move to Clojure and
where it was just our enthusiasm but we did quite a few things to sell it.

\- A Clojure club where we booked a big meeting room and taught some of the
basics of Clojure

\- Buying a bunch of books and leaving them around the office

\- Re-writing an existing service into Clojure as an example of how quick this
was to do, and how nice the resulting code was (as a note we haven't gone back
to re-write working services)

\- High levels of enthusiasm and trying our best to make sure everyone got a
chance to be included

At some point we decided that we had enough support to try things more
seriously so we got all the devs together in a room and made a proposal to
work on a few new services in Clojure. Having a Service Oriented Architecture
actually really helps here as we didn't have to make too big of a bet. That
was enthusiastically accepted by the team and from there we ended up writing
more and more things in Clojure. A few people were more resistant than others
and they stuck working on Java projects for longer. After a while though
curiosity or necessity led to them working with Clojure and they ended up
convinced. I'm not aware of anyone now who isn't a fan.

Training was a combination of self taught, books and, later on, booking a 3
day, onsite training course from the guys at Lambda Next. This is something
Cognitect also offer now.

From a dev ops perspective not much had to happen as our existing Java tooling
continued to work. That said we have recently rewritten all our deployment
tooling (in Clojure) to target AWS (and generally improve it in just about
every way). We actually have a blog post due to be published this week talking
about our new, Clojure based, tooling.

~~~
philbarr
Thanks for the reply. If you don't mind one quick last question - can I ask
which books you used? The only half-decent one I've found is Clojure In
Action.

~~~
lebski88
We have quite a few floating around but here are the main ones.

\- Joy of Clojure. I think a lot of people would say this was their favourite.
It's less about learning Clojure and more about loving and writing good
Clojure.

\- Clojure Programming. There are mixed review on this one but I quite liked
it as a reference book early on.

\- Programming Clojure - Similar to Clojure Programming. Pretty good.

Thinking about it a lot of people also spent some time working through the
4Clojure exercises.

Personally I found that the only way to really get it was to jump in. We have
a few early services that could perhaps do with a re-write but no real harm
was done!

------
taylorlapeyre
If you're interested in seeing what the source code of a simple Clojure web
application would look like, you might take a look at my implementation of
Hacker News in Clojure:

[https://github.com/taylorlapeyre/hn-
clojure](https://github.com/taylorlapeyre/hn-clojure)

------
skrebbel
Completely off topic, and purely out of curiosity, but what's MixRadio, as a
business, right now? Are you part of Microsoft? (then wow, Clojure) Or of
what's left of Nokia (and licensed to Microsoft somehow)?

Where's the team located? I had expected Finland, but the OP doesn't seem very
Finnish.

Btw, great work. I'm a very happy Mixradio user.

~~~
tcoupland
For the full version of exactly what we do and where we've come from, we've
got a nice write up: [http://dev.mixrad.io/blog/2014/08/05/MixRadio-
History/](http://dev.mixrad.io/blog/2014/08/05/MixRadio-History/)

In terms of development, the team is located in sunny Bristol in the UK. Glad
you like it!

~~~
skrebbel
Thanks! Nice story.

------
nextos
Can you describe your Clojure hardware stack? Everything running on the AWS?

Besides, what libraries do you use for data analysis? Sadly this is an area
where Clojure remains a bit stagnant, or at least people don't release what
they use.

~~~
tcoupland
Yep, we run everything on AWS as of a few months ago. We've got a post about
the nuts and bolts of that here:
[http://dev.mixrad.io/blog/2014/09/19/Migrating-MixRadio-
Infr...](http://dev.mixrad.io/blog/2014/09/19/Migrating-MixRadio-
Infrastructure-To-AWS/). We've got a post about our deployment tools that's
going to be going up soon!

In terms of data analysis we use a lot of Cascalog, although a fair amount of
ad-hoc work is done in RedShift.

~~~
nextos
Interesting!

Just three more little things:

\- Do you document using Marginalia or something similar (perhaps lein-midje-
doc)?

\- Since you do a lot of REST, have you ever considered Liberator?

\- Regarding Clojure books, I've found Clojure in Small Pieces quite
interesting---but far from complete

~~~
tcoupland
\- We still havn't really hit on a solution for internal documentation. I'm
something of a heretic on this point to be honest, as i try to actually
deliver the 'code as doc' idea, which i think you can realize with a
combination of compojure routes and schema definitions.

\- We did look at Liberator a while ago, but it didn't seem mature at the
time. To be honest we get by perfectly find with compojure, having created our
own middleware to deal with any fiddly bits.

\- The Joy of Clojure, for me, is the one. It's focus is on why Clojure is
such fun to work with and doesn't get bogged down in trying to teach you every
little function, it's not a reference book. A good read of that, coupled with
the clojure cheatsheet, mix in 'The Little Schema' to get you lisping and then
practice (4clojure, exercism.io, euler), which is key.

------
dantiberian
What made you choose clj-http over http-kit?

~~~
neilprosser
Nothing more scientific than, at the time we started out with Clojure, that
was what we found first and it worked! Recently we've begun using http-kit in
some high-load areas with some really good results.

