Skip to content

Latest commit

History

80 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Monstera

TestsGo Reference

Monstera leaf

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.

Example

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.

Installing

Use go get to install the latest version of the library.

$ go get -u github.com/evrblk/monstera@latest

There 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@latest

CLI

Monstera comes with CLI toolkit:

$ go tool github.com/evrblk/monstera/cmd/monstera
  • Code generation:
    • monstera code generate Generates stubs, core interfaces and adapters from monstera.yaml file.
  • Working with cluster configs (offline: edit a config file on disk):
    • monstera config init Creates a new cluster config.
    • monstera config add-node Adds a node to the cluster config.
    • monstera config add-application Adds an application to the cluster config.
  • Operating a running cluster (online: over the admin plane):
    • monstera cluster bootstrap-node Provisions a single unprovisioned node with its id and the initial cluster config, transitioning it to READY.
    • monstera cluster bootstrap-nodes Provisions every node listed in a cluster config, dialing each at its advertised gRPC address.
    • monstera cluster add-node Adds a node to a running cluster (rolls the new config out to all nodes, then bootstraps the newcomer).
    • monstera cluster move-shard Moves a shard replica from one node to another (add new replica, bake until caught up, then remove the old one).
    • monstera cluster split-shard Splits an active shard into two children at a given key (seed children, flip, bake).
    • monstera cluster get-config Downloads the cluster config a node is currently running and prints it (or writes it to a file).

Status

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.

License

Monstera is released under MIT License.

About

Framework for building scalable distributed stateful applications

Topics

Resources

Stars

56 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages