SlideShare a Scribd company logo
natansil.com twitter@NSilnitsky linkedin/natansilnitsky github.com/natansil
Polyglot, Fault-Tolerant, & Event-Driven
Programming with
Kafka, Kubernetes and gRPC
Natan Silnitsky
Backend Infra Developer, Wix.com
registered users from
190 countries
200M
of all internet websites
run on Wix
5%
About Wix
@NSilnitsky
Wix
Stores
Service
Booking
Service
Restaurant app
Service
2,000
Microservices
Publish
Site
@NSilnitsky
Scala
Python
NodeJS
2,000
Microservices
@NSilnitsky
Wix
1,700M Kafka
messages a day
@NSilnitsky
Wix
1,700M Kafka
messages a day
So, we need our
message flows to be
performant,
fault-tolerant, and
polyglot.
Agenda
Event-driven programming with Kafka
+ Performance with Greyhound
+ Fault-tolerance with Greyhound & Kubernetes
+ Polyglot with Kubernetes & gRPC
@NSilnitsky
HTTP
* coupled
Request-Reply
Communication
New App
installed
Site Apps
Service
ECom Catalog
Service
Classic.
@NSilnitsky
HTTP
New App
installed
What if Network
is Unreliable
Request-Reply
Communication
Site Apps
Service
ECom Catalog
Service
@NSilnitsky * 2000 bottle
HTTP
New App
installed
Request-Reply
Communication
Cascading Failures
can happen.
@NSilnitsky
Message
Consumer
Message
Producer
Broker
Event-driven
Communication
Introduce
a Broker.
* clusters and replications
@NSilnitsky
Broker
Event-driven
Communication
Message
Consumer
Message
Producer
Introduce
a Broker.
@NSilnitsky
Kafka Broker
Event-driven
Communication
Site Apps
Topic
0 1 2 3 4
5
0 1 2 3 4
5
0 1 2 3 4
5
0 1 2 3 4
5
0 1 2 3 4
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Where you store
messages (events!)
A Kafka Broker
Looks Like This:
* perf vs queues
@NSilnitsky
Kafka Broker
Event-driven
Communication
Site Apps
Topic
0 1 2 3 4
5
0 1 2 3 4
5
0 1 2 3 4
5
0 1 2 3 4
5
0 1 2 3 4
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Kafka
Producer
Site Apps
Service
There’s the
Event
Producer,
@NSilnitsky
Kafka Broker
Event-driven
Communication
Site Apps
Topic
0 1 2 3 4
5
0 1 2 3 4
5
0 1 2 3 4
5
0 1 2 3 4
5
0 1 2 3 4
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Kafka
Consumer
Ecom Catalog
Service
and Event
Consumer.
* scale
Site Apps
Service
Kafka
Consumer
Kafka
Producer
Greyhound
wraps Kafka
Ecom Catalog
Service
Kafka Broker
Greyhound
Producer
Greyhound
Consumer
* open source
@NSilnitsky
Simplify
APIs, with additional
features
Greyhound
wraps Kafka
Site Apps
Service
Kafka
Consumer
Kafka
Producer
Ecom Catalog
Service
Kafka Broker
@NSilnitsky
✔ Parallel Consumption
✔ Consumer Retry Strategies
✔ Resilient Producer
✔ Context Propagation
✔ Metrics reporting
✔ Batch Consumer - Soon
@NSilnitsky
Abstract
so that it is easy to
change for
everyone
Kafka
Consumer
Kafka
Producer
Kafka Broker
Greyhound
wraps Kafka
Performant
Event-driven Programming
with Kafka and Greyhound
(Wix OSS)
Wix
1,700M Kafka
messages a day
@NSilnitsky
Kafka Broker
Topic
Greyhound
Consumer
Kafka
Consumer
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Performant
message handling A Service
Message Handler
@NSilnitsky
Kafka Broker
Topic
Greyhound
Consumer
Kafka
Consumer
SCALA ZIO FIBERS + QUEUES
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
(Thread-safe)
Parallel Message Consumption
Performant
message handling A Service
Message Handler
@NSilnitsky
80 partitions
Kafka Broker
Topic
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Performant
message handling
Maximum Throughput:
Messages Processing -
Non blocking IO (Netty grpc client)
with response latency of 100ms
@NSilnitsky
80 partitions
Kafka Broker
Topic
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Performant
message handling
Maximum Throughput:
800 Messages per second
Messages Processing -
Non blocking IO (Netty grpc client)
with response latency of 100ms
@NSilnitsky
Kafka
Consumer
Kafka
Consumer
Kafka
Consumer
Kafka
Consumer
Kafka
Consumer
Kafka
Consumer
Kafka
Consumer
Performant
message handling
80 Kafka Consumers
with 80 Java threads
80 partitions
Kafka Broker
Topic
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Messages Processing -
Non blocking IO (Netty grpc client)
with latency of 100ms
Kafka
Consumer
@NSilnitsky
Greyhound
Performant
message handling
or 1 Greyhound Consumer
with 80 fibers running on a
small thread pool
Kafka
Consumer
80 partitions
Kafka Broker
Topic
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Messages Processing -
Non blocking IO (Netty grpc client)
with latency of 100ms
fault-tolerant
Event-driven Programming
with Kafka, Greyhound &
Kubernetes
Wix
1,700M Kafka
messages a day
@NSilnitsky
Kafka Broker
renew-sub-topic
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Greyhound Consumer
Kafka Consumer
Fails To process
Fault-tolerant
message handling
@NSilnitsky
renew-sub-topic
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
renew-sub-topic-retry-0
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
renew-sub-topic-retry-1
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Greyhound Consumer
Kafka Consumer
RETRY
PRODUCER
Fault-tolerant
message handling
Inspired by Uber
RETRY!
Kafka Broker
@NSilnitsky
Producer
Wix Payments
Service
Subscription
renewal
Job
Scheduler
Fault-tolerant
message handling
Use Case: Guarantee Completion
Kafka Broker
@NSilnitsky
+ Retry
on failure
Kafka Broker
Producer Consumer
Wix Payments
Service
Subscription
renewal
Job
Scheduler
Fault-tolerant
message handling
Use Case: Guarantee Completion
@NSilnitsky
Producer Consumer
Subscription
renewal
Job
Scheduler
Fault-tolerant
message handling
Wix Payments
Service
Use Case: Guarantee Completion
Kafka Broker
+ Retry
on failure
@NSilnitsky
Producer
Fault-tolerant
message handling
The Resilient Producer
Kafka Broker
@NSilnitsky
Save
message
to disk
Kafka Broker
Producer
Fault-tolerant
message handling
The Resilient Producer: When failed to produce will save the message
@NSilnitsky
Kafka Broker
Producer
Fault-tolerant
message handling
The Resilient Producer: When failed to produce will save the message
and retry on failure.
+ Retry
on failure
@NSilnitsky
Kebe
Fault-tolerant
message handling
What if pod is killed?
pod
Kube Node
@NSilnitsky
Kafka Broker
pod
Scavenger
Kube Node
DaemonSet
What if pod is killed?
Fault-tolerant
message handling
Flush out
messages
* small
footprint
Polyglot
Event-driven Programming
with Kubernetes & gRPC
Wix
1,700M Kafka
messages a day
@NSilnitsky
Polyglot
message handling
Motivation: code reuse
Kafka Broker
Greyhound
Scala/Java
services
Greynode
NodeJS
services
Producer Consumer Producer Consumer
@NSilnitsky
Polyglot
message handling
Partial implementation is a problem
Kafka Broker
Greyhound Greynode
NodeJS
services
Producer Consumer Producer Consumer
@NSilnitsky
Greyhound
Polyglot
message handling
Greyhound Sidecar
Kafka Broker
NodeJS
services
Consumer
gRPC
Producer
@NSilnitsky
Kafka Broker
Greyhound
Polyglot
message handling
Greyhound Sidecar
gRPC
.proto
Sidecar
written
with
Scala
Service
written
with JS &
TS
@NSilnitsky
Kafka Broker
Greyhound
Polyglot
message handling
Greyhound Sidecar
gRPC
Sidecar
written
with
Scala
.proto
Service
written
with Python
gRPC
Service
written
with JS &
TS
44
@NSilnitsky
Polyglot
message handling
pod
Kube Node
Containerized app
Volume
The Sidecar resides with the app in the same pod.
@NSilnitsky
Kubernetes pod
with main and
sidecar
containers
Polyglot
message handling
pod
Kube Node
pod
pod
Kafka Broker
@NSilnitsky
@NSilnitsky
There’s a
memory issue.
pod
Kube Node
pod
pod
Polyglot
message handling
Kafka Broker
@NSilnitsky
@NSilnitsky
Kafka Broker
DaemonSet
Optimization:
Greyhound in
Daemonset
Polyglot
message handling
@NSilnitsky
So, We use Kubernetes’ flexibility
to deploy Greyhound producers and consumers
in different patterns, in order to comply with
different requirements.
@NSilnitsky
Wix harnesses Kafka, Kubernetes and gRPC to
achieve a polyglot, fault tolerant, scalable
event-driven distributed system.
@NSilnitsky
A Java/Scala high-level SDK for Apache Kafka.
0.1 is out!
github.com/wix/greyhound
@NSilnitsky
Thank You
natansil.com twitter@NSilnitsky linkedin/natansilnitsky github.com/natansil
@NSilnitsky
Slides & More
slideshare.net/NatanSilnitsky
medium.com/@natansil
twitter.com/NSilnitsky
natansil.com

