In the early fall our infrastructure team was considering Kafka, a highly available message bus. We were looking to solve several infrastructure problems that had come up around that time. We were looking for a reliable way to collect event data and send it to our data warehouse. We were considering a more service-oriented architecture, and needed a standardized way of message passing between the components. We were starting to evaluate containerization of Shopify, and were searching for a way to get logs out of containers. We were intrigued by Kafka due to its highly available design. However, Kafka runs on the JVM, and its primary user, LinkedIn, runs a full JVM stack. Shopify is mainly Ruby on Rails and Go, so we had to figure out how to integrate Kafka into our infrastructure.
Overview
The article discusses the integration of Kafka into Shopify's Ruby on Rails infrastructure to address various infrastructure challenges, including event data collection and service-oriented architecture. It outlines the decision-making process, the use of SysV message queues for reliable event delivery, and the transition to Docker containers while maintaining Kafka's operational integrity.
What You'll Learn
How to integrate Kafka with Ruby on Rails applications
Why using SysV message queues can enhance reliability in event-driven architectures
How to manage event data during Kafka downtime without data loss
Prerequisites & Requirements
- Understanding of message queuing systems and event-driven architecture
- Familiarity with Docker and containerization concepts(optional)
Key Questions Answered
How does Shopify integrate Kafka with Ruby on Rails?
What are the advantages of using SysV message queues over POSIX message queues?
What challenges did Shopify face when adopting Kafka?
How does Docker impact the Kafka producer setup at Shopify?
Key Statistics & Figures
Technologies & Tools
Some links below are affiliate links. We may earn a commission if you make a purchase.
Key Actionable Insights
1Consider using SysV message queues for reliable event delivery in your applications, especially when dealing with potential downtime.SysV message queues allow for a robust buffer that can handle events even if the main processing system is temporarily unavailable, ensuring data integrity.
2When containerizing applications, evaluate how IPC mechanisms like SysV queues will function in your architecture.Understanding the limitations of IPC in containerized environments can help prevent operational issues and ensure seamless communication between services.
3Explore the use of TCP proxies to facilitate communication between isolated services and centralized processing systems.Using TCP proxies can simplify the architecture while maintaining the benefits of isolation provided by containers, allowing for efficient event handling.