nats graffiti

NUI: A Free and open source UI for managing NATS

Introduction In the realm of distributed systems and microservices architectures, the NATS message bus stands out as a robust, high-performance solution. Its inherent simplicity combined with powerful features makes it a favorite among developers for building scalable and resilient applications. As a seasonend NATS user, i always rely on the rich-feature CLI tool for interacting with NATS servers, testing subscriptions, and also to explore and interact with streams and KV store buckets, but i always missed a GUI tool to streamline more complex operations and provide a visual representation of NATS resources…...

April 26, 2024
the flat rabbit

Flattening the rabbit hole

Sometimes, you just don’t want to see how deep the rabbit hole goes. One of those times is when you need to store a structured,nested object in a timeseries DB like InfluxDb. The need In my specific use case, a set of Protobf messages sent through a message bus have to be intercepted and logged in a timeseries for further analysis. To do that, the data structure must be flattened in some way before it can be stored successfully....

June 10, 2023
animal with backup

Go and Sqlite: backup and (maybe) restore

Sqlite database is widely used and battle tested and thanks to this package it can be integrated with the sql standard library in Go. In this post i’m going to explore how the online backup and restore features of Sqlite work and the steps needed to leverage them using Golang. Remember that the good old way of backing up copying the raw database file is a valid option if: you can prevent writes when file is being copied (e....

May 2, 2023
rabbits sharing a plant

Sharing socket between goroutines

2 - Request / response with channels

In Part 2 of the series, i’m going to use channels to manage a request / response on a raw, shared TCP socket. If we assume that the interaction between the service and the client is always a simple request / response on the socket (see Part 1 for the use case), then: The client send a request (command or polling for data). Then it wait for the response in the socket, reading from socket buffer until the message frame is completed....

March 25, 2023
rabbits sharing a plant

Sharing socket between goroutines

1 - Use case and naif solution

Sometimes, in low-level devices (like sensors, controllers, serial to ethernet converters, etc) the only way to interact with the hardware is via a custom protocol on top of a raw TCP socket. TCP is stream oriented so it is up to the procotol to define the way to frame the messages. In most cases 3 kind of pattern are used: Using the first byte or n bytes to specify message length, so the receiver knows when the message is complete....