More Related Content

PDF
Kafka based Global Data Mesh at Wix
PDF
5 lessons learned for Successful Migration to Confluent Cloud
PDF
Open sourcing a successful internal project - Reversim 2021
PDF
Jax london - Battle-tested event-driven patterns for your microservices archi...
PPTX
Standardizing Microservice Management With a Service Mesh
PDF
Advanced Caching Patterns used by 2000 microservices - Api World
PDF
Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and ...
PDF
Polyglot, Fault Tolerant Event-Driven Programming with Kafka, Kubernetes and ...
Kafka based Global Data Mesh at Wix
5 lessons learned for Successful Migration to Confluent Cloud
Open sourcing a successful internal project - Reversim 2021
Jax london - Battle-tested event-driven patterns for your microservices archi...
Standardizing Microservice Management With a Service Mesh
Advanced Caching Patterns used by 2000 microservices - Api World
Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and ...
Polyglot, Fault Tolerant Event-Driven Programming with Kafka, Kubernetes and ...

What's hot (20)

PPTX
Confluent Cloud Networking | Rajan Sundaram, Confluent
PDF
10 Lessons Learned from using Kafka with 1000 microservices - java global summit
PPTX
Cloud native microservices for systems and applications ieee rev2
PDF
Using Microservices Architecture and Patterns to Address Applications Require...
PDF
Day in the life event-driven workshop
PPTX
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud - An...
PDF
Microservice API Gateways with NGINX
PDF
Ambassador Kubernetes-Native API Gateway
PDF
Network Service Mesh
PDF
A sail in the cloud
PDF
Kong API
PDF
Manage your APIs and Microservices with an API Gateway
PPTX
Using an API Gateway for Microservices
PDF
The what, why and how of knative
PDF
Microservice 4.0 Journey - From Spring NetFlix OSS to Istio Service Mesh and ...
PDF
API Gateway study
PPTX
Kubernetes + netflix oss
PPTX
Knative goes
 beyond serverless | Alexandre Roman
