I've written what monoblok does several times over in Go and Python over the years, probably badly. It would have been nice to clean up my @nats_io firehose subjects with a few rules.
github.com/lexvicacom/monobl…
monoblok accepts publishes from existing NATS clients and exposes useful subjects, saving you from having to write and deploy the same cleanup/republish services.
I've long been interested in the LMAX architecture. It still receives a lot of attention due to this Fowler article back from 2011: martinfowler.com/articles/lm…
It is one of those pieces that continually gets rediscovered and posted about even 15/16 years later. It refuses to die and is possibly famous as the article is so well written. The approach was quite provocative at the time. It has aged well in parts and badly in others.
Just because it worked once in an environment with a specific set of constraints does not make it a general purpose silver bullet Just embrace the Good Ideas. But what are the good ideas? This requires a bit of thought.
monoblok can now consume (and catch up) from @nats_io JetStream streams. It observes a virtual clock so stream date is used. May add event time from JSON payload and/or application header. Hooks in to existing export machinery so replay emissions can be optionally exported back.
tinyblok can now be flashed from Chrome flash.monoblok.host/
In setup mode just join the TINYBLOK wifi network. A captive page pops up, allowing you to select your wi-fi network and target NATS environment.
#iot#nats#esp32
Writing a monoblok patchbay by hand is already simple.
Describing it to an LLM is faster: give it the shape you want your data in and get back a setup (with test publisher) that publishes clean/actionable values to your @nats_io cluster.
github.com/lexvicacom/monobl…
Tinyblok on ESP32 dev board can now respond to @nats_io req/reply. Useful for pings, queries and hardware actuation. Also great for querying device fleets: if n boards all subscribe to the same subject, the request is a broadcast and n boards (should) reply.
monoblok is a tiny pubsub broker with a conditioning streaming DSL. it cleans and shapes local streams and then exports the results directly to a NATS cluster, or through a NATS leaf. Conditioning at the edge, analysis in the cloud. alexjreid.dev/posts/monoblok…
Subject sampling = server-side downsampling.
Sensor pushing data every second? Schedule a snapshot of the *latest* value every 5 minutes and source it into another stream.
Less data on the wire to your cloud, no client-side aggregation logic.
github.com/nats-io/nats-arch…
Got the signal conditioning DSL from monoblok to run on an ESP32 development board (dog shown for scale) talking to @nats_io over WiFi to my laptop. The board runs the same patchbay DSL to squelch, quantize and avg data transmitted to NATS. 🤓
alexjreid.dev/posts/tinyblok…