SlideShare a Scribd company logo
Beyond Event
Sourcing
May 2024
Embracing CRUD for Wix's High-Growth
Platform
Beyond Event Sourcing
Hi,
I’m Natan
Backend Infra Tech Lead @Wix
Yoga enthusiast
Speaker
Blogger
natansilnitsky
www.natansil.com
@NSilnitsky
Beyond Event Sourcing @NSilnitsky
Beyond Event Sourcing @NSilnitsky
~4B
Daily HTTP
Transactions
4000±
Microservices
in production
~70B
Kafka
messages a day
Beyond Event Sourcing @NSilnitsky
Agenda
Event sourcing & CQRS Framework for CRUD services
Dev velocity
1
Scalability
2
Performance
3
Resilience
4
* stores
Beyond Event Sourcing @NSilnitsky
Event Sourcing & CQRS
Wix Stores Example
Beyond Event Sourcing @NSilnitsky
Add/Update product QueryProduct
Product Catalog
Beyond Event Sourcing @NSilnitsky
WriteProduct
Event sourcing and CQRS
Product 123:
Product Created
1
Product Changed (price)
2
Product Changed (description)
3
Product Changed (stock-level)
4
ReadProduct
Name
Price
Description
Stock-level
Append-Only
Events
Snapshot
Beyond Event Sourcing @NSilnitsky
Event
Store
CreateProduct:
Catalog Write API
Event sourcing and CQRS
Product Created
Beyond Event Sourcing @NSilnitsky
Event sourcing and CQRS
Product 123:
Product Created
1
Product Changed (price)
2
Product Changed (description)
3
Product Changed (stock-level)
4
Event
Store
CreateProduct:
Catalog Write API
Product Created
Beyond Event Sourcing @NSilnitsky
Replay
GetProduct
Catalog Read API
Event sourcing and CQRS
Replay
events
Product 123:
Product Created
1
Product Changed (price)
2
Product Changed (description)
3
Product Changed (stock-level)
4
Event
Store
CreateProduct:
Catalog Write API
Product Created
Beyond Event Sourcing @NSilnitsky
Event sourcing and CQRS – Advantages
Debug with
“time travel”
GetProduct
Catalog Read API
Replay
events
Product 123:
Product Created
1
Product Changed (price)
2
Product Changed (description)
3
Product Changed (stock-level)
4
Event
Store
CreateProduct:
Catalog Write API
Product Created
Beyond Event Sourcing @NSilnitsky
Product 123:
Product Created
1
Product Changed (price)
2
Product Changed (description)
3
Product Changed (stock-level)
4
…..
5
Product Changed (stock-level)
30
Event
Store
Event sourcing and CQRS
Beyond Event Sourcing @NSilnitsky
Product 123:
Product Created
1
Product Changed (price)
2
Product Changed (description)
3
Product Changed (stock-level)
4
…..
5
Product Changed (stock-level)
30
Event
Store
Product 123 Snapshot
Snapshot
Repository
Event sourcing and CQRS
Beyond Event Sourcing @NSilnitsky
Event sourcing and CQRS - Advantages
Catalog Read API
Inventory
snapshot
Product
Snapshot
Product Created
Product Changed (price)
2
Product Changed (description)
3
Product Changed (stock-level)
Product 123:
1
4
Beyond Event Sourcing @NSilnitsky
Event sourcing and CQRS - Disadvantages
Product
DB
Create/Read Product
Catalog CRUD
Event
Store
CreateProduct:
Catalog Write API
Product Created
Product 123 Snapshot
Snapshot
Repository
Catalog Read API
Beyond Event Sourcing @NSilnitsky
Event sourcing and CQRS - Disadvantages
Product Created (price 4$)
1
Product Changed (price 6$)
2
Product 123:
Snapshot
Repository
Delayed
Product snapshot Consumer
Catalog Write API
Beyond Event Sourcing @NSilnitsky
Event sourcing and CQRS - Disadvantages
Product 123:
Snapshot
Repository
Product Created (price 4$)
1
Product snapshot Consumer
Catalog Write API
Product Changed
2
Product Created (price 4$)
1
Product Changed (price 6$)
2 Delayed
Beyond Event Sourcing @NSilnitsky
Event sourcing and CQRS - Disadvantages
Product Changed (descriptionA)
3
Product Changed (descriptionB)
4
Product 123:
Snapshot
Repository
Product Created (price 4$)
1
Product Changed (descriptionB)
2
Catalog Write API
Product Changed (descriptionA)
3
Product Created (price 4$)
1
Product Changed (price 6$)
2 Delayed
Product snapshot Consumer
Beyond Event Sourcing @NSilnitsky
Event sourcing and CQRS - Disadvantages
Product Changed (descriptionA)
3
Product Changed (descriptionB)
4
Product 123:
Snapshot
Repository
Product Created (price 4$)
1
Product 123 Snapshot
Product Changed (descriptionB)
2
Product
4$
DescriptionA
Product Changed (descriptionA)
3
Catalog Write API
Product Created (price 4$)
1
Product Changed (price 6$)
2 Delayed
Product snapshot Consumer
Beyond Event Sourcing @NSilnitsky
Read your own writes
Event sourcing and CQRS - Disadvantages
Beyond Event Sourcing @NSilnitsky
Event sourcing and CQRS - Disadvantages
Confetti Cannon events:
Product Changed (price -1$)
Read your own writes
Catalog Write API
Event
Store
Beyond Event Sourcing @NSilnitsky
Event sourcing and CQRS - Disadvantages
Confetti Cannon events:
Snapshot
Repository
Confetti Cannon
Snapshot
Physical Item
3$
DescriptionA
Product Changed (price -1$)
Read your own writes
Catalog Write API
Event
Store
Beyond Event Sourcing @NSilnitsky
Event sourcing and CQRS - Disadvantages
Confetti Cannon events:
Snapshot
Repository
Confetti Cannon
Snapshot
Physical Item
3$
DescriptionA
Product Changed (price -1$)
Read your own writes
Catalog Write API
Event
Store
Product Changed (price -1$)
+
Beyond Event Sourcing @NSilnitsky
Product
DB
Update Product
Catalog CRUD
Event sourcing and CQRS - Disadvantages
Read your own writes
Beyond Event Sourcing @NSilnitsky
Read your own writes
Event sourcing and CQRS - Disadvantages
Beyond Event Sourcing
Event sourcing and
CQRS -
Disadvantages
Complexity
Eventual consistency only
Massive scale
Corrupted snapshot
Read your own writes
Beyond Event Sourcing @NSilnitsky
APIs
+
Standardization
Beyond Event Sourcing
@NSilnitsky
RPC
Product Catalog API
Cart
Service
Internal Wix
Developer
Open Platform - API First
* Center 4000, clear,
focused, comprehensive
Beyond Event Sourcing
@NSilnitsky
HTTP/SDK
Product Catalog API
Internal Wix
Developer
PoS
App
External App
Developer
Open Platform - API First
Beyond Event Sourcing
@NSilnitsky
JavaScript
method
Product Catalog API
Internal Wix
Developer
Custom
Filter
External App
Developer
External Wix Site
Developer (Velo)
Open Platform - API First
Beyond Event Sourcing
@NSilnitsky
Product Catalog API
Internal Wix
Developer
External App
Developer
External Wix Site
Developer (Velo)
Open Platform - API First
* CRUD on ES, consistent,
hard in standard way. Users
fast experience
Beyond Event Sourcing @NSilnitsky
Stores
Bookings
Events
Forms
Loyalty Rewards
Tickets Policies
Checkout
Time
Slots
Schemas
Sub
missions
Guests
Coupons
Calendar
Orders
Waitlist
Cart
Catalog
Programs
Open Platform - API First
Internal Wix
Developer
External App
Developer
External Wix Site
Developer (Velo)
Beyond Event Sourcing @NSilnitsky
Wix’s Open Platform
CRUD
Event sourcing
Was
Independent
“startups”
Now
Single Open
Platform
Beyond Event Sourcing @NSilnitsky
Wix’s Open Platform
CRUD
Event sourcing
API First
APIs - TDD
+
FE driven
Was
Independent
“startups”
Now
Single Open
Platform
Beyond Event Sourcing
Framework for
CRUD services
Open Platform
API Schema
Validations & Permissions
Scaffold
Persistence + Event publishing
Data projections (Queries)
Beyond Event Sourcing @NSilnitsky
CreateProduct
Product
Document Store
Catalog API
Product Catalog - CRUD
ReadProduct
UpdateProduct
DeleteProduct
Unified!
Beyond Event Sourcing @NSilnitsky
CreateProduct
ReadProduct
UpdateProduct
DeleteProduct
Catalog API
API First - platformized CRUD
Beyond Event Sourcing @NSilnitsky
CreateProduct
ReadProduct
UpdateProduct
DeleteProduct
Catalog API
API First - platformized CRUD
Beyond Event Sourcing @NSilnitsky
CreateProduct
ReadProduct
UpdateProduct
DeleteProduct
Catalog API
service ProductService {
option (service_entity).message = "...v3.Product";
rpc CreateProduct (CreateProductRequest) returns
(CreateProductResponse) ...
rpc GetProduct (GetProductRequest) returns
(GetProductResponse) ...
rpc UpdateProduct (UpdateProduct) returns (UpdateProduct)
...
…
}
message Product {
option (entity) = {fqdn: "...v3.product"};
google.protobuf.StringValue id = 1;
google.protobuf.Int64Value revision = 2;
...
repeated Inventory inventory = 25;
...
}
API First - platformized CRUD
Beyond Event Sourcing @NSilnitsky
API First - platformized CRUD
CreateProduct
ReadProduct
UpdateProduct
DeleteProduct
Catalog API
service ProductService {
option (service_entity).message = "...v3.Product";
rpc CreateProduct (CreateProductRequest) returns
(CreateProductResponse) ...
rpc GetProduct (GetProductRequest) returns
(GetProductResponse) ...
rpc UpdateProduct (UpdateProduct) returns (UpdateProduct)
...
…
}
message Product {
option (entity) = {fqdn: "...v3.product"};
google.protobuf.StringValue id = 1;
google.protobuf.Int64Value revision = 2;
...
repeated Inventory inventory = 25;
...
}
Beyond Event Sourcing @NSilnitsky
API First - platformized CRUD
Beyond Event Sourcing @NSilnitsky
API First - platformized CRUD
Beyond Event Sourcing @NSilnitsky
Event Driven Architecture
Automatic Domain Events FTW
Beyond Event Sourcing @NSilnitsky
EDA - Domain Events
CreateProduct
UpdateProduct
DeleteProduct
Product Created
Product Updated
Product Deleted
Product
Document Store
Catalog Service
* DE describes…
Beyond Event Sourcing @NSilnitsky
EDA - Domain Events
CreateProduct
UpdateProduct
DeleteProduct
Product Created
Product Updated
Product Deleted
Catalog Service
Product
SDL
* SDL is
document based.
no direct SQL
Beyond Event Sourcing @NSilnitsky
EDA - Domain Events
CreateProduct
UpdateProduct
DeleteProduct
Product Created
Product Updated
Product Deleted
Catalog Service
Product
SDL
* SDL is
document based.
no direct SQL
sdl.insert(request.getProduct.mapTo[ProductDomain])
Beyond Event Sourcing @NSilnitsky
EDA - Domain Events
CreateProduct
UpdateProduct
DeleteProduct
Product Created
Product Updated
Product Deleted
Product
SDL
Catalog Service
Product
SDL
sdlBuilder =
_.withDomainEventsEnabled(_.mapTo[Product])
Beyond Event Sourcing @NSilnitsky
EDA - Domain Events
Data
warehouse/Lake
CreateProduct
UpdateProduct
DeleteProduct
Product Created
Product Updated
Product Deleted
Catalog Service
Product
SDL
* debugging
corruption
Beyond Event Sourcing @NSilnitsky
EDA - Domain Events
ebay-bridge Service
CreateProduct
UpdateProduct
DeleteProduct
Catalog Service
Product Created
Product Updated
Product Deleted
Product
SDL
Beyond Event Sourcing @NSilnitsky
EDA - Domain Events
CreateProduct
UpdateProduct
DeleteProduct
Product Created
Product Updated
Product Deleted
Catalog Service
Product
SDL
Beyond Event Sourcing @NSilnitsky
Data consistency in Wix’s EDA
Resilient Producers and consumers
Beyond Event Sourcing @NSilnitsky
Make DB Update & Event Producing Atomic
Catalog
Service
Ebay Bridge
Service
* atomic,
otherwise
Beyond Event Sourcing @NSilnitsky
Produce event to S3
Resilient Producer
Catch Unsent Events
Catalog Service
Beyond Event Sourcing @NSilnitsky
Produce
to Kafka
Poll
Produce event to S3
Resilient Producer
Fallback to S3 and Heal
Catalog Service Healer Service
Beyond Event Sourcing @NSilnitsky
Consumer retries + DLQ
Make DB Update & Event Producing Atomic
Catalog
Service
Ebay Bridge
Service
Beyond Event Sourcing @NSilnitsky
Alternative - use outbox pattern and/or CDC
Transaction
Outbox Table
Insert
Product Table
Insert
Update
Delete
Database
Instant read-your-own-writes
consistency in Catalog service
Write to
database CDC
Read from
Outbox Table
Kafka
Connect
Debezium
connector
Publishes
messages
to brokers
Kafka
Broker
Eventually consistent data
exchange with Ebay Bridge Service
Catalog
Service
Ebay Bridge Service
Beyond Event Sourcing @NSilnitsky
Data Projection &
query optimization
Materializer
Beyond Event Sourcing @NSilnitsky
Query latency - naive
CreateProduct
ReadProduct
DeleteProduct
Catalog Service
Product
SDL
FilterProductWithInventory
Inventory Service
Inventory
SDL
RPC
1 2
Beyond Event Sourcing @NSilnitsky
Multi-step
Query latency - naive
CreateProduct
ReadProduct
DeleteProduct
Catalog Service
Product
SDL
FilterProductWithInventory
Inventory Service
Inventory
SDL
RPC
price < 100 and stock > 4
2
1
Beyond Event Sourcing @NSilnitsky
Query latency - DB join
CreateProduct
ReadProduct
DeleteProduct
Catalog Service
Product
SDL
FilterProductWithInventory
Inventory Service
Inventory
SDL
DB level Join
Beyond Event Sourcing @NSilnitsky
Query Latency - Materializer
Product +
Inventory
Materializer
Inventory
Inventory updated Event
Catalog
Service
Inventory
Service
FilterProductWithInventory
Beyond Event Sourcing @NSilnitsky
Simplicity
Onboarding new team member
Write performance
Read performance
consistency
Audit log/time machine
Projections/queries
Comparing Event sourcing
to Wix’s CRUD based solution
Event Sourcing
CRUD
SDL+Domain Events
Materializer
Beyond Event Sourcing @NSilnitsky
Simplicity
Onboarding new team member
Write performance
Read performance
consistency
Audit log/time machine
Projections/queries
Comparing Event sourcing
to Wix’s CRUD based solution
Event Sourcing
CRUD
SDL+Domain Events
Materializer
Beyond Event Sourcing @NSilnitsky
Simplicity
Onboarding new team member
Write performance
Read performance
consistency
Audit log/time machine
Projections/queries
Comparing Event sourcing
to Wix’s CRUD based solution
Event Sourcing
CRUD
SDL+Domain Events
Materializer
Beyond Event Sourcing @NSilnitsky
Simplicity
Onboarding new team member
Write performance
Read performance
consistency
Audit log/time machine
Projections/queries
Comparing Event sourcing
to Wix’s CRUD based solution
Event Sourcing
CRUD
SDL+Domain Events
Materializer
Beyond Event Sourcing @NSilnitsky
Simplicity
Onboarding new team member
Write performance
Read performance
consistency
Audit log/time machine
Projections/queries
Comparing Event sourcing
to Wix’s CRUD based solution
Event Sourcing
CRUD
SDL+Domain Events
Materializer
* no consistency
Beyond Event Sourcing @NSilnitsky
Simplicity
Onboarding new team member
Write performance
Read performance
consistency
Audit log/time machine
Projections/queries
Comparing Event sourcing
to Wix’s CRUD based solution
Event Sourcing
CRUD
SDL+Domain Events
Materializer
Beyond Event Sourcing @NSilnitsky
Simplicity
Onboarding new team member
Write performance
Read performance
consistency
Audit log/time machine
Projections/queries
Comparing Event sourcing
to Wix’s CRUD based solution
Event Sourcing
CRUD
SDL+Domain Events
Materializer
Beyond Event Sourcing @NSilnitsky
Summary
Wix successfully shifted its vast distributed system entirely to
CRUD-based microservices, moving away from a CRUD/event sourcing
hybrid.
.
.
.
Beyond Event Sourcing @NSilnitsky
Summary
Wix successfully shifted its vast distributed system entirely to
CRUD-based microservices, moving away from a CRUD/event sourcing
hybrid.
This transformation was driven by a commitment to standardization,
managed infrastructure with automated code generation, and a
decoupled architecture.
Beyond Event Sourcing @NSilnitsky
Summary
Advanced tools were also implemented to boost development speed,
ensure system resilience, and optimize for scale and performance.
Domain Events
Resilient Producer Materializer
Simple Data Layer
Beyond Event Sourcing
Q & A
Thank you
natansilnitsky www.natansil.com
@NSilnitsky
👉 slideshare.net/NatanSilnitsky
Q & A
www.natansil.com
@NSilnitsky