PDF
스타트업을 위한 Confluent 세미나
PDF
WTF Do We Need a Service Mesh?
Confluent Cloud Networking | Rajan Sundaram, Confluent
10 Lessons Learned from using Kafka with 1000 microservices - java global summit
Cloud native microservices for systems and applications ieee rev2
Using Microservices Architecture and Patterns to Address Applications Require...
Day in the life event-driven workshop
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud - An...
Microservice API Gateways with NGINX
Ambassador Kubernetes-Native API Gateway
Network Service Mesh
A sail in the cloud
Kong API
Manage your APIs and Microservices with an API Gateway
Using an API Gateway for Microservices
The what, why and how of knative
Microservice 4.0 Journey - From Spring NetFlix OSS to Istio Service Mesh and ...
API Gateway study
Kubernetes + netflix oss
Knative goes
 beyond serverless | Alexandre Roman
스타트업을 위한 Confluent 세미나
WTF Do We Need a Service Mesh?
Ad

Similar to Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and gRpc - Codemotion (20)

PDF
How to build 1000 microservices with Kafka and thrive
PDF
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
PDF
8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...
PDF
8 Lessons Learned from Using Kafka in 1500 microservices - confluent streamin...
PDF
Greyhound - Powerful Functional Kafka Library - Devtalks reimagined
PDF
Developing Real-Time Data Pipelines with Apache Kafka
PDF
Apache Kafka - Scalable Message-Processing and more !
PDF
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
PDF
PPTX
Building an Event Bus at Scale
PDF
Developing Realtime Data Pipelines With Apache Kafka
PDF
An Introduction to Apache Kafka
PDF
Apache Kafka - Scalable Message-Processing and more !
PDF
Uber: Kafka Consumer Proxy
PDF
Apache Kafka - Scalable Message Processing and more!
PDF
Non-Kafkaesque Apache Kafka - Yottabyte 2018
PPTX
messaging.pptx
PDF
Trivadis TechEvent 2016 Apache Kafka - Scalable Massage Processing and more! ...
PDF
"Wix Serverless from inside", Mykola Borozdin
PDF
Apache Kafka Introduction
How to build 1000 microservices with Kafka and thrive
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...
8 Lessons Learned from Using Kafka in 1500 microservices - confluent streamin...
Greyhound - Powerful Functional Kafka Library - Devtalks reimagined
Developing Real-Time Data Pipelines with Apache Kafka
Apache Kafka - Scalable Message-Processing and more !
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Building an Event Bus at Scale
Developing Realtime Data Pipelines With Apache Kafka
An Introduction to Apache Kafka
Apache Kafka - Scalable Message-Processing and more !
Uber: Kafka Consumer Proxy
Apache Kafka - Scalable Message Processing and more!
Non-Kafkaesque Apache Kafka - Yottabyte 2018
messaging.pptx
Trivadis TechEvent 2016 Apache Kafka - Scalable Massage Processing and more! ...
"Wix Serverless from inside", Mykola Borozdin
Apache Kafka Introduction
Ad

