Bulletproof Workflows with Temporal | Microservices orchestration the easy way

preview_player
Показать описание
What if we could build bulletproof workflows just by defining a simple function in our favorite programming language? Wouldn’t that be great? Well that's exactly what Temporal has to offer.

# Intro
We have discussed many times how difficult is to coordinate complex flows in a distributed system such as a microservices architecture or a highly available monolith.

Temporal solves the issue in the most elegant way possible. We can simply define a function in our favorite language. Java, Go, Python, PHP, Typescript, .NET and many more are supported and interoperable.

# Why Temporal?
The two main selling points of Temporal are:
1. It promises us to code smarter and faster. We can pick our favorite language between Java, Go, Python, TypeScript, PHP (and many more are on the way) and define the business logic in workflow and activity functions. There is virtually no learning curve because we use the native constructs of the programming language, rather than a complicated framework.

2. The Temporal runtime makes all the heavy lifting involved in executing the workflows. It receives workflow execution requests, schedules them, persist their state and communicates with all the relevant worker services.

Top that with a wonderful administrative panel that gives you full visibility on workflows and their state, as well as management functions such as the ability to terminate a workflow.

# Workflows Activities Signals and Timers
The core concepts of Temporal are Workflows and Activities.

The Workflow represents the business process we want to model. We could have a workflow to model orders in an online shop.

The Activities represents the logical steps we need to perform in the Workflow. Such as reserving a product from the inventory or booking logistics.

Another two important features of Temporal are signals and timers. A signal is a message sent to the workflow which can be used to change its state and control its execution flow.

Timers are self-explanatory. Rather than waiting for a condition we wait for an amount of time. It could be 1 second, 1 hour, 1 day or even 1 year.

---------------------------

📅 *Let's have a 1:1 Call to discuss anything you wish* 📅

🤓 There's more on my website! (articles, scripts, code snippets, etc...): 🤓

🤝 Connect with me: 🤝

👌Get a CodeCrafter Discount 👌

#microservices #saga #temporal
#java #designpatterns #softwaredevelopment

0:00 Introduction
0:14 What is Temporal?
2:11 Workflows and Activities
4:15 How Temporal Works
6:08 Signals and Timers
Рекомендации по теме
Комментарии
Автор

I love the idea of using native programming language constructs to define a business workflow. What are you going to use Temporal for?

MarcoLenzo
Автор

Hi, great video!! Couple small things:
4:05 - you can add that workflow executions in Temporal are not tied to a specific worker. If one of your worker processes crashes, your executions can be continued on a different worker. In this situation new new worker would replay your workflow code against the executions event history and discrepancies in commands generated would result on non-deterministic errors. In most cases users can still fix the issues and allow workflow execution to continue and complete.
5:36 "When this is done Temporal is going to schedule a replay of the workflow" - this is not really correct, workers have an in-memory cache of executions that it is processing. When activity worker responds back to service saying it has completed the activity, service would try to send this update to the workflow worker that has so far been processing the execution (sticky task queue). This is an optimization so that your workflow code does not have to be replayed on any update. If the workflow execution on this worker gets evicted from this worker cache before the new update (activity completion) comes in, then worker would need to fetch the event history from service and replay your workflow code against this event history to be able to continue execution. So in most cases updates to execution that are delivered to workers do not cause this internal worker replay.
Looking forward to more of your videos on Temporal!

tsurdilovic
Автор

Please create a full blown tutorial with complext payment flows or data pipelines :)

uri
Автор

Best getting started with Temporal. Thanks

giantboanerges
Автор

Great video! Very well broken down and explained. Thank you!

GavSaysPogMoThoin
Автор

Interesting video however I do have a question. For companies who are heavily invested in a certain platform (eg. AWS), what are the advantages of using 'external' frameworks like Temporal over a more native solution like AWS? The same can be said for other functionality like queuing (SNS/SQS/EventBridge vs Kafka/RabbitMQ or DynamoDB vs a hosted version of MongoDB). I'm not sure whether this is a good topic for another video but it would be great to hear your thoughts about this topic :)

MrNikMic
Автор

Great video! One confusion I have is your description of the videos says it supports dotnet whereas Temporal documentation doesn’t say the same. Would you please clarify?

sushilb