From ruby on rails to event
driven micro-apps
lessons learned from building microservices @ Fiverr
#indoerswetrust
Hi there!
● Alex Litvak
● 2 years ago - TLV --> NYC
● Fresh daddy
● 12 years of software
engineering
● Group manager @ Fiverr
● Past - fintech, IDF
#indoerswetrust
● Largest marketplace for
digital services (gigs) in
the world
● Service As a Product
● 100+ categories
● A new transaction every 5
seconds
● A new service (gig) is
created every 4 minutes
Who are we?
#indoerswetrust
Programming languages
#indoerswetrust
Persistence
#indoerswetrust
Messaging & Data integration
#indoerswetrust
Ops
#indoerswetrust
Autonomous
cross functional task forces
● ~15 Task Forces
● 2 engineering sites
● Loosely coupled, highly aligned
#indoerswetrust
Our Story of Building Microservices
From an architectural point of view
#indoerswetrust
Chapter 1: The Monolith
#indoerswetrust
● 2010
● RoR + MySQL +
memcached
● Fast bootstrapping
● Easy to test and
deploy
The monolith
#indoerswetrust
● Models lose cohesiveness
● Coupled, slowed down teams
● No Ownership
● Fear of deploy
● Long running tests
● No way to scale parts of the system
● More data -> slower queries ->
longer response times
But, the monolith “matures”...
#indoerswetrust
We needed a solution that can scale
#indoerswetrust
#indoerswetrust
Chapter 2: The Chimera
#indoerswetrust
Chimera: a fire-breathing she-monster in Greek mythology
having a lion's head, a goat's body, and a serpent's tail
A Fiverr microservice template consisting of
(1) a REST API endpoint for synchronous reads
(2) a RabbitMQ consumer for asynchronous writes
Residing in the same Repo, sharing the same business
logic code
#indoerswetrust
- Very popular general
purpose message
broker
- point to point,
request/reply and
pub-sub
communication styles
patterns
- smart broker / dumb
consumer model
RabbitMQ
#indoerswetrust
Reading Data
#indoerswetrust
Writing Data
#indoerswetrust
Other out of the box chimera “features”
- Various DB connectors
- Logging & Monitoring
- Write side fail safety
#indoerswetrust
- Read side failure - we can just refresh the
page….
- Write side failure - can have business
implications
Write Side Fail Safety
#indoerswetrust
#indoerswetrust
To requeue events:
Idempotency + one transaction
#indoerswetrust
First Services -
“Service for
every entity”
concept
#indoerswetrust
Services per entity
becomes a
bloated API
for every feature
and lose their
cohesiveness
#indoerswetrust
Services per entity are
services with blurry
boundaries and loose
team ownership
#indoerswetrust
So, How should have we split the monolith?
#indoerswetrust
Let’s talk about bounded contexts
- DDD deals with large
models by dividing
them into different
Bounded Contexts
- Boundaries are usually
defined by
- Context &
meaning
- Business
processes /
activities source: https://martinfowler.com/bliki/BoundedContext.html
#indoerswetrust
Moving to services based on business processes / activities.
Not based on Entities.
#indoerswetrust
Sometimes, easier said
than done...
#indoerswetrust
Well defined service boundaries require access to shared
data.
#indoerswetrust
And sometimes to data from a specific
domain...
#indoerswetrust
How would our services share data?
#indoerswetrust
- Coupling at the lowest level
- Altering same data
- Service not optimizing storage
for unique usage
- Data computation cannot scale
Share a database
#indoerswetrust
- ServiceA API changes due to
serviceB needs
- REST sucks as a query
language - no way to slice and
dice data
- “Do this!” instead of “something
happened”
- Data corruption over time
Pull data,
Push Commands
#indoerswetrust
- Producer and consumer are
decoupled
- Services become reactive
- Data can be sent in the payload of the
event (OrderCreated)
BUT
- If data is persisted in each service -
lacking single point of truth
- No history of data transported - no
way of reconstructing the data
Event Driven
#indoerswetrust
Commands -> Domain Events
StartSellerVacation -> SellerVacationStarted
#indoerswetrust
#indoerswetrust
#indoerswetrust
CQRS - Command Query Responsibility Segregation
#indoerswetrust
Reads > Writes
90% 10%
#indoerswetrust
#indoerswetrust
#indoerswetrust
#indoerswetrust
Solving transporting / sharing of data between services
#indoerswetrust
Building on top of our current event
driven architecture, we started looking
into centralized persisted stream of
events to be able to have
- One source of truth
- The ability to have a history of all
events and replay them if needed
#indoerswetrust
- designed for high volume
publish-subscribe messages
and streams
- provides a durable message
store
- stores streams of records in
categories called topics
- Dumb broker, smart
consumers
- Developed originally by
LinkedIn
Apache Kafka
#indoerswetrust
Not the best idea to consume data from
domain events...
#indoerswetrust
We decided to define a new type of event
A State Change Event
#indoerswetrust
Chapter 3: The Raven
#indoerswetrust
Ravens: Can fly great distances at speed, and are used by
the maesters of Westeros to pass messages between the
castles and cities of the Seven Kingdoms
A Fiverr State Change Event describing a change in the
attributes of an entity followed by a command to a chimera.
#indoerswetrust
● Fine Grained - describe the exact change that occurred, and only that
change.
○ GigUpdated - BAD
○ GigDescriptionUpdated - GOOD
○ UserOnVacationStatusUpdated - GOOD
○ OrderDeliveryTimeUpdated - GOOD
○ OrderUpdated - BAD
● Named in a past participle verb - it’s something that already happened
● Immutable
● Contains just the information about that specific change and nothing more
Ravens - Some Guidelines
#indoerswetrust
But what we currently have is a weakly typed,
decentralized messaging contract
#indoerswetrust
Raven -
A Strongly Typed
State Change
Event
implemented using Protocol Buffers
“Protocol buffers are Google's
language-neutral, platform-neutral,
extensible mechanism for
serializing structured data.
#indoerswetrust
Raven -
A Strongly Typed,
Centralized
State Change
Event
implemented using Protocol Buffers
#indoerswetrust
Aggregate - a cluster of domain objects that can be treated
as a unit. It consists of a root entity and possibly one or more
other associated entities and value objects.
(DDD / Eric Evans)
#indoerswetrust
Mapping our domain into Aggregates & Entities.
#indoerswetrust
message Metadata {
string message_type = 1;
string event_uid = 2;
string process_uid = 3;
int32 version = 4;
string aggregate_root_id = 5;
raven.aggregate.Root aggregate_root = 6;
raven.Entity related_entity_type = 7;
string related_entity_id = 8;
int32 created_at = 9;
raven.Operation operation = 10;
}
Describing Changes in our domain in a generic way using
aggregates & entities
#indoerswetrust
-
From sending domain events
#indoerswetrust
To event sourcing on the consuming chimera
{ id: 5 }
{id: 5, title: “cool gig”}
{id: 5, title: “cool gig”,
description: “bla bla…” }
#indoerswetrust
To event sourcing everywhere - events as source of truth
{ id: 5 }
{id: 5, title: “cool gig”}
{id: 5, title: “cool gig”,
description: “bla bla…” }
{ id: 5 }
{id: 5, title: “cool gig”}
{id: 5, title: “cool gig”,
description: “bla bla…” }
#indoerswetrust
- Storage + Messaging
- Highly scalable - data is immutable,
only append operations - O(1)
- The smarts are isolated inside
each bounded context.
- The Data is shared.
The Operation on the data is
Decentralized - inside the
bounded
context of the service.
- The distributed log becomes
Single point of truth.
Sharing data between Chimeras is solved!
#indoerswetrust
But What about Domain Events?
#indoerswetrust
Domain Events must be send via Kafka to maintain
ordering
#indoerswetrust
Problems solved - Transporting and Sharing Data,
Team autonomy on the service level
Remaining Problems - Rails is a big bowl of Read side mud,
some services are still serving as both read and write side, No
team ownership
#indoerswetrust
We had a new mission - Kill Ruby on Rails.
#indoerswetrust
#indoerswetrust
Chapter 4: The Perseus
#indoerswetrust
Perseus: the greatest Greek hero and slayer of monsters
before the days of Heracles
The Fiverr Slayer of Ruby on Rails - a NodeJS based
micro-frontend structured as a ReactJS SPA for a specific
vertical (gig page, order page, checkout page)
#indoerswetrust
LOSA - Thanks,
Lots Of Small Apps
#indoerswetrust
LOSA = Lots Of Small Apps
- Each microfrontend is a web application
encapsulating a UX vertical.
- Can be implemented and owned
independently.
- Reusable FE components implemented as
NPM packages.
#indoerswetrust
Are we still
constructing
the data for
the
presentation
layer as a
composition of
service calls?
#indoerswetrust
Service data composition -> complex caching
#indoerswetrust
Chapter 4: The Phoenix
#indoerswetrust
Phoenix: a unique bird that lived for five or six centuries in
the Arabian desert, after this time burning itself on a funeral
pyre and rising from the ashes with renewed youth to live
through another cycle.
A Fiverr presentation data aggregator - consuming Ravens
and building a read optimized projection of the data
consumed by Perseus to generate views.
Can renew its data view by replaying the Ravens.
#indoerswetrust
Event Sourcing works great with
CQRS!
#indoerswetrust
Read
Optimized
Views
#indoerswetrust
#indoerswetrust
V4 Backend Architecture Explained
The Full Picture
#indoerswetrust
● Only embark on this journey if you need to really SCALE
● Give teams full autonomy but have a dedicated Architect / committee that has
the full picture in mind
● Break the monolith by bounded contexts, not data
● Prefer async communication between services
● Less technical coupling <-> Less organizational coupling
● Domain events are great to propagate notifications, not data
Lessons Learned - Summary
#indoerswetrust
● Design for failure
● Most of the time, your system will be in the “in between” phase
● Think about your reading and writing patterns - design your system
accordingly
● Prefer strongly typed, well documented messaging contracts
● If you struggle with cache invalidations -> there is another way
● Event sourcing works great with CQRS and microservices integration, but
don’t event source everything.
Lessons Learned - Summary
#indoerswetrust
Stay in touch!
alex.l@fiverr.com
https://www.linkedin.com/in/alexlitvak/
http://engineering.fiverr.com - our engineering blog
We are hiring!
https://www.fiverr.com/jobs/offices/nyc/rnd
Thank You.

