We released the basis for our clojure microservices

Nikola Tesla Nikola Tesla 1856-1943

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.

Nikola Tesla
Nikola Tesla. 1856-1943

 

In the first place we developed tesla-microservice for a prototypical project. It has later lost its prototypical status and will be a permanent part of the otto.de infrastructure. As other teams are starting to use it as basis for their own microservices, we decided to publish the code. This owes to our shared nothing guideline which says that the different teams at otto.de should not share any code except they do it publicly. That strategy protects us from hidden inter-team-dependencies and business logic sneaking into library code.

We did not primarily design tesla-microservice to be a general purpose framework, but rather tailored it to fit our specific needs at otto.de. If you are looking for a groundwork to build your own application on top, you might want to have a look at modularity.org, duct  or system. These are also based on the component framework which gained quite some popularity over the last year.

Having said that, we would be quite excited to learn that tesla-microservice proves to be useful in other scenarios, too. If you learned something from it or even use it, let us know. Do not hesitate to contact us  with questions or suggestions for improvements.  We would love to hear from you.

We will likely publish additional components in the future. Examples would be access to zookeeper, mongodb and redis. So stay tuned for more!