Event‑Driven Messaging Patterns at Wix: Consumption, Projection, End‑to‑End Streaming, In‑Memory KV Stores, Scheduling, Transactions, and Aggregation
The article describes how Wix engineers built a robust, Kafka‑based event‑driven messaging infrastructure for over 1,400 microservices, detailing patterns such as consumption and projection, end‑to‑end streaming with websockets, in‑memory KV stores, schedule‑and‑forget jobs, exactly‑once transactions, and event aggregation to achieve scalability, resilience, and low‑latency data access.
Over the past year the author worked on Wix's event‑driven messaging infrastructure built on Kafka, serving more than 1,400 microservices and providing a scalable backbone for growing traffic and storage needs.
1. Consumption and Projection – To alleviate bottlenecks in popular services like MetaSite, Wix streams all site‑metadata objects to a Kafka topic, creates a write‑only service that projects only the installed‑app‑context into a dedicated database, and a read‑only service that serves queries from this materialized view.
2. End‑to‑End Event‑Driven Flow – By combining Kafka with WebSocket managers, Wix replaces request‑reply polling with a fully distributed, fault‑tolerant pipeline for importing contacts, delivering real‑time status updates to browsers without maintaining server‑side state.
3. In‑Memory KV Store – Compressed Kafka topics act as persistent, zero‑latency key/value stores, enabling services such as Business Manager, Bookings, and Events to share configuration data (e.g., country lists, time‑zones) instantly across data centers.
4. Schedule‑and‑Forget – Recurring jobs like subscription renewals are orchestrated by publishing requests to Kafka instead of repeatedly calling REST endpoints, leveraging Kafka’s ordered processing and built‑in retry mechanisms to ensure eventual success without heavy DB locking.
5. Transactions in Events – Exactly‑once semantics are achieved by wrapping checkout processing in Kafka producer transactions, guaranteeing that downstream services (inventory, delivery, invoicing) see each event only after the transaction commits.
6. Event Aggregation – Using compacted topics as an atomic KV store, Wix tracks the completion of many parallel import jobs, updating a job‑completed counter in a deterministic order and notifying users via WebSocket once all jobs finish.
The overall design demonstrates how Kafka enables ordered processing, reduces retry frequency, improves fault tolerance, and decouples microservices while maintaining strong consistency guarantees.
IT Architects Alliance
Discussion and exchange on system, internet, large‑scale distributed, high‑availability, and high‑performance architectures, as well as big data, machine learning, AI, and architecture adjustments with internet technologies. Includes real‑world large‑scale architecture case studies. Open to architects who have ideas and enjoy sharing.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.