Axon lifecycle?

This is a long question but bear with me.

In the previous milestone, I was using the Axon Repository to save the data into the domain_event_entry table. In this new release are we using the same? I’m kind of lost on how all these pieces work. Please correct me if this is the right flow:

For commands, I use an axon repository for saving the data into the event table.
For queries, I save simultaneously the record that was saved in the event table in another table for queries. Is that a correct approach?
Reading the event table to reproduce a value will consume a lot of resources. I read that I can use a snapshot, but is there any example of this? I am trying to use Axon with Microservices architecture and I am interested in how this works or best practices.

Additional question
How does the new release candidate work to do all this? I know that this is too broad a question but I would love to see a very long answer.

I watched the webinar videos and I am happy that now it works very nicely with spring boot.

Hi Richard,

I’m going to disappoint you by not providing a very long answer but I do hope it helps nevertheless ;). Here goes:

The Axon Repository is used to save and load the command model or aggregate. The command model is not meant for querying unless you are validating a command.

The default way to handle commands is from within an aggregate, in which case Axon loads the aggregate for you. I.e. In normal use you will never even use the Repository yourself and definitely not during querying.

For queries you should save your own view models (e.g. Using JPA). This is normally done from event handlers.

This leaves the command side of your application free to only concern itself with the validation of commands and publication of events. And the query side with providing the best views of the data for dealing with queries. You can read more about this pattern and why it’s useful here:

The release candidate does not change anything about the above process. However, it adds Spring Boot integration which may help you set up an application faster.

Good luck!