More Related Content

PPTX
Introduction to docker and oci
PDF
Building microservices with grpc
PDF
Decompose your monolith: strategies for migrating to microservices (Tide)
PPTX
Apache Airflow in Production
PPTX
Introduction to Microservices
PDF
Kubernetes Cost Optimization
PPTX
Distributed Tracing in Practice
PDF
Docker 101: Introduction to Docker
Introduction to docker and oci
Building microservices with grpc
Decompose your monolith: strategies for migrating to microservices (Tide)
Apache Airflow in Production
Introduction to Microservices
Kubernetes Cost Optimization
Distributed Tracing in Practice
Docker 101: Introduction to Docker

What's hot (20)

PDF
Put the ‘Auto’ in Autoscaling – Make Kubernetes VPA and HPA work together for...
PDF
Decentralized Application: A Software Engineering Perspective
PDF
Kubernetes Docker Container Implementation Ppt PowerPoint Presentation Slide ...
PDF
Apache Airflow Architecture
PDF
Knockout js session
PDF
Different Career Paths in Data Science
PDF
KrakenD API Gateway
PDF
Hyperledger Fabric Architecture
PDF
[WhaTap DevOps Day] 세션 6 : 와탭랩스 DevOps 이야기
PDF
Web3 Security: The Blockchain is Your SIEM
PDF
ProxySQL at Scale on AWS.pdf
PDF
Designing a complete ci cd pipeline using argo events, workflow and cd products
PDF
개발자를 위한 (블로그) 글쓰기 intro
PPTX
Dockers and containers basics
PPTX
DevOps cultura y herramientas
PPTX
How to Design Resilient Odoo Crons
PDF
클라우드의 대세 쿠버네티스란 무엇인가?(윤성훈 클라우드 솔루션 아키텍트) - Webinar
PDF
Introduction au web3.pdf
PDF
FIWARE Wednesday Webinars - How to Secure IoT Devices
Put the ‘Auto’ in Autoscaling – Make Kubernetes VPA and HPA work together for...
Decentralized Application: A Software Engineering Perspective
Kubernetes Docker Container Implementation Ppt PowerPoint Presentation Slide ...
Apache Airflow Architecture
Knockout js session
Different Career Paths in Data Science
KrakenD API Gateway
Hyperledger Fabric Architecture
[WhaTap DevOps Day] 세션 6 : 와탭랩스 DevOps 이야기
Web3 Security: The Blockchain is Your SIEM
ProxySQL at Scale on AWS.pdf
Designing a complete ci cd pipeline using argo events, workflow and cd products
개발자를 위한 (블로그) 글쓰기 intro
Dockers and containers basics
DevOps cultura y herramientas
How to Design Resilient Odoo Crons
클라우드의 대세 쿠버네티스란 무엇인가?(윤성훈 클라우드 솔루션 아키텍트) - Webinar
Introduction au web3.pdf
FIWARE Wednesday Webinars - How to Secure IoT Devices
Ad

