Releases: psibr/REstate
9.3.0 - Improved Natural State Machines with EF Core
This release focuses on querying the current state of a state machine, specifically using a SQL implementation. Previously users would have to illicit information from the state JSON which was computationally expensive at scale. Users can now use the new index to query the current state much more effectively.
Natural State Machines
In order to effectively get state a new computed column has been added and indexed in order to quickly find the state of a given machine.
Unlisting 9.2
Unfortunately the updates that originally put these changes in place in version 9.2 did not address the root cause of the performance problems. The version 9.2 is therefore being unlisted and user using 9.2 would need to run the following script to change the dB in place
DROP INDEX [IX_Machines_SchematicName_NaturalStateName_UpdatedTime] ON [dbo].[Machines]
GO
Update [dbo].[Machines] set [NaturalStateName]= null
CREATE NONCLUSTERED INDEX [IX_Machines_SchematicName_NaturalStateName_UpdatedTime] ON [dbo].[Machines]
(
[SchematicName] ASC,
[UpdatedTime] ASC,
[NaturalStateName] ASC
)
INCLUDE ([MachineId])
GO
9.1.0 - Less I/O!
This release focuses on Request-Response path applications as opposed to long-lived contexts as has previously been the focus. In the case of both new optimizations being adopted, users can see a reduction in 2/3rds of the read operations.
GetMachineReference(string machineId)
In request life-cycles a machine must be retrieved before a signal or input/payload can be sent, which requires I/O to ensure the machine exists. This has been mitigated with a new method on IStateEngine that does not require any I/O and is synchronous: GetMachineReference
.
This also opens the door to more usage patterns where a machine reference would have been desired to store, but the I/O requirement meant designs had to instead hold a lower component and lazy initialize.
IOptimisticallyConcurrentStateRepository<TState, TInput>
REstate is designed to minimize the possibility of stale writes for State as it's primary responsibility. The issue arises that each data-store handles concurrency differently, some with optimistic some pessimistic, and many have stale read semantics with eventual consistency. In the case of stale reads, this highly increases the chance of hitting a concurrency exception and needing to go through retry cycles. These differences has meant REstate has had to handle the worst case of each possible implementation previously. This is now being addressed with an optional interface IOptimisticallyConcurrentStateRepository<TState, TInput>
that a Repository may implement. When implemented, REstate will send its recently loaded state to the repository so that the repository can avoid another read before making an update.
Current Implementations
- EntityFrameworkCore
Copied from: #61
9.0.0 - Natural Schematics!
🎇
This is a huge release that does introduce a number of small breaking changes to some behavior from 8.0.1, so testing will be required to update.
The big deliverable here is Natural Schematics and StateMachines, this is a model that uses strongly-typed states and interface based actions with AUTOMATIC registration! Docs are pending free time, but the Provisioning System example in the code is a great place to pick up from!
8.0.1
8.0.0
7.0.0
6.1.0
Ninject adapter is now available!
SendAsync calls inside entry actions now change the state returned by the initial SendAsync, this allows tail calls while still informing the caller of what state the machine ended up in.
Added some new ways of registering connectors when they are strongly typed rather than unbound generics.