Closed forestphoenix closed 5 years ago
Solution:
Function StoredType -> (ByteString -> AnsSerialized)
is passed to the deserialization
This function can be generated from a Projector for all its events and projections.
deserialiseEvents :: Projector a -> (StoredType -> (ByteString -> AnsSerialized))
deserialiseProjections :: Projector a -> (StoredType -> (ByteString -> AnsSerialized))
deserialiseProjIds :: Projector a -> (StoredType -> (ByteString -> AnsSerialized))
For now, only the events will be stored in a flat file.
The layout for the Storage is as follows:
(1-byte version)
(n times:)
(4-byte length)
(n-byte event)
(4-byte crc of length and event)
For now, there are no open questions any more here.
Serialize the Event to and from a flat file.
Unresolved Issues:
With the current design, deserialization is done via a type class. Is this still a valid design?
Could there be alternatives? How do other eventstores deal with the problem?