This is an open sourced database functionality on top of the SAFE Network.
The code base is a library that can be referenced in a .NET project.
The functionality is currently absolutely basic and simplistic, just to get started.
I have been developing event sourced applications in my job, and this is an implementation using SAFE Network as backing storage.
The goal is that .NET developers interested in EventSourcing could be introduced to SAFE Network via this.
Since I myself have been very excited about the network capabilities and what it means in an event sourcing context, I figured many others would be too.
The project includes:
- .NET wrapper over SAFE FFI (alpha-2). (Almost done, needing some fix to run with alpha-2)
- EventStore library using the wrapper. (First version done)
- EventStore db management UI. (cross platform web app) (Simple test version done)
The current mock version can be used to:
- List available databases
- List stream categories in each database
- List stream keys (i.e. stream instances) in each category
I am currently waiting for some support on some ffi-related things needed for the .NET wrapper, to be able to continue testing and refine the actual implementation using alpa-2 network.
I am additionally opening up for people who would like to collaborate on designing a SAFE Website (with react+redux for example) to use as the DB management UI, instead of the current one that I made from template (served by the localhost server).
This will give a more cohesive and natural experience as a user can access and view their databases from any SAFE Browser, which then accesses the database service (cross platform) running locally.
Write here or send me a PM if you are interested in participating.
How to use it
A developer that decides to use event sourcing as a database solution - for parts of, or entire applications - can reference the SAFE.EventStore library in their .NET project, and have a complete framework for storing and retrieving data as events in streams.
To have a graphical UI for the DB management, they can access this from the localhost webapp.
Event sourcing is a different database structure than for example relational, document or graph databases.
All databases come with their benefits and downsides, and event sourcing is for example well suited for IOT applications, or financial applications. But the uses are of course uncountable.
A common practice to use together with event sourcing is something called CQRS, which stands for Command and Query Responsibility Segregation (minted by Greg Young, based on the older CQS)
This is because event stores are not well suited for querying data, and for that reason read models (projections) are created from the event streams, hence the CQRS, as commands will lead to events being written into streams, while queries are performed on the projections.
For this reasons I have also created a SAFE.CQRS library (also with DDD concepts included), which can be used by those who do not wish to create their own boiler plate code.
(Greg Young often states though, that a framework for this is not needed. Every application has its own needs. But the opinions are divided in this matter! )
As the .NET wrapper is completed so that it can be used to connect to alpha-2 network, the event sourcing protocol will be tested and refined, as to improve performance and stream line the handling.
As this is done, the code will be published to GitHub for developers to clone.
After that, some additional information will be posted to google groups of EvenStore, CQRS and DDD enthusiasts, as to introduce them to SAFE Network.
Code for building projections, routing cmds, setting up process managers/sagas (CQRS specific state machines) is part of the SAFE.CQRS library and will be added too, for those who do not whish to write their own versions.
The event sourcing protocol will be used by me when I write other event sourced apps for the network, so it will be continuously updated and refined.
I hope this project will bring some more attention to SAFE Network from developers, and add to the Apps being developed for the community !
I figured I’d just as well put the mock demo out there so here’s the repo: GitHub - oetyng/SAFE.EventStore: EventSourcing database on SAFE Network
Note: The basics of the actual EventStore implementation is there too, but I have not been able to test it on the network, and it is very likely, that something is off with regards to the MD operations etc.
This is my first try of coding something for the network.