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 J.D Nicholls

Building distributed apps with Temporal

A brief introduction about using Temporal for building distributed systems

  • 345