Resilient Services with Clojure and Temporal
January 19, 2023
About Me – Greg Haskins
Agenda
Part 1: Introduction to Temporal
What is Temporal?
A platform and framework for the reliable execution of your code recognizing:
Many applications want to be hardened to remain available and correct despite these situations. Temporal helps you do this.
How does Temporal help?
What does this look like?
What does this look like? (continued)
Fault Remediation
Workflows
Workflows (continued)
Workflows are functional, and a natural match to Clojure.
Workflows (continued)
Workflows (continued)
Workflows have the concept of an ID.
Activities
Activities share a few similar traits with Workflows:
They are also distinct in several ways:
Signals
Signals are a way for Clients or Workflows to send a payload to a running Workflow using a Channel metaphor.
Part 2: Temporal Clojure SDK
Temporal Clojure SDK
If you need heterogeneity between Clients and Workflows, this SDK is not for you.
Workflow Definition
Hi, Bob
Chaining, Parallelization, and Error Channeling
For more information, visit Safe Blocking within Workflows.
Signals
Context
Side Effects
Non-deterministic operations such as generating random numbers can be implemented as a Side Effect via the temporal.side-effect namespace.
Values returned by the side-effect become part of the durable Event History and are not re-invoked during replay.
Idempotency
Activities must either be Idempotent or tolerate at-least-once behavior.
Idempotency (continued)
Avoid this
Do this instead
Following this RMW pattern allows:
Cluster Coordination
The Workflow ID uniqueness guarantees and the signal-with-start concept provide the primitives for powerful cluster coordination patterns without using external tools.
Fatal Errors and Retries
Roadmap
Unit Testing
The SDK provides a test framework to facilitate Workflow unit-testing including an in-memory implementation of the Temporal service.
Part 3 - Demo
Demo: ReminderBot
A Bot for Slack that adds a /remindme command that allows you to schedule a future reminder posted back to yourself at a specific time using Temporal.
https://github.com/ghaskins/reminderbot
Thank you!