As per Lagom documentation, Persistent Entity is rehydrated upon demand with all it’s state built from events.
Now let’s assume, we have a persistent entity that maintains a list of orders placed by customer:
PersistentEntity_State(id: Int, orders: List[Order]) and with every new
OrderPlaced event we add to this list of orders.
Evidently, this persistent entity could grow really huge in time.
My questions are:
- Wouldn’t it make rehydrating such huge entities slow in time?
- Isn’t there are possibilty that we may stumble upon OOM exceptions while rehydrating such entities?