The entity store
Weik.io 2026.2Keep the records an integration has processed in the entity store, and react only to the ones that changed. Product page · Video
Watch: Polling and change detection, 3:47
The video polls a system that reports no changes and uses the entity store to pass on only the new and changed records.
This part of the video couldn't be loaded.
Use the entity store when a system can’t say what changed since yesterday. Without change timestamps, an integration has to poll the whole list of customers or products and work out which records are new or different. With the entity store, the integration writes each record it gets. The store skips a write that changes nothing and turns every other write into a change event that other routes react to.
Declare a record type#
Before an integration writes records of a type, declare the type in its project. The declaration creates the type’s store in the environment and sets its size limit and the number of revisions to keep:
$ weikio entitystore policy set finance/invoice --env production --max-bytes 512MiB --history 2 -yTarget: https://hub.example, project finance (argument), environment production (--env)
entity-store-policy production/finance/invoice created (maxBytes 512 MiB, history 2, revision 57)
production entity store budget: 512 MiB of 2 GiB allocatedA platform administrator sets an entity store budget on each environment. A declaration that would go over the budget fails, so a write never fails because of the budget.
You can also declare a type with the form on the admin UI’s Entity store page, or in Git as an entity-store-policy document. A route that writes into a type its project hasn’t declared doesn’t start. To declare the type, run the command in the route’s error message.
Write records#
The entitystore-sink kamelet writes a record of a type under an ID the route gives it:
- route:
from:
uri: timer:poll?period=300000
steps:
- to: "{{erp-url}}/api/products"
- split:
jsonpath: "$.items[*]"
steps:
- setHeader: { name: entityId, simple: "${jsonpath($.sku)}" }
- to: "kamelet:entitystore-sink?entityType=product"The ID comes from the entityId header unless you set entityIdExpression. The kamelet gets the project from the deployment it runs in, so the route needs none and works in every project.
React to changes#
The entitystore-source kamelet starts a route from the changes of a type:
- route:
from:
uri: "kamelet:entitystore-source?entityType=product&operations=created,updated"
steps:
- to: "{{shop-url}}/api/products"operations is created,updated,deleted by default. The copies of a deployment share the changes, so a deployment on two agents handles each change once.
Each environment keeps the entity store’s writes and changes apart from its channels’ events, so a large import can’t push a channel’s backlog out.
Read the records back#
$ weikio entities list finance/invoice --env production --id-prefix 2026-
$ weikio entities get finance/invoice INV-1001 --env production --revisions
$ weikio get entity-store-policies --env production| Command | What it shows |
|---|---|
entities list |
The IDs in order with their update time and size, a page at a time |
entities get -- |
A record with the revisions the store still keeps, newest first |
get entity- |
Each type with its limits, how many records it has and how much of the budget it uses |
In the admin UI, the Entity store page shows each type’s records and its Changes over the time you pick.
Who can reach it#
An integration can read only the records of its own project.
Queries go through the Weik.io API and need the same roles as everything else.