In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immu...
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Size: 3.38 MB
Language: en
Added: May 29, 2024
Slides: 74 pages
Slide Content
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 velocity1
Scalability
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
CartCatalog
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";
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
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