frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Show HN: Go Command-streaming lib for distributed systems (3x faster than gRPC)

https://github.com/cmd-stream/cmd-stream-go
8•ymz_ncnk•11h ago
I created cmd-stream-go, a high-performance client-server library based on the Command Pattern, where Commands are first-class citizens.

Why build around Commands? As serializable objects, they can be sent over the network and persisted. They also provide a clean way to model distributed transactions through composition, and naturally support features like Undo and Redo. These qualities make them a great fit for implementing consistency patterns like Saga in distributed systems.

On the performance side, sending a Command involves minimal overhead — only its type and data need to be transmitted. In benchmarks focused on raw throughput (measured using 1, 2, 4, 8, and 16 clients in a simple request/response scenario), cmd-stream/MUS (cmd-stream/Protobuf) is about 3x (2.8x) faster than gRPC/Protobuf, where MUS is a serialization format optimized for low byte usage. This kind of speedup can make a real difference in high-throughput systems or when you're trying to squeeze more out of limited resources.

By putting Commands at the transport layer, cmd-stream-go avoids the extra complexity of layering Command logic on top of generic RPC or REST.

The trade-offs: it’s currently Go-only and maintained by a single developer.

If you’re curious to explore more, you can check out the cmd-stream-go repository (https://github.com/cmd-stream/cmd-stream-go), see performance benchmarks (https://github.com/ymz-ncnk/go-client-server-benchmarks), or read the series of posts on Command Pattern and how it can be applied over the network (https://medium.com/p/f9e53442c85d).

I’d love to hear your thoughts — especially where you think this model could shine, any production concerns, similar patterns or tools you’ve seen in practice.

Feel free to reach me as ymz-ncnk on the Gophers Slack or follow https://x.com/cmdstream_lib for project updates.

Comments

irq-1•7h ago
Looks nice. Does it have compression? Retries and latency are whatever TCP does, right? Have you thought about a go:generate format for the commands?
ymz_ncnk•5h ago
Thanks for the thoughtful questions.

Compression: cmd-stream-go doesn’t currently include built-in compression, but it’s a potential feature for future versions.

Retries & Latency: You're right, basic packet retries are handled by TCP. cmd-stream-go doesn't implement application-level retries directly, since those are typically left to business logic where factors like idempotency and error semantics come into play. Also, it uses the standard Go net.Conn without modifying TCP options like TCP_NODELAY.

go:generate for Commands: Good suggestion, this could be added in the future.

hecturchi•6h ago
Localhost benchmarks are pretty meaningless on code that is expected to deal with network latencies orders of magnitude larger.

It's ok that it runs faster, but much better if it's easier, safer, or more painless than the alternatives. The amount of code for a hello-world doesn't seem to indicate so, but maybe it pays off on more complex usecases.

ymz_ncnk•4h ago
Totally fair, the 3x is based on local throughput benchmarks focused on protocol overhead. It doesn’t reflect full network latency, but gives a baseline for serialization and transport cost.

I think for simple scenarios, the Command Pattern can indeed be an overhead. It’s more suited to systems where structure, composition, or replayability matter.

Show HN: Phind.design – Image editor & design tool powered by 4o / custom models

https://phind.design
34•rushingcreek•8h ago•12 comments

Show HN: Compass CNC – Open-source handheld CNC router

https://www.compassrouter.com
114•camchaney•3d ago•25 comments

Show HN: Any-LLM – Lightweight router to access any LLM Provider

https://github.com/mozilla-ai/any-llm
103•AMeckes•9h ago•58 comments

Show HN: The Magic of Code – book about the wonders and weirdness of computation

https://themagicofcode.com/sample/
92•arbesman•14h ago•26 comments

Show HN: A word of the day that doesn't suck

34•jsomers•15h ago•16 comments

Show HN: Lotas – Cursor for RStudio

https://www.lotas.ai/
77•jorgeoguerra•1d ago•28 comments

Show HN: Go Command-streaming lib for distributed systems (3x faster than gRPC)

https://github.com/cmd-stream/cmd-stream-go
8•ymz_ncnk•11h ago•4 comments

Show HN: My GPU Fan Saga – A DIY ATX Fan Controller

https://shafq.at/my-gpu-fan-saga.html
22•ashafq•13h ago•12 comments

Show HN: A rudimentary game engine to build four dimensional VR evironments

https://www.brainpaingames.com/Hypershack.html
35•teemur•3d ago•2 comments

Show HN: Pogocache – Fast caching software

https://github.com/tidwall/pogocache
87•tidwall•1d ago•29 comments

Show HN: My Side Project: A Free Mindful Breathing App

https://mentalhealthactivity.com/#pocketjoy
2•Negary•7h ago•0 comments

Show HN: Built an email marketing platform after paying $230/month

https://www.fertit.com
41•rasadov•1d ago•32 comments

Show HN: Bazaar – a new LLM benchmark for economic reasoning under uncertainty

https://github.com/lechmazur/bazaar
8•zone411•8h ago•1 comments

Show HN: Create your color palettes in context, not isolation

https://colorpal-sage.vercel.app/
2•mazahermuraj•9h ago•0 comments

Show HN: Checkmate, an infrastructure, uptime and web page monitoring tool

https://checkmate.so/
2•gorkemcetin•10h ago•1 comments

Show HN: Conductor, a Mac app that lets you run a bunch of Claude Codes at once

https://conductor.build/
223•Charlieholtz•5d ago•108 comments

Show HN: X11 desktop widget that shows location of your network peers on a map

https://github.com/h2337/connmap
203•h2337•2d ago•86 comments

Show HN: Giti – Natural Language to Git Commands with Local LLM

https://github.com/Sumit189/giti
5•sumit-paul•11h ago•0 comments

Show HN: SandCrab – An AWS S3 GUI for macOS

https://sandcrab.io
2•__zayne__•12h ago•2 comments

Show HN: SynSniff- Detect Minecraft Client OS via TCP/IP Fingerprinting

https://github.com/Duckulus/syn-sniff
2•duckulus•13h ago•0 comments

Show HN: Featurevisor v2.0 – declarative feature flags management with Git

https://featurevisor.com/?v2
4•fahad19•6h ago•0 comments

Show HN: ggc – A terminal-based Git CLI written in Go

https://github.com/bmf-san/ggc
64•bmf-san•6d ago•55 comments

Show HN: Inkverse - An Indie comics platform

https://inkverse.co
24•dannylmathews•1d ago•3 comments

Show HN: Dyad – build AI apps locally, no cloud

https://github.com/dyad-sh/dyad
4•moskogaige•15h ago•1 comments

Show HN: InkyCut – The open-source Canva alternative with a vibe editor

https://inkycut.com/
4•soasme•15h ago•0 comments

Show HN: MCP Jetpack – The easiest way to get started with MCP in Cursor

https://mcpjetpack.com
16•gsundeep•1d ago•10 comments

Show HN: Intercepting proxy for semantic search over visited pages

https://github.com/mlang/llm-embed-proxy
13•lynx97•1d ago•2 comments

Show HN: BrightShot – AI photo enhancement and virtual staging for real estate

https://bright-shot.com
2•pguiraoc•17h ago•4 comments

Show HN: Am-I-vibing, detect agentic coding environments

https://github.com/ascorbic/am-i-vibing
60•ascorbic•3d ago•31 comments

Show HN: McpX – A C# Library to Communicate with Mitsubishi PLCs via MC Protocol

https://github.com/YudaiKitamura/McpX
5•y-eng•1d ago•0 comments