Event sourcing/ CQRS and Domain-driven design for new project.

Hi All,

We are working on new project with Event sourcing/ CQRS and Domain-driven design with Dev Ops and kubernates . Planning to use Apache Kafka as Event Bus, MYSql is database event storing and Elastic Search as read data in the implementation. Please let know, can we use Axon Frame work for the above requirement.

thanks,
Venkat

Hi Venkat,

Based on your description, Axon Framework seems to be a very good fit.
Axon provides Spring Boot starters on the top of that, so you can benefit from auto-configuration as well.

Kafka is an alternative approach to distributing events, besides Axon Server which is default.
The latest Axon Kafka Extension is at version 4.0-RC2, and it is mostly community driven.

I have created a demo application that demonstrate usage of this extension. Hopefully you can benefit from that.

I would also suggest to consider Axon Server as an even store and routing mechanism.
It comes with almost zero configuration, and it is able to distribute commands and queries in addition to events.
This will enable better scalability (more instances) of your applications, with less effort and less infrastructure (no Kafka or Rabbit to distribute events, no Spring cloud to distribute your commands, no out of the box community solution for distributing queries)

I see Kubernetes as a good choice to orchestrate your containers/applications in general. This is not that much related to Axon applications.
I see that people are using PAAS (for example CloudFoundry) as well, as it provides greater abstraction (you do not manage containers: security patches…) in the Cloud Computing.
It really depends on your DevOps culture and area of expertise within your company.

Hi Ivan,

Thank for the inputs and demo application. We are looking for java solution and provided demo application in kotlin. If possible, can you please provide java demo example with Kafka, H2 and elastic search.

Thanks,
Venkat

Hey,

I don’t have this in Java, yet.

I believe that community has already experimented with this. I can point you to some example(s)

Best,
Ivan

Hi Ivan,

Thanks for the quick update. We are able to run the application and we are trying to add elastic Search to this project for read db.

As you suggested in the previous email as shown below.

I would also suggest to consider Axon Server as an even store and routing mechanism.
It comes with almost zero configuration, and it is able to distribute commands and queries in addition to events.
This will enable better scalability (more instances) of your applications, with less effort and less infrastructure (no Kafka or Rabbit to distribute events, no Spring cloud to distribute your commands, no out of the box community solution for distributing queries)

Question is : Our current architecture included Apache Kafka, MYSql and Elastic Search.

  • Apache Kafka as Event Bus,
  • MYSql is database event storing
  • Elastic Search as read data

If we use Axon Server - How the architecture looks like with MySql and Elastic Search. If possible, please provide more details…

Thanks,
Venkat

Hi Venkat,

  • Axon Server as Event Bus, Command Bus and Query Bus (Your application connects to Axon Server to distribute three types of messages: events, commands and queries). You do not need Kafka to distribute events any more. You do not need Spring Cloud extension to distribute command any more.

  • this enables scalability, as you can run multiple instances of your application (axon server will distribute messages between application instances of the box, without any configuration almost)

  • this simplifies you infrastructure, as you can remove Kafka and/or Spring cloud from your system(s) landscape.

  • Enables different deployment strategies of your application(s) components: you can deploy your command and query components separately as individual services. Axon Server will distribute messages between them. You can go further with de-composition, and deploy your bounded context components individually. Axon Server will distribute messages out of the box between these contexts.- Axon Server as Event Store (Your application stores events/eventsourcing in Axon Server. Storing events in Axon Server is optimized in comparison with SQL/Mongo DBs)

  • Webinar by Allard (Event Storage in Axon Server)- Elasticsearch as your Read model storage - OK. The beauty of CQRS architectural pattern is that you can decouple your Query/Read side from Command side, and take any type of storage that fit your needs/requirements.

If your situation proofs to be more technical, a face-to-face call might also be in place.
To that end, I’d suggest to fill in a form on the AxonIQ website for example.

Best,
Ivan

Hi Ivan,

Thanks for the detailed explanation. We are discussing with the client about the axon server.

Another question :
As per the given axon Kafka example, kafka integration is available in <axon.version>4.0-RC2**</axon.version>**. Can we use 4.0-RC2 for the production?

Thanks,

Venkat

Hi Venkat,

I’m happy to see that you are taking good care of your customers and/or partners by asking good questions!

Short answer is, yes you can use it in production.

AxonIQ (including me) is focussed on Axon Server and Framework at the moment, by adding more features. Axon Server Enterprise brings fault tolerance/high availability on top of the Axon Server Community Edition and professional support, which are crucial in critical moments. I believe that we should focus on domain model rather than configuring infrastructure.

Feel free to contact us.

Best,
Ivan