Similar to Fiverr architecture (20)

PPTX
Architecting Microservices in .Net
PDF
Microservices: Splitting the Monolith the DDD Way
PPTX
Event Driven Microservices architecture
PDF
Scaling Production Data across Microservices
PPTX
Let's talk about... Microservices
PPTX
Microservices with .Net - NDC Sydney, 2016
PPTX
Introduction to Microservices Patterns
PPTX
Introduction to Microservices Patterns
PDF
Microservice Architecuture with Event Sourcing @ Sydney JVM Meetup
PDF
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
PPTX
Breaking it Down: Microservices Architecture for PHP Developers
PDF
Microservices for java architects schamburg-2015-05-19
PPTX
Jeffrey Richter
PDF
Building and deploying microservices with event sourcing, CQRS and Docker (Ha...
PDF
Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)
PDF
Events on the outside, on the inside and at the core (jaxlondon)
PDF
Events on the outside, on the inside and at the core - Chris Richardson
PDF
An Introduction to IaaS Framework
PDF
Azure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
PPTX
Chapter 05: Eclipse Vert.x - Service Discovery, Resilience and Stability Patt...
Architecting Microservices in .Net
Microservices: Splitting the Monolith the DDD Way
Event Driven Microservices architecture
Scaling Production Data across Microservices
Let's talk about... Microservices
Microservices with .Net - NDC Sydney, 2016
Introduction to Microservices Patterns
Introduction to Microservices Patterns
Microservice Architecuture with Event Sourcing @ Sydney JVM Meetup
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Breaking it Down: Microservices Architecture for PHP Developers
Microservices for java architects schamburg-2015-05-19
Jeffrey Richter
Building and deploying microservices with event sourcing, CQRS and Docker (Ha...
Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)
Events on the outside, on the inside and at the core (jaxlondon)
Events on the outside, on the inside and at the core - Chris Richardson
An Introduction to IaaS Framework
Azure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
Chapter 05: Eclipse Vert.x - Service Discovery, Resilience and Stability Patt...
Ad

