https://github.com/raskyld/grinta
A minimalist network fabric for your goroutines 🔗 ✨
https://github.com/raskyld/grinta
concurrency distributed-systems fabric framework go golang goroutine network networking protobuf
Last synced: about 1 month ago
JSON representation
A minimalist network fabric for your goroutines 🔗 ✨
- Host: GitHub
- URL: https://github.com/raskyld/grinta
- Owner: raskyld
- License: apache-2.0
- Created: 2024-12-21T12:29:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-18T12:39:52.000Z (about 1 year ago)
- Last Synced: 2025-06-13T20:46:10.069Z (10 months ago)
- Topics: concurrency, distributed-systems, fabric, framework, go, golang, goroutine, network, networking, protobuf
- Language: Go
- Homepage:
- Size: 396 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
grinta
A minimalist network fabric for your goroutines
:link: :sparkles:
> **N.B.** This is a *Proof Of Concept* library I built as a side-project
> over the last month to fulfill the needs I have for another project, it is
> **NOT production ready**. :pray:
* *Goroutines* hold an *Endpoint* :round_pushpin: on which they can listen
for inbound *Flow* :ocean: establishment requests
* *Flows* :ocean: are bidirectional communication chanel between
a *client* and an *Endpoint* :round_pushpin:
* *Fabrics* :link: are meshes of Golang processes — potentially
distributed over multiple machines — capable of establishing
*flow* :ocean:
## Demo
This video shows the [`examples/hello-world`](examples/hello-world/) example.
First, both goroutines are on the same node and can communicate using a
*Flow* :ocean: anyway, behind the scene `grinta` use native Go `chan`.
Then, we run **the same binary** but this time, we put each goroutine in a
different process. From a code point of view, nothing change for the goroutines,
they still use a *Flow* :ocean: but this time, `grinta` uses a QUIC inter-node
multiplexed stream fabric.
[hello world example](https://github.com/user-attachments/assets/24064e25-3eda-4153-adfc-de16f57423cb)
## Features
* :relieved: **Simple API**: `Fabric` -> `Endpoint` -> `Flow` describes an intuitive
hierarchy and their APIs are kept minimal.
* :writing_hand: **Built-in Codec**: We already support:
* Protobuf,
* JSON,
* Raw Bytes,
* :pinching_hand: **Golang Focused**: By focusing on a single language, we remove a lot of
complexity and can optimise for just our specific use-case.
* :family: **No Central Authority**: A `grinta` cluster has no central authority, no
strongly consistent consensus protocol, nodes collaborate together to
converge as fast as possible.
* :sunglasses: **GRINTA Protocol**: A custom protocol made on top of:
* a first *QUIC Transport Layer* supporting multiplexed inter-node
bidirectional **streams** and lightweight **datagrams**,
* an implementation of the ["SWIM"][swim] gossip protocol:
[`hashicorp/memberlist`][dep-mbl],
* an adapter to run `memberlist` clusters on top of our
*QUIC Transport Layer*,
* a set of versioned [Protobuf Messages](./proto/grinta) which describes
our control plane communication format,
* an event and query bus to propagate *Endpoint* :round_pushpin: information:
[`hashicorp/serf`][dep-serf];
[swim]: (http://ieeexplore.ieee.org/document/1028914/)
[dep-mbl]: https://pkg.go.dev/github.com/hashicorp/memberlist
[dep-serf]: https://pkg.go.dev/github.com/hashicorp/serf