JS Conf JP

Matan Kushner

Matan Kushner

Matan is a full-stack developer, open-source maintainer, and digital nomad, passionate about making development delightful, easy, and accessible. Prior to leading the development team at Tenkai, Matan was responsible for building real-time collaborative features at CodeSandbox. In his free time, Matan builds open-source JavaScript and Rust libraries and tools.

Building Offline and Real-Time Applications – The Magic of CRDTs

11/26/2022, 16:00 - 16:30
Track C
Spoken language: en
Slide language: en

Real-time and offline applications have opened the door to premium, native-like experiences on the web. These features have set sites apart from their competition, allowing Google Docs to dethrone Microsoft Word, Figma to overtake Sketch, and Slack to nearly replace email. "The underlying magic powering many of these sites is CRDTs: Conflict-free replicated data types — a type of data structure used in distributed applications. Despite the daunting-sounding jargon, CRDTs as tool in your toolkit can be understood and used pretty simply." By walking through an example of a to-do list application, we'll see how a traditional approach to managing a todo list state may begin to break when using it while offline. Having users edit the same to-do list items simultaneously can lead to an incorrect or corrupt state. We'll then gradually convert the application state to use the three CRDT principles: commutativity, associativity, and idempotency, to make it resilient to changes being made concurrently or offline. Finally, we'll briefly demonstrate examples of real-world applications using CRDTs in production and what their underlying design might look like. In the end, attendees should know enough of the basics of CRDTs to put them into practice in apps they're developing today.