Querying Projections from Database
Before looking at how we can store our projections in a database, we should ask ourselves, should we keep our projections in memory or not?
In case of events, we don’t really have a choice, we need to store them in a database before going live with our application. However, for projections, we also have the option of keeping them in memory in the final application.
In this case, when the application starts, we create the projection by replaying all the events from the beginning, reading them from the database, and then we must keep the projections always up to date by reading new events from the database before every query.
The advantage of keeping projections in memory is the speed of access and flexibility. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access