SpineEventEngine / documentation

Documentation and articles at spine.io and other web resources
https://spine.io
Apache License 2.0
0 stars 0 forks source link

Why do we use Protobuf for entity states? #17

Open alexander-yevsyukov opened 5 years ago

alexander-yevsyukov commented 5 years ago

This is either a Blog post or a FAQ item. Here's a draft for the text.


Aggregates are meant to preserve business invariants. So, when a command is handled the “whole” thing changes, a one or a couple of things.

We want to be able to cache the state. It's easier when it's a separate data object, which is immutable.

Protobuf gives us code generation, binary transfer and storage support, and Json export/import.

Potentially such an arrangement would ease porting to Go or Kotlin, since we'd need to change the message processing logic.

alexander-yevsyukov commented 4 years ago

Some bits can be taken from here: https://docs.google.com/document/d/1qeEYUMuV_COW5wns8SaXFyNXalLJGDAsCy1HW5vagvo/edit#