Anton Mishchuk’s Kraken: A Comprehensive Framework for Flow-based Service Orchestration (June 2023)

The content is about Kraken, a framework for orchestrating software systems. Kraken combines the ideas of two other projects, ALF and Octopus, and focuses on the philosophical aspect of the idea. More details can be found in the corresponding GitHub repos: ALF, Octopus, and Kraken. Additionally, there is a video from the Berlin Elixir Meetup available.

Kraken adopts a flow-based programming approach to organize interactions between different parts of the system, referred to as services. Each interaction with the system is represented as an “input event,” which contains all the necessary information. These events pass through a predefined chain of components called a “pipeline.” The components call underlying services and modify the event, with the final event representing the result of the interaction.

To define pipelines and services, Kraken provides a simple declarative JSON DSL. The interaction with the Kraken-based agent, also known as the orchestrator or control panel, is done through a JSON API.

In terms of the system architecture, Kraken can be compared to Kubernetes. While Kubernetes focuses on the infrastructure layer, Kraken serves as an orchestrator for the application layer of the system. Kraken relies on the ALF framework for its pipeline building blocks, and the JSON DSL definitions are compiled into ALF pipeline modules. For communication with external services, Kraken uses the Octopus library, which follows a “prepare-call-transform” approach.

The article then provides an example of an online shop system and different use cases or flows that are represented as pipelines in Kraken. Each use case requires defining services, events, and pipelines that describe the interaction and its outcome.

Deployment of Kraken involves using its HTTP JSON API for defining, starting, and calling services and pipelines. The orchestrator application, an Elixir app with Kraken as the main dependency, needs access to all other services in the system and must be exposed for external communication via HTTP.

The article also discusses flow-based programming and its benefits, such as explicit definition of flow topology and observability of logic. Kraken leverages Elixir GenServers for parallel processing of components and allows for horizontal parallelism with multiple component copies. Telemetry is used for monitoring event transformation in ALF. The JSON-based DSL offered by Kraken simplifies modeling the application layer, and services can be seen as specifications for underlying domain services.

The advantage of dynamically uploading code is highlighted, similar to the Kubernetes approach for infrastructure creation. This approach allows for dynamically adding new services and pipelines and facilitates prototyping on existing systems. The article suggests the possibility of implementing an IDE-like client for a low-code orchestration layer platform.

Source link

Leave a Reply