Building distributed apps with Temporal

I'm J.D. Nicholls 👋

- Open Source Contributor 👨‍💻

- Game developer (Hobby) 🎮

- Developer who loves UX 💫

- Chocolate lover 🍫

- Founding Full-Stack Engineer 👷

AT

Problems when building distributed systems

- Reliability
- Fault-tolerant

- Replicated state machine

- Retry policies

 

There are tradeoffs between

Consistency & Availability

The “CAP” Theorem

(Strongly) Consistent, (Always) Available, Partition-tolerant

Replicate data

Event-Driven Architectures

Event-driven architectures and queue-driven design promise ease of deployment and scale, but are a development nightmare.

Note: If queues start to grow significantly, the queue size can become larger than memory, resulting in cache misses, disk reads, and even slower performance (queues can add delays and complexity)

Why Microservices Are Overrated? 

This creates great complexity for error handling and propagation of state across disparate services.

Redis is useful as a simple message broker but messages can be lost.

RabbitMQ is popular but requires you to adapt to the 'AMQP' protocol and manage your own nodes.

Amazon SQS is hosted but can have high latency and has the possibility of messages being delivered twice.

With Temporal

Application state, retries, and error handling are abstracted away so that you no longer have to code for them. System testing is a breeze because Temporal eliminates common failure scenarios.

Distributed Transactions

The Saga Pattern maintains data integrity in distributed systems by undoing previous operations if a step fails, using compensating transactions.

The pattern requires a complex programming model that develops and designs compensating transactions for rolling back and undoing changes.

Workflow definitions allow you to more easily understand, debug, and modify sagas

Getting Stated

Examples

NestJS
Django

Building distributed apps with Temporal

By Juan David Nicholls

Building distributed apps with Temporal

A brief introduction about using Temporal for building distributed systems

  • 116