More Related Content

PDF
Refacoring vs Rewriting WixStores
PDF
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
PPTX
Patterns of Distributed Application Design
PDF
Patterns of Distributed Application Design
PDF
Developing event-driven microservices with event sourcing and CQRS (london Ja...
PDF
Kafka as an event store - is it good enough?
PPTX
Scaling Your Architecture with Services and Events
PDF
Developing event-driven microservices with event sourcing and CQRS (Shanghai)
Refacoring vs Rewriting WixStores
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Patterns of Distributed Application Design
Patterns of Distributed Application Design
Developing event-driven microservices with event sourcing and CQRS (london Ja...
Kafka as an event store - is it good enough?
Scaling Your Architecture with Services and Events
Developing event-driven microservices with event sourcing and CQRS (Shanghai)

Similar to Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL (20)

PPTX
Effective Microservices In a Data-centric World
PDF
OReilly SACON2018 - Events on the outside, on the inside, and at the core
PDF
SVCC Developing Asynchronous, Message-Driven Microservices
PDF
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
PDF
Pragmatic Event Driven Microservices
PDF
Developing event-driven microservices with event sourcing and CQRS (phillyete)
PDF
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
PDF
Events and microservices
PPTX
Brown bag eventdrivenmicroservices-cqrs
PDF
Building event-driven (Micro)Services with Apache Kafka
PDF
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
PPTX
CQRS and Event Sourcing
PPTX
Pragmatic CQRS with existing applications and databases (Digital Xchange, May...
PDF
Building and deploying microservices with event sourcing, CQRS and Docker (Me...
PDF
"Database isolation: how we deal with hundreds of direct connections to the d...
PPTX
APIs Vs Events - Bala Bairapaka, Sandvik AB
KEY
Event Driven Architecture
PDF
Building Event Driven (Micro)services with Apache Kafka
PDF
#hacksummit 2016 - event-driven microservices – Events on the outside, on the...
PDF
Developing Event-driven Microservices with Event Sourcing & CQRS (gotoams)
Effective Microservices In a Data-centric World
OReilly SACON2018 - Events on the outside, on the inside, and at the core
SVCC Developing Asynchronous, Message-Driven Microservices
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Pragmatic Event Driven Microservices
Developing event-driven microservices with event sourcing and CQRS (phillyete)
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Events and microservices
Brown bag eventdrivenmicroservices-cqrs
Building event-driven (Micro)Services with Apache Kafka
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
CQRS and Event Sourcing
Pragmatic CQRS with existing applications and databases (Digital Xchange, May...
Building and deploying microservices with event sourcing, CQRS and Docker (Me...
"Database isolation: how we deal with hundreds of direct connections to the d...
APIs Vs Events - Bala Bairapaka, Sandvik AB
Event Driven Architecture
Building Event Driven (Micro)services with Apache Kafka
#hacksummit 2016 - event-driven microservices – Events on the outside, on the...
Developing Event-driven Microservices with Event Sourcing & CQRS (gotoams)
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
Effective Strategies for Wix's Scaling challenges - GeeCon
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
PDF
Migrating to Multi Cluster Managed Kafka - Conf42 - CloudNative
PDF
5 Takeaways from Migrating a Library to Scala 3 - Scala Love
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
Effective Strategies for Wix's Scaling challenges - GeeCon
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
Migrating to Multi Cluster Managed Kafka - Conf42 - CloudNative
5 Takeaways from Migrating a Library to Scala 3 - Scala Love
Ad

Recently uploaded (20)

PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Introduction to Artificial Intelligence
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
L1 - Introduction to python Backend.pptx
PDF
top salesforce developer skills in 2025.pdf
PDF
System and Network Administration Chapter 2
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
history of c programming in notes for students .pptx
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Nekopoi APK 2025 free lastest update
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
Which alternative to Crystal Reports is best for small or large businesses.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Introduction to Artificial Intelligence
CHAPTER 2 - PM Management and IT Context
L1 - Introduction to python Backend.pptx
top salesforce developer skills in 2025.pdf
System and Network Administration Chapter 2
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
history of c programming in notes for students .pptx
Understanding Forklifts - TECH EHS Solution
Operating system designcfffgfgggggggvggggggggg
2025 Textile ERP Trends: SAP, Odoo & Oracle
Nekopoi APK 2025 free lastest update
Wondershare Filmora 15 Crack With Activation Key [2025
Softaken Excel to vCard Converter Software.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Design an Analysis of Algorithms II-SECS-1021-03
How to Choose the Right IT Partner for Your Business in Malaysia

Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL

  • 1. Beyond Event Sourcing May 2024 Embracing CRUD for Wix's High-Growth Platform
  • 2. Beyond Event Sourcing Hi, I’m Natan Backend Infra Tech Lead @Wix Yoga enthusiast Speaker Blogger natansilnitsky www.natansil.com @NSilnitsky
  • 3. Beyond Event Sourcing @NSilnitsky
  • 4. Beyond Event Sourcing @NSilnitsky ~4B Daily HTTP Transactions 4000± Microservices in production ~70B Kafka messages a day
  • 5. Beyond Event Sourcing @NSilnitsky Agenda Event sourcing & CQRS Framework for CRUD services Dev velocity 1 Scalability 2 Performance 3 Resilience 4 * stores
  • 6. Beyond Event Sourcing @NSilnitsky Event Sourcing & CQRS Wix Stores Example
  • 7. Beyond Event Sourcing @NSilnitsky Add/Update product QueryProduct Product Catalog
  • 8. Beyond Event Sourcing @NSilnitsky WriteProduct Event sourcing and CQRS Product 123: Product Created 1 Product Changed (price) 2 Product Changed (description) 3 Product Changed (stock-level) 4 ReadProduct Name Price Description Stock-level Append-Only Events Snapshot
  • 9. Beyond Event Sourcing @NSilnitsky Event Store CreateProduct: Catalog Write API Event sourcing and CQRS Product Created
  • 10. Beyond Event Sourcing @NSilnitsky Event sourcing and CQRS Product 123: Product Created 1 Product Changed (price) 2 Product Changed (description) 3 Product Changed (stock-level) 4 Event Store CreateProduct: Catalog Write API Product Created
  • 11. Beyond Event Sourcing @NSilnitsky Replay GetProduct Catalog Read API Event sourcing and CQRS Replay events Product 123: Product Created 1 Product Changed (price) 2 Product Changed (description) 3 Product Changed (stock-level) 4 Event Store CreateProduct: Catalog Write API Product Created
  • 12. Beyond Event Sourcing @NSilnitsky Event sourcing and CQRS – Advantages Debug with “time travel” GetProduct Catalog Read API Replay events Product 123: Product Created 1 Product Changed (price) 2 Product Changed (description) 3 Product Changed (stock-level) 4 Event Store CreateProduct: Catalog Write API Product Created
  • 13. Beyond Event Sourcing @NSilnitsky Product 123: Product Created 1 Product Changed (price) 2 Product Changed (description) 3 Product Changed (stock-level) 4 ….. 5 Product Changed (stock-level) 30 Event Store Event sourcing and CQRS
  • 14. Beyond Event Sourcing @NSilnitsky Product 123: Product Created 1 Product Changed (price) 2 Product Changed (description) 3 Product Changed (stock-level) 4 ….. 5 Product Changed (stock-level) 30 Event Store Product 123 Snapshot Snapshot Repository Event sourcing and CQRS
  • 15. Beyond Event Sourcing @NSilnitsky Event sourcing and CQRS - Advantages Catalog Read API Inventory snapshot Product Snapshot Product Created Product Changed (price) 2 Product Changed (description) 3 Product Changed (stock-level) Product 123: 1 4
  • 16. Beyond Event Sourcing @NSilnitsky Event sourcing and CQRS - Disadvantages Product DB Create/Read Product Catalog CRUD Event Store CreateProduct: Catalog Write API Product Created Product 123 Snapshot Snapshot Repository Catalog Read API
  • 17. Beyond Event Sourcing @NSilnitsky Event sourcing and CQRS - Disadvantages Product Created (price 4$) 1 Product Changed (price 6$) 2 Product 123: Snapshot Repository Delayed Product snapshot Consumer Catalog Write API
  • 18. Beyond Event Sourcing @NSilnitsky Event sourcing and CQRS - Disadvantages Product 123: Snapshot Repository Product Created (price 4$) 1 Product snapshot Consumer Catalog Write API Product Changed 2 Product Created (price 4$) 1 Product Changed (price 6$) 2 Delayed
  • 19. Beyond Event Sourcing @NSilnitsky Event sourcing and CQRS - Disadvantages Product Changed (descriptionA) 3 Product Changed (descriptionB) 4 Product 123: Snapshot Repository Product Created (price 4$) 1 Product Changed (descriptionB) 2 Catalog Write API Product Changed (descriptionA) 3 Product Created (price 4$) 1 Product Changed (price 6$) 2 Delayed Product snapshot Consumer
  • 20. Beyond Event Sourcing @NSilnitsky Event sourcing and CQRS - Disadvantages Product Changed (descriptionA) 3 Product Changed (descriptionB) 4 Product 123: Snapshot Repository Product Created (price 4$) 1 Product 123 Snapshot Product Changed (descriptionB) 2 Product 4$ DescriptionA Product Changed (descriptionA) 3 Catalog Write API Product Created (price 4$) 1 Product Changed (price 6$) 2 Delayed Product snapshot Consumer
  • 21. Beyond Event Sourcing @NSilnitsky Read your own writes Event sourcing and CQRS - Disadvantages
  • 22. Beyond Event Sourcing @NSilnitsky Event sourcing and CQRS - Disadvantages Confetti Cannon events: Product Changed (price -1$) Read your own writes Catalog Write API Event Store
  • 23. Beyond Event Sourcing @NSilnitsky Event sourcing and CQRS - Disadvantages Confetti Cannon events: Snapshot Repository Confetti Cannon Snapshot Physical Item 3$ DescriptionA Product Changed (price -1$) Read your own writes Catalog Write API Event Store
  • 24. Beyond Event Sourcing @NSilnitsky Event sourcing and CQRS - Disadvantages Confetti Cannon events: Snapshot Repository Confetti Cannon Snapshot Physical Item 3$ DescriptionA Product Changed (price -1$) Read your own writes Catalog Write API Event Store Product Changed (price -1$) +
  • 25. Beyond Event Sourcing @NSilnitsky Product DB Update Product Catalog CRUD Event sourcing and CQRS - Disadvantages Read your own writes
  • 26. Beyond Event Sourcing @NSilnitsky Read your own writes Event sourcing and CQRS - Disadvantages
  • 27. Beyond Event Sourcing Event sourcing and CQRS - Disadvantages Complexity Eventual consistency only Massive scale Corrupted snapshot Read your own writes
  • 28. Beyond Event Sourcing @NSilnitsky APIs + Standardization
  • 29. Beyond Event Sourcing @NSilnitsky RPC Product Catalog API Cart Service Internal Wix Developer Open Platform - API First * Center 4000, clear, focused, comprehensive
  • 30. Beyond Event Sourcing @NSilnitsky HTTP/SDK Product Catalog API Internal Wix Developer PoS App External App Developer Open Platform - API First
  • 31. Beyond Event Sourcing @NSilnitsky JavaScript method Product Catalog API Internal Wix Developer Custom Filter External App Developer External Wix Site Developer (Velo) Open Platform - API First
  • 32. Beyond Event Sourcing @NSilnitsky Product Catalog API Internal Wix Developer External App Developer External Wix Site Developer (Velo) Open Platform - API First * CRUD on ES, consistent, hard in standard way. Users fast experience
  • 33. Beyond Event Sourcing @NSilnitsky Stores Bookings Events Forms Loyalty Rewards Tickets Policies Checkout Time Slots Schemas Sub missions Guests Coupons Calendar Orders Waitlist Cart Catalog Programs Open Platform - API First Internal Wix Developer External App Developer External Wix Site Developer (Velo)
  • 34. Beyond Event Sourcing @NSilnitsky Wix’s Open Platform CRUD Event sourcing Was Independent “startups” Now Single Open Platform
  • 35. Beyond Event Sourcing @NSilnitsky Wix’s Open Platform CRUD Event sourcing API First APIs - TDD + FE driven Was Independent “startups” Now Single Open Platform
  • 36. Beyond Event Sourcing Framework for CRUD services Open Platform API Schema Validations & Permissions Scaffold Persistence + Event publishing Data projections (Queries)
  • 37. Beyond Event Sourcing @NSilnitsky CreateProduct Product Document Store Catalog API Product Catalog - CRUD ReadProduct UpdateProduct DeleteProduct Unified!
  • 38. Beyond Event Sourcing @NSilnitsky CreateProduct ReadProduct UpdateProduct DeleteProduct Catalog API API First - platformized CRUD
  • 39. Beyond Event Sourcing @NSilnitsky CreateProduct ReadProduct UpdateProduct DeleteProduct Catalog API API First - platformized CRUD
  • 40. Beyond Event Sourcing @NSilnitsky CreateProduct ReadProduct UpdateProduct DeleteProduct Catalog API service ProductService { option (service_entity).message = "...v3.Product"; rpc CreateProduct (CreateProductRequest) returns (CreateProductResponse) ... rpc GetProduct (GetProductRequest) returns (GetProductResponse) ... rpc UpdateProduct (UpdateProduct) returns (UpdateProduct) ... … } message Product { option (entity) = {fqdn: "...v3.product"}; google.protobuf.StringValue id = 1; google.protobuf.Int64Value revision = 2; ... repeated Inventory inventory = 25; ... } API First - platformized CRUD
  • 41. Beyond Event Sourcing @NSilnitsky API First - platformized CRUD CreateProduct ReadProduct UpdateProduct DeleteProduct Catalog API service ProductService { option (service_entity).message = "...v3.Product"; rpc CreateProduct (CreateProductRequest) returns (CreateProductResponse) ... rpc GetProduct (GetProductRequest) returns (GetProductResponse) ... rpc UpdateProduct (UpdateProduct) returns (UpdateProduct) ... … } message Product { option (entity) = {fqdn: "...v3.product"}; google.protobuf.StringValue id = 1; google.protobuf.Int64Value revision = 2; ... repeated Inventory inventory = 25; ... }
  • 42. Beyond Event Sourcing @NSilnitsky API First - platformized CRUD
  • 43. Beyond Event Sourcing @NSilnitsky API First - platformized CRUD
  • 44. Beyond Event Sourcing @NSilnitsky Event Driven Architecture Automatic Domain Events FTW
  • 45. Beyond Event Sourcing @NSilnitsky EDA - Domain Events CreateProduct UpdateProduct DeleteProduct Product Created Product Updated Product Deleted Product Document Store Catalog Service * DE describes…
  • 46. Beyond Event Sourcing @NSilnitsky EDA - Domain Events CreateProduct UpdateProduct DeleteProduct Product Created Product Updated Product Deleted Catalog Service Product SDL * SDL is document based. no direct SQL
  • 47. Beyond Event Sourcing @NSilnitsky EDA - Domain Events CreateProduct UpdateProduct DeleteProduct Product Created Product Updated Product Deleted Catalog Service Product SDL * SDL is document based. no direct SQL sdl.insert(request.getProduct.mapTo[ProductDomain])
  • 48. Beyond Event Sourcing @NSilnitsky EDA - Domain Events CreateProduct UpdateProduct DeleteProduct Product Created Product Updated Product Deleted Product SDL Catalog Service Product SDL sdlBuilder = _.withDomainEventsEnabled(_.mapTo[Product])
  • 49. Beyond Event Sourcing @NSilnitsky EDA - Domain Events Data warehouse/Lake CreateProduct UpdateProduct DeleteProduct Product Created Product Updated Product Deleted Catalog Service Product SDL * debugging corruption
  • 50. Beyond Event Sourcing @NSilnitsky EDA - Domain Events ebay-bridge Service CreateProduct UpdateProduct DeleteProduct Catalog Service Product Created Product Updated Product Deleted Product SDL
  • 51. Beyond Event Sourcing @NSilnitsky EDA - Domain Events CreateProduct UpdateProduct DeleteProduct Product Created Product Updated Product Deleted Catalog Service Product SDL
  • 52. Beyond Event Sourcing @NSilnitsky Data consistency in Wix’s EDA Resilient Producers and consumers
  • 53. Beyond Event Sourcing @NSilnitsky Make DB Update & Event Producing Atomic Catalog Service Ebay Bridge Service * atomic, otherwise
  • 54. Beyond Event Sourcing @NSilnitsky Produce event to S3 Resilient Producer Catch Unsent Events Catalog Service
  • 55. Beyond Event Sourcing @NSilnitsky Produce to Kafka Poll Produce event to S3 Resilient Producer Fallback to S3 and Heal Catalog Service Healer Service
  • 56. Beyond Event Sourcing @NSilnitsky Consumer retries + DLQ Make DB Update & Event Producing Atomic Catalog Service Ebay Bridge Service
  • 57. Beyond Event Sourcing @NSilnitsky Alternative - use outbox pattern and/or CDC Transaction Outbox Table Insert Product Table Insert Update Delete Database Instant read-your-own-writes consistency in Catalog service Write to database CDC Read from Outbox Table Kafka Connect Debezium connector Publishes messages to brokers Kafka Broker Eventually consistent data exchange with Ebay Bridge Service Catalog Service Ebay Bridge Service
  • 58. Beyond Event Sourcing @NSilnitsky Data Projection & query optimization Materializer
  • 59. Beyond Event Sourcing @NSilnitsky Query latency - naive CreateProduct ReadProduct DeleteProduct Catalog Service Product SDL FilterProductWithInventory Inventory Service Inventory SDL RPC 1 2
  • 60. Beyond Event Sourcing @NSilnitsky Multi-step Query latency - naive CreateProduct ReadProduct DeleteProduct Catalog Service Product SDL FilterProductWithInventory Inventory Service Inventory SDL RPC price < 100 and stock > 4 2 1
  • 61. Beyond Event Sourcing @NSilnitsky Query latency - DB join CreateProduct ReadProduct DeleteProduct Catalog Service Product SDL FilterProductWithInventory Inventory Service Inventory SDL DB level Join
  • 62. Beyond Event Sourcing @NSilnitsky Query Latency - Materializer Product + Inventory Materializer Inventory Inventory updated Event Catalog Service Inventory Service FilterProductWithInventory
  • 63. Beyond Event Sourcing @NSilnitsky Simplicity Onboarding new team member Write performance Read performance consistency Audit log/time machine Projections/queries Comparing Event sourcing to Wix’s CRUD based solution Event Sourcing CRUD SDL+Domain Events Materializer
  • 64. Beyond Event Sourcing @NSilnitsky Simplicity Onboarding new team member Write performance Read performance consistency Audit log/time machine Projections/queries Comparing Event sourcing to Wix’s CRUD based solution Event Sourcing CRUD SDL+Domain Events Materializer
  • 65. Beyond Event Sourcing @NSilnitsky Simplicity Onboarding new team member Write performance Read performance consistency Audit log/time machine Projections/queries Comparing Event sourcing to Wix’s CRUD based solution Event Sourcing CRUD SDL+Domain Events Materializer
  • 66. Beyond Event Sourcing @NSilnitsky Simplicity Onboarding new team member Write performance Read performance consistency Audit log/time machine Projections/queries Comparing Event sourcing to Wix’s CRUD based solution Event Sourcing CRUD SDL+Domain Events Materializer
  • 67. Beyond Event Sourcing @NSilnitsky Simplicity Onboarding new team member Write performance Read performance consistency Audit log/time machine Projections/queries Comparing Event sourcing to Wix’s CRUD based solution Event Sourcing CRUD SDL+Domain Events Materializer * no consistency
  • 68. Beyond Event Sourcing @NSilnitsky Simplicity Onboarding new team member Write performance Read performance consistency Audit log/time machine Projections/queries Comparing Event sourcing to Wix’s CRUD based solution Event Sourcing CRUD SDL+Domain Events Materializer
  • 69. Beyond Event Sourcing @NSilnitsky Simplicity Onboarding new team member Write performance Read performance consistency Audit log/time machine Projections/queries Comparing Event sourcing to Wix’s CRUD based solution Event Sourcing CRUD SDL+Domain Events Materializer
  • 70. Beyond Event Sourcing @NSilnitsky Summary Wix successfully shifted its vast distributed system entirely to CRUD-based microservices, moving away from a CRUD/event sourcing hybrid. . . .
  • 71. Beyond Event Sourcing @NSilnitsky Summary Wix successfully shifted its vast distributed system entirely to CRUD-based microservices, moving away from a CRUD/event sourcing hybrid. This transformation was driven by a commitment to standardization, managed infrastructure with automated code generation, and a decoupled architecture.
  • 72. Beyond Event Sourcing @NSilnitsky Summary Advanced tools were also implemented to boost development speed, ensure system resilience, and optimize for scale and performance. Domain Events Resilient Producer Materializer Simple Data Layer
  • 73. Beyond Event Sourcing Q & A Thank you natansilnitsky www.natansil.com @NSilnitsky 👉 slideshare.net/NatanSilnitsky