Temporal
Eliminate complex error or retry logic, avoid callbacks, and ensure that every workflow you start, completes. Temporal delivers durable execution for your services and applications.
Temporal provides developers with a valuable guarantee. The code you write will be durable, executing reliably despite underlying conditions that would cause most other programs to fail. The process might crash, the server running the code might be rebooted during system maintenance, or a service you call may temporarily go offline. None of these are an obstacle for a Workflow, and with Temporal, you code as if they weren’t even possible.
If a regular method in Java crashes during execution, all of its state is lost. It can’t be resumed, only restarted. From the developer’s perspective, a Temporal Workflow resumes its execution at the point where the crash occurred, with all previous state intact, and continues on from there. Since you’ve already seen and run several Workflows, you might wonder how it’s able to achieve this, since there’s no obvious checkpointing or state management in the code.
- build resilient microservice workflows with temporal
- durable execution
- inversion of execution
- orchestrate workflows with temporal
- paradigm shift for micro-service architectures with Temporal
- Temporal Activity
- Temporal adopters
- Temporal Application
- Temporal Client
- Temporal Cluster
- Temporal Event
- Temporal Namespace
- Temporal Run ID
- Temporal Signal
- Temporal Task Queue
- Temporal Task
- Temporal Testing
- Temporal Timer
- Temporal Worker
- Temporal Workflow
- why Temporal
- workflows vs services
Convention
By convention, temporal will capitalize the first letter of Workflow, Activity and Event History in order to distinguish Temporal-specific implementation and a general concept.
What is Temporal?
In short, Temporal is a platform that guarantees the durable execution of your application code. It allows you to develop as if failures don’t even exist. Your application will run reliably even if it encounters problems, such as network outages or server crashes, which would be catastrophic for a typical application. The Temporal platform handles these types of problems, allowing you to focus on the business logic, instead of writing application code to detect and recover from failures.
Architecture
- The Temporal server DOES NOT execute business logic code. It’s the workers.
- Each Worker will connect to the Temporal server in TCP.
- Temporal Clients can connect the the Temporal cluster in gRPC via the Frontend Service.
Transclude of 2024-07-22-temporal-architecture.excalidraw
Essential points
- Temporal guarantees the durable execution of your applications.
- Workflow are defined through code (using Temporal SDK).
- Temporal enhance developer productivity: As developers, we recognize that it’s critical to handle problems such as failures and timeouts that can affect application reliability and spend significant time writing code to do so. By providing higher-level abstractions for application development and built-in scalability, Temporal enables you to instead focus on your application’s business logic, therefore increasing developer productivity.
- Furthermore, Temporal provides tools that enhance your productivity, such as the Temporal Web UI you can use to view the execution history of your applications, both past and present, including their input parameters and return values.
- Temporal Clusters orchestrate code execution
- Temporal cluster maintains dynamically-created tasks queues.
- Workers continuously poll a task queue and accept Tasks if they have spare capacity.
- You can increase scalability by adding more Workers.
- You must restart Workers after deploying a code change.
- Namespaces are used for isolation within a cluster.
- Activities encapsulate unreliable or non-deterministic code.
- They are automatically retried upon failure.
- You can customize retry behavior through a retry policy.
- The Web UI is a powerful tool for gaining insight into your application.
- It displays current and recent Workflow Execution.
- The Web UI shows inputs, outputs and event history.
Samples
- GitHub - temporalio/samples-java: Temporal Java SDK samples
- GitHub - temporalio/samples-go: Temporal Go SDK samples
When to use Temporal?
If you want guarantee of completion in presence of different failures or compensation.