More from Natan Silnitsky (20)

PDF
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
PDF
Integration Ignited Redefining Event-Driven Architecture at Wix - EventCentric
PDF
Reinventing Microservices Efficiency and Innovation with Single-Runtime
PDF
Async Excellence Unlocking Scalability with Kafka - Devoxx Greece
PDF
Wix Single-Runtime - Conquering the multi-service challenge
PDF
WeAreDevs - Supercharge Your Developer Journey with Tiny Atomic Habits
PDF
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
PDF
Effective Strategies for Wix's Scaling challenges - GeeCon
PDF
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
PDF
Workflow Engines & Event Streaming Brokers - Can they work together? [Current...
PDF
DevSum - Lessons Learned from 2000 microservices
PDF
GeeCon - Lessons Learned from 2000 microservices
PDF
Migrating to Multi Cluster Managed Kafka - ApacheKafkaIL
PDF
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices
PDF
BuildStuff - Lessons Learned from 2000 Event Driven Microservices
PDF
Lessons Learned from 2000 Event Driven Microservices - Reversim
PDF
Devoxx Ukraine - Kafka based Global Data Mesh
PDF
Devoxx UK - Migrating to Multi Cluster Managed Kafka
PDF
Dev Days Europe - Kafka based Global Data Mesh at Wix
PDF
Kafka Summit London - Kafka based Global Data Mesh at Wix
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Integration Ignited Redefining Event-Driven Architecture at Wix - EventCentric
Reinventing Microservices Efficiency and Innovation with Single-Runtime
Async Excellence Unlocking Scalability with Kafka - Devoxx Greece
Wix Single-Runtime - Conquering the multi-service challenge
WeAreDevs - Supercharge Your Developer Journey with Tiny Atomic Habits
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Effective Strategies for Wix's Scaling challenges - GeeCon
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Workflow Engines & Event Streaming Brokers - Can they work together? [Current...
DevSum - Lessons Learned from 2000 microservices
GeeCon - Lessons Learned from 2000 microservices
Migrating to Multi Cluster Managed Kafka - ApacheKafkaIL
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices
BuildStuff - Lessons Learned from 2000 Event Driven Microservices
Lessons Learned from 2000 Event Driven Microservices - Reversim
Devoxx Ukraine - Kafka based Global Data Mesh
Devoxx UK - Migrating to Multi Cluster Managed Kafka
Dev Days Europe - Kafka based Global Data Mesh at Wix
Kafka Summit London - Kafka based Global Data Mesh at Wix

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Encapsulation theory and applications.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
MYSQL Presentation for SQL database connectivity
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
A Presentation on Artificial Intelligence
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
KodekX | Application Modernization Development
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
“AI and Expert System Decision Support & Business Intelligence Systems”
Encapsulation theory and applications.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
MYSQL Presentation for SQL database connectivity
The AUB Centre for AI in Media Proposal.docx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectral efficient network and resource selection model in 5G networks
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Advanced methodologies resolving dimensionality complications for autism neur...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
A Presentation on Artificial Intelligence
Network Security Unit 5.pdf for BCA BBA.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KodekX | Application Modernization Development

Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and gRpc - Codemotion