So, I’ll elaborate some more, I’m on my phone, so will not be too detailed.
I’m referring to a C# implementation, probably an adaptor which implements the ServiceFabric interfaces. An existing, tightly coupled solution would need to do a few changes more than just config, but nothing advanced.
Any creators of a framework will not be thinking much about giving examples where the code is tightly coupled to the framework. And this is true also for ServiceFabric, if you look around on the net.
But I have separated the domain logic from the framework (almost done with the entire system), which means I can choose any host to run the system, be it a console app and inmemory storage, or a ServiceFabric cluster or any other kind of container or host.
So our ServiceFabric code is referencing the domain logic, passing in the SF statemanagers wrapped in adaptors. The domain logic does not know it is an IReliableDictionary from SF, or something using SAFENetwork…
So this refactor, it actually opens up for passing in a SAFENetwork implementation.
And that’s the part I’ll figure out.
Now, it isn’t trivial to get the full fledged functionality of SF reliable state. But I’ll make a trivial first version, and then we’ll see how far I can take it.
What makes it non-trivial is the transactions that ServiceFabric uses. It let’s you mutate state in one and even multiple reliable collections within a single transaction. And to replicate this in SAFENetwork… Well, let’s say I’ve had to think a bit about the various access patterns that opens up with a global storage solution, and since storing state means a handful of commits, there are some special patterns of compensatory actions and processes that needs to go in to it, to get something that looks like a transaction, and it’s very exciting but I do not know if or how it will be solved in a way that is sufficiently reliable.
So, one teaser is that ServiceFabric uses logs for building up these transactions, and well, logs, streams… and that’s where I saw the EventStore come to use,also the aggregate abstractions as they are meant to solve collaborative work over same state, which I would say distributed state management is. But I am so far from the advanced low level performamce coding so that’s why I hinted at that, in reality, we’ll have to see just how performant that can be.
This could probably work fine for some businesses, but it cannot be the backbone of a cloud infrastructure. Just to put it in perspective.