Process overview

Specify service interface and domain model

The main components of a Kalix service are:

We recommend that you separate the service API and Entity domain data model. Separating the service interface and data model in different classes allows you to evolve them independently.

Kickstart a project using the Getting started guide.

Understanding what an Effect is

Each component defines a set of operations through its application programming interface (API). These operations are specific to the semantics of each component. For the JVM SDKs, these APIs take the shape of an Effect.

An Effect is a description of what Kalix needs to do after an incoming command is handled. You can think of it as a set of instructions you are passing to Kalix. Kalix will process the instructions on your behalf.

The component Effect APIs play a central role when implementing a component as it provides the glue between your application logic and Kalix. For a more high-level overview of Kalix Architecture Style, check out the Programming model page.

The details of each component Effect type are explained in the component’s specific pages.

Implement components

Stateful services can implement Value Entity or Event Sourced Entity and View components. Stateless services implement Actions. Typically, a stateful service should only have one Entity type, but can also include Actions and Views.

Actions

Actions are stateless functions that can be triggered by HTTP calls. They can also subscribe to published events, and they can send commands to other services based on the events they receive. For more information about writing actions see Implementing Actions.

Entities

Stateful services encapsulate business logic in Value Entities or Event Sourced Entities. At runtime, command messages invoke operations on Entities. A command may only act on one Entity at a time.

To learn more about Kalix entities see Implementing Value Entities and Implementing Event Sourced Entities.

If you would like to update multiple Entities from a single command, you can use forwarding and side effects.

For more information see Actions as Controllers and Running Side Effects.

Services can interact asynchronously with other services and with external systems. Event Sourced Entities emit events to a journal, to which other services can subscribe. By configuring your own publish/subscribe (pub/sub) mechanism, any service can publish their own events and subscribe to events published by other services or external systems.

Workflows

Kalix Workflows are high-level descriptions to easily align business requirements with their implementation in code. Orchestration across multiple services with support for failure scenarios and compensating actions is simple with Kalix Workflows.

Views

A View provides a way to retrieve state from multiple Entities based on a query. You can create views from Value Entity state, Event Sourced Entity events, and by subscribing to topics. For more information about writing views see Implementing Views.

For more details and examples take a look at the following topics:

Testing your application

It is good practice to write unit tests and integration tests as you implement your services.

Kalix Java SDK provides a test kit dependency that you can use to write unit tests for Actions and Entities as well as integration tests. Please consult the component specific pages to learn more about writing unit tests and integration tests for your application.

Package service

Use Docker to package your service and any of its dependencies. See Configuring registries for more information.

Run locally

You can test and debug your services by running them locally before deploying to Kalix.

Deploy to Kalix

After testing locally, deploy your service to Kalix using the CLI or the Console. The following pages provide information about deployment: