Circuits is an orchestration tool in Catalyst that helps you compose and orchestrate multiple serverless functions to create a workflow for your business-critical applications.
Through a visual interface, Circuits will help you compose business logic using your serverless functions in the form of state diagrams/flowcharts and help you orchestrate business critical tasks with retries, time-outs and advanced error handling.
How does it work?
With Circuits, you can chain and compose business logic with Catalyst Basic IO functions. The output of one function becomes the input of another, and so on. You can create conditional branching, batch processes, parallel processing and much more to create a detailed workflow of your business logic.
Error handling is core to building resilient business workflow, with Circuits, you can bake in strong fallback and retry mechanisms with operations like wait, delay, step delay etc. Circuits also gives you powerful logging services that will help you debug and log state changes that'll help understand your system in case things go wrong.
Example
Circuits can be used for a variety of use cases. You can leverage the power of circuits in your core business logic where resiliency is key. Here's an example:
Let's assume a classic case of ETL (Extract, Transform and Load): We'd like to get sales and marketing data from two different places, mash them up and save that as a file so that we can later run AutoML prediction on the data we've prepared.
The right approach to this problem is a microservice architecture, where each step in the process is written as a separate function, so that they can be separately retried and can even be used elsewhere. It is also important to orchestrate these functions to solve the current business problem. Let's see how we can achieve this using Circuits:
As you can see, we've created a neat flow diagram with Catalyst functions. Looking at the diagram, the business process becomes self-explanatory. Each step in the circuit diagram is a function which performs an operation. Also, each function's output becomes the succeeding function's input. The code view gives us more details on the nuances like number of retries, stop delay etc for each of these steps/states.
You can try out Circuits in your Catalyst projects. We've also written a neat tutorial for you, check it out, here!
We'd love to help you ship your next application on Catalyst with the Circuits component. Write to support@zohocatalyst.com in case you're facing challenges in your serverless projects.