kernablekernable

For teams in several languages · TypeScript · Python · Rust

One backend. Every team in its own language.

Your data team writes Python, your product team TypeScript, your platform team Rust. kernable gives them one model and the same guarantees, whatever they write.

[ Why kernable ]

The language is a choice, not a wall.

The rules that must hold for everyone live in the kernel, not in a library per language. So every team gets them, and none has to rebuild them:

  1. 01One language imposed on every team→
    Each team in the language it knows

    Python for data, TypeScript for the product, Rust where it counts, in one application.

  2. 02Every language its own retries and edge cases→
    The same guarantees everywhere

    Ordering, read-after-write and signatures are the kernel's job, not each SDK's.

  3. 03Services that drift apart over time→
    One model for all

    Commands, events and queries mean the same in every language.

  4. 04Integration through ad-hoc APIs and queues→
    Every service gets every change

    In order, from one log, to every service allowed to see it.

  5. 05Rewriting to join the platform→
    Any language can join

    TypeScript, Python and Rust have SDKs; any other speaks the open gRPC protocol.

[ How it works ]

Mix languages inside one application.

Each part of your application is its own process, in its own language. The kernel holds them together.

WorkerPython

The data team's pricing rules: decides commands and emits events.

Read modelTypeScript

The product team's views: builds tables from events and answers queries.

ReactorRust

The platform team's integrations: acts on events and calls other systems.

Middlewareany language

Your access rules, checked on every request, whoever wrote the rest.

[ Code ]

One cart, two languages.

The cart's rules in Python, its read model in TypeScript, from the tested example in the docs. What the Python worker decides, the TypeScript read model shows right away.

from kernable import Kernable, Rejected, domain

shop_domain = domain("shop")
cart_aggregate = shop_domain.aggregate("cart", {"items": 0, "checked_out": False})


@cart_aggregate.apply("ItemAdded")
def _(state, data):
    state["items"] += data["qty"]


@cart_aggregate.apply("CheckedOut")
def _(state, data):
    state["checked_out"] = True


@cart_aggregate.command("AddItem")
def _(state, data):
    if state["checked_out"]:
        raise Rejected("Cart is checked out")
    return [{"type": "ItemAdded", "data": data}]


@cart_aggregate.command("CheckOut")
def _(state, data, cmd, ctx):
    if state["items"] == 0:
        raise Rejected("Cart is empty")
    # ctx.now() and ctx.id() stay the same if the command runs again.
    return [{"type": "CheckedOut", "data": {"at": ctx.now().isoformat(), "orderId": ctx.id()}}]


k = Kernable(key="app.key")
k.worker(cart_aggregate).run()

From Getting started: every example there runs against a real kernel in CI.

[ Consulting ]

Bring your teams onto one model.

We help you draw the domain boundaries between your teams, agree on the commands and events between them, and build the first part on kernable, in each team's language.

Artur Susdorf
Artur Susdorf Author of kernable

Twenty years of shipping software, the last seven designing the architecture other engineers build on. Author of comby, the event sourcing and CQRS framework that carries multiple commercial platforms in regulated markets. kernable brings the same model to teams that work in any language.

LinkedIn →

[ Early access ]

Build on kernable before 1.0.

kernable is in private preview. Tell us what you're building, and we'll send you the binaries and the docs.