Monstera is a framework for writing stateful applications in pure Go with all data in memory or on disk without worrying about scalability and availability. Monstera takes care of replication, sharding, snapshotting, and rebalancing.
Monstera is a half-technical and half-mental framework. The tech part of it has a pretty small surface. It leaves a lot up to you to implement. But sticking to the framework principles will ensure:
- Applications are insanely fast and efficient
- Cluster is horizontally scalable
- Business logic is easily testable
- Local development is enjoyable
Data and compute are brought together into a single process. You are free to use any in-memory data structure or embedded database. By eliminating network calls and limited query languages for communication with external databases, you are able to solve problems which are known to be hard in distributed systems with just a few lines of your favorite programming language as you would do it on a whiteboard.
Go to documentation to learn more.
It might be easier to understand how it works from examples rather than from the documentation.
- evrblk/grackle is a complete production-ready application built with Monstera.
Use go get to install the latest version of the library.
$ go get -u github.com/evrblk/monstera@latestThere are also few CLI tools (such as codegen), so it also should be added as a tool:
$ go get -tool github.com/evrblk/monstera/cmd/monstera@latestMonstera comes with CLI toolkit:
$ go tool github.com/evrblk/monstera/cmd/monstera- Code generation:
monstera code generateGenerates stubs, core interfaces and adapters frommonstera.yamlfile.
- Working with cluster configs (offline: edit a config file on disk):
monstera config initCreates a new cluster config.monstera config add-nodeAdds a node to the cluster config.monstera config add-applicationAdds an application to the cluster config.
- Operating a running cluster (online: over the admin plane):
monstera cluster bootstrap-nodeProvisions a single unprovisioned node with its id and the initial cluster config, transitioning it to READY.monstera cluster bootstrap-nodesProvisions every node listed in a cluster config, dialing each at its advertised gRPC address.monstera cluster add-nodeAdds a node to a running cluster (rolls the new config out to all nodes, then bootstraps the newcomer).monstera cluster move-shardMoves a shard replica from one node to another (add new replica, bake until caught up, then remove the old one).monstera cluster split-shardSplits an active shard into two children at a given key (seed children, flip, bake).monstera cluster get-configDownloads the cluster config a node is currently running and prints it (or writes it to a file).
Monstera is being actively developed. There will be no version tagging before v0.1, just development in master
branch. After it is tagged v0.1 it will be more or less stable and follow semver.
Monstera is released under MIT License.
