Wiki: Microservices and Event-Driven-Architecture with Clojure and Kafka

For agents: Markdown version · Wiki index · Explore

Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

Summary

The speaker shares the architectural evolution of a mobile measurement platform that scaled rapidly from handling millions to billions of daily events. To cope with this massive growth, the engineering team transitioned from a monolithic Python codebase to an event-driven microservices architecture powered by Clojure and Kafka. The talk covers the rationale behind choosing specialized databases for different microservices, the integration of streaming pipelines, and practical strategies for testing and deployment. Attendees learn how combining functional programming with immutable event logs can help build resilient, high-scale distributed systems.

Key points

  • 0:00 The speaker introduces the platform’s domain, tracking mobile app marketing campaigns and processing billions of daily events with a very small engineering team.
  • 0:00 The system originally started as a monolithic Python application using Redis for internal messaging before outgrowing it.
  • 10:46 The team adopted a microservices approach where each logical domain owns its dedicated database, avoiding a one-size-fits-all data storage solution.
  • 16:59 The platform utilizes a variety of specialized databases including Couchbase, TokuMX, Google BigQuery, and Redshift tailored to specific operational needs.
  • 27:16 Apache Kafka serves as the central event-driven backbone, allowing multiple independent consumer groups to process persistent streams of data reliably.
  • 30:23 The backend was migrated to Clojure on the JVM to leverage functional programming paradigms, seamless Java interoperability, and better parallel data processing.
  • 38:15 New microservices can be easily tested in production with real data by assigning them independent consumer groups in Kafka.
  • 47:15 Deployments and service discovery are fully automated using Docker, Consul, and internal deployment tooling.

Takeaways

  • Choose specialized data stores for each microservice based on its specific access patterns rather than forcing a single database for everything.
  • Use persistent event logs like Kafka as a communication backbone to decouple services and replay data streams safely.
  • Leverage functional programming languages and immutable data structures to simplify parallel processing and high-throughput data pipelines.
  • Enable safe integration testing in production by running new service instances alongside existing ones using isolated consumer groups.

Questions this talk answers

  • How do you handle schema evolution and data consistency across independent microservices in an event-driven architecture?
  • What are the best practices for testing streaming data pipelines and microservices in a high-throughput production environment?
  • When should an engineering team choose an event streaming platform like Kafka over traditional message queues or HTTP REST calls?

Technologies

Python, Clojure, Java, Kafka, RabbitMQ, Redis, Couchbase, MongoDB, TokuMX, Google BigQuery, Amazon Redshift, Spark, Docker, Consul, Jenkins, JVM

Tags

clojure, databases, distributed systems, event-driven architecture, kafka, microservices, scalability