Recently uploaded (20)

PPTX
Cybersecurity: Protecting the Digital World
PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
Visual explanation of Dijkstra's Algorithm using Python
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
PPTX
Introduction to Windows Operating System
PDF
Website Design Services for Small Businesses.pdf
PPTX
Tech Workshop Escape Room Tech Workshop
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
Guide to Food Delivery App Development.pdf
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PPTX
Computer Software - Technology and Livelihood Education
PDF
iTop VPN Crack Latest Version Full Key 2025
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PPTX
Airline CRS | Airline CRS Systems | CRS System
PPTX
Trending Python Topics for Data Visualization in 2025
Cybersecurity: Protecting the Digital World
Practical Indispensable Project Management Tips for Delivering Successful Exp...
Advanced SystemCare Ultimate Crack + Portable (2025)
Visual explanation of Dijkstra's Algorithm using Python
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
Introduction to Windows Operating System
Website Design Services for Small Businesses.pdf
Tech Workshop Escape Room Tech Workshop
MCP Security Tutorial - Beginner to Advanced
Guide to Food Delivery App Development.pdf
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
Computer Software - Technology and Livelihood Education
iTop VPN Crack Latest Version Full Key 2025
How to Use SharePoint as an ISO-Compliant Document Management System
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
How Tridens DevSecOps Ensures Compliance, Security, and Agility
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
Airline CRS | Airline CRS Systems | CRS System
Trending Python Topics for Data Visualization in 2025

Fiverr architecture