Introduction to Darlean
Darlean is a tookit for developing backend applications with the simplicity of monoliths and the scalability of microservices.
A Darlean solution typically consists of a backend and a frontend. The backend uses Darlean, the frontend can use any technology you like.
The Darlean backend consists of at least one instance of one type of Darlean application. But the backend can also consist of multiple types of applications. Each application type can be deployed multiple times to provide redundancy.
There are two kinds of applications: core applications and user applications.
Core applications contain the core of Darlean. They provide shared functionality such as the actor lock, actor registry, persistence, tables, timers and web gateways. The core applications also provide the message bus that is used by all applications (both core and user) to communicate with each other. A cluster must at least contain one core application. When redundancy and/or zero-downtime are required, at least 3 instances must be provided.
The user applications are the project-specific applications where the domain logic is implemented. When you use TypeScript as your language, it is possible to combine core and user functionality in one application! Very useful for local development and cheap-ass cloud solutions. But even this simple deployment can be scaled up for full redundancy and 100% availability!
Actors
Remember? Darlean is a tookit for developing backend applications with the simplicity of monoliths and the scalability of microservices.
So how does Darlean achieve this?
Darlean applications consist of actors. There can be multiple types of actors. For each type that is implemented by a Darlean application, there can be zero, one or more instances active in memory.
Every actor has an Id. Id’s must be unique with a certain actor type. Id’s are array of strings. Examples are [], [‘12345’] and [‘some’, ‘actor’].
Actors are implemented as objects. They have a state, an optional activator, and optional deactivator, and one or more action methods.