Skip to main content

Day one for Andromeda, all of NGSI-LD v1.9.1 in one Rust broker

· 5 min read
Matej Škvarč
Matej Škvarč
Andromeda Maintainer

I have been looking forward to writing this for a long time. Andromeda v1.0 is out today, and you can download it, run it and build on it right now. Andromeda is an open-source context broker for NGSI-LD, written in Rust. If you have never met a context broker, think of it as the memory of a smart city, a farm or a factory. Sensors, services and people tell it what they know, and everyone else can ask it questions or ask to hear when something changes. NGSI-LD is the European standard for how that conversation goes, and Andromeda implements all of it, the whole v1.9.1 API (ETSI GS CIM 009), every resource and every method.

What you get​

The whole of v1.9.1 is there, from batch operations and geoqueries to distributed operations through context source registrations, Snapshots and EntityMaps. Notifications go out over HTTP and MQTT, with durable delivery and retries.

Temporal history is written atomically, in the same transaction as each change, and lives in the same PostgreSQL database, so the current state and its history always agree, and there is no separate history service to run. Numbers stay exact decimals, and timestamps keep their microseconds.

Each tenant gets a PostgreSQL database of its own. Andromeda speaks HTTP/1.1, HTTP/2 and HTTP/3, serves Prometheus metrics and health probes on a separate management port, maintains and repacks its own tables online, and works behind PgBouncer when you have many tenants.

What it needs​

Andromeda is one program talking to one PostgreSQL database, with PostGIS for places and TimescaleDB for history, and that is all you have to keep running. Two container images ship with the release, the broker itself and a PostgreSQL server with both extensions already installed. The Docker page lists their tags.

Strict, and it tells you why​

Andromeda checks every request against the semantics of NGSI-LD, not only its syntax. When something does not fit, it says no, and the answer names the field and the rule it broke.

If your client grew up with a more forgiving broker, you may see a few 400 answers at first. Each one points at what to change, and it is far nicer to find that on day one, while you are still looking, than months later in production. The strictness pages go through each case.

Decisions written down​

A broker makes many small decisions, and most of them only matter on the day something looks wrong. I have tried to write every one of them down in the documentation, so on that day you can look it up instead of guessing or reading the source.

Open for everyone​

Andromeda is built in Slovenia and released under the European Union Public Licence v. 1.2 (EUPL-1.2). Use it, read it, change it, and if you improve it, I would love to see how.

Speed​

I built Andromeda to be fast, and I believe it is. Requests are decoded straight into typed values, the database schema is shaped around the way NGSI-LD reads and writes, and every query runs against indexes built for it. In testing so far it performs very well.

Published figures will come with a benchmark suite that anyone can run and check, covering many workloads at many sizes. Until then, the best test is your own data at the volume you expect. If something is slow, tell me with the request and the size of the data. A slow case is treated as a bug, and the benchmarks page explains how to measure one.

Try it​

The quickest way in is Docker, where one Compose file brings up the broker and its database. If you prefer to build it yourself, build from source walks you through it. Either way, the quickstart then takes you from your first entity to your first notification.

When you are ready to run it for real, the deployment planner asks a few questions about your deployment and writes andromeda.toml, a Compose file, the proxy and PostgreSQL settings, and the steps to run them. It checks a configuration you already have, too, without anything leaving your browser.

Would you rather get to know the ideas first? Start with the introduction, then wander into the guides.

Thank you​

To everyone who read an early draft, filed an issue, or asked a question that made me explain something better, thank you. Projects like this grow in small conversations as much as in code.

If Andromeda helps you, or if it gets in your way, I would like to hear about it. Open an issue, start a discussion, or just say hello. Today is day one, and there is a lot I want to build with you.