Admittedly, I was mildly shocked and a bit scared when stumbling over @ZackMaril’s recent tweet claiming Clojure was a dying language. A huge discussion was sparked and a lot has been written since. A summary can be found in Arne Brasseur’s post which also offers some good insight into the community behind Clojure. Eric Normand added another layer of abstraction today and collected some more links in this week’s Drama edition of the purelyfunctional.tv newsletter.

I share Dan Lebrero’s sentiment on Clojure. Clojure taught me lessons and introduced concepts to me  that I do not want to miss any more. First and foremost I love the built-in immutable collections. Immutability as default is a milestone in my life as a developer. I compare it to git, pair-programming, continuous integration and IntelliJ IDEA (with Cursive now, of course). There was a time when I did not even know about each of these. Now I cannot imagine to ever work without any of them.

In this post I want to emphasize another not less important aspect: Productivity. With Clojure we get a whole lot of stuff done. Seriously.

Abstract

In the last two months, we started our journey towards a new microservices architecture. Among other things, we found that our existing CD tools were not ready to scale with new requirements. So we tried a new approach, defining our pipelines in code using LambdaCD. In combination with a Mesos cluster we can deploy new applications after a few minutes to see how they fit into our architecture by running tests against existing services.

Part 1: The underlying infrastructure
Part 2: Microservices and continuous integration
Part 3: Current architecture and vision for the future

In this part of my article I want to explain how we define microservices and why we think they are the best choice for our applications. Furthermore I will give you a brief introduction outlining which problems we have with common CI tools and how we want to solve them with LambdaCD.

A little more than a year ago, things at work were completely different for me than they are now. I was a Java programmer working on a big, monolithic piece of software. There was also some JavaScript for frontend and MongoDB, some Groovy for scripting Gradle and the occasional Bash script, but if you had called me a 100% Java programmer, I would not have objected. Don’t get me wrong, I enjoyed my job and I always loved to work with Java but as you may relate to, after years of hacking Java, I was a little tired of it. As you may also relate to, I had little hope for the situation to change significantly anytime soon. As it turned out, I was wrong about that. Hugely wrong.

Recently we released tesla-microservice to github. It is a software written in clojure and it is the basis of some of the microservices we are working on as part of the technical platform of otto.de. We named our software after Nikola Tesla an ingenious engineer and inventor of the late 19th and early 20th century.

tesla-microservice is based on the component library, an elegant and quite minimal framework to build stateful applications in clojure.

Currently tesla-microservice allows you to build a basic web application with some basic features:

  • Load config from classpath and/or filesystem.
  • Aggregate a status based on the status of the different components and their subcomponents.
  • Deliver status details as json.
  • Serve a simple healthcheck based on that status.
  • Report to graphite using the metrics library.
  • Manage routes using compojure.
  • Serve content with an embedded jetty.

This is part two of my roundup of  EuroClojure 2014. If you missed the first part, find it here.

Day two started with the keynote by David Nolen about Invention, Innovation & ClojureScript. After some interesting discussion on the difference between invention and innovation, he talked about the history of clojurescript, a clojure implementation that does not target the jvm but javascript as a runtime environment. It was released 3 years ago and since then undergoes constant innovation. To date, the innovations come from 81 different contributors. Examples for contributed innovations are persistent immutable datastructures and source maps, which are very useful for debugging clojurescript. David introduced the basics on react.js and then of om. Om is a clojurescript library on top of react.js. It adds a key ingredient to react: Immutability. By having an immutable global application state, communication between components becomes feasible without any of those crazy interactions, that make classical user interface development so hard. As an example David  showed Goya, a pixel editor for the browser. Due to clojurescript’s persistent datastructures it features undo/redo of a virtually unlimited number of steps with little to no performance impact at all. David finished with an outlook on clojurescript 1.0. Among the goals is better code sharing between clojure and clojurescript.

view from the conference center
The beautiful view from the conference centre.

Last week I attended the EuroClojure conference 2014. It was a truly fantastic conference in the beautiful city of Kraków. While the big conferences in the US attract thousands of participants, this one was rather cosy with some 300 participants. As a very good side effect of this, the conference was single tracked. So I missed none of the great talks.

If you do not know clojure by now, let me start with a very short primer: Clojure is a modern, functional programming language targeting the java virtual machine. It is a lisp dialect, designed for concurrency, performance and code that is easy to understand and thus easy to reason about. One of the most outstanding features of clojure is its immutable, persistent datastructures directly built into the language. With clojurescript there also exists a version of clojure targeting javascript rather than the jvm as a runtime.