이전 글: 2022.01.11 - [architecture/MSA] - [arch] what is cqrs - 조회와 비조회의 엄연한 분리
[arch] what is cqrs - 조회와 비조회의 엄연한 분리
CQRS는 Command and Query Responsibility Segregation(명령과 조회의 책임 분리)의 약자이다. 즉 쉽게 말해서 data에 대한 read와 write는 분리되어 개발되어야 한다는 것이다. 1. Before 설명을 하기 전에 그림..
bangpurin.tistory.com
이전 글에서 cqrs에 대해 생각해보았는데, 이를 구현하는 방법을 보던 중 Axon framework라는 것을 알게 되었다.
Based on architectural principles, such as Domain-Driven Design (DDD) and Command-Query Responsibility Separation (CQRS), Axon Framework provides the building blocks that CQRS requires and helps to create scalable and extensible applications while maintaining application consistency in distributed systems.
사실 cqrs나 event driven developlment을 검색했을 때 주로 나오는 기술이 Kafka나 rabbitMQ였고 이전 회사에서도 Kafka를 도입하려고 했었던지라 비동기 메세징에 대해서는 Kafka가 제일 먼저 떠오른게 사실이다.
그만큼 요즘, 딱 지금 이 시기에는 Kafka가 대세아닌 대세를 누리는 것 같은데 그 틈으로 보이는 Axon이 흥미로워 보였고, 차이점이 있지 않을까 싶었다.
거창한 설명과 비교는 인터넷에 널린 자료를 참고하면 되겠고, 내가 생각하는 큰 차이점은 아래와 같다.
- Axon은 개발할 때부터, 즉 뼈속부터 cqrs를 지키며 개발할 수 있게 해주는 framework라면
- Kafka는 이미 있는 그들의 플랫폼에, 그들이 제공하는 api를 이용해서 event를 publish / handling 할 수 있는데 message streaming 위주의 기능을 한다는 것.
(직접 사용해보지 않아서 아닐수도 있음에 주의 ㅋㅋ)
이 글은 Kafka보다는 Axon에 대해 알고 싶은 글이므로 Axon에 대해 더 찾아본다.
Axon Framework란 EventSourcing, CQRS, DDD(Domain Driven Design) 세 가지 Concept을 중심으로 어플리케이션을 개발할 수 있게 도와주는 프레임워크이다.
Axon Server는 그러한 프레임워크를 작동하게 하는 서버이며 메세지 라우팅, 이벤트 저장소 등의 역할을 수행한다.
Axon Server는 다음과 같은 특징을 갖는다.
- Event Store(이벤트 저장, 이벤트 전파, 스냅샷 저장 등)에 특화
- AxonServer 내부에는 Event 저장을 위한 별도 DB가 없으며, File을 직접 다룸
- EventStore는 오직 데이터 추가만이 가능하기에 수정, 삭제와 관련된 그 어떠한 API도 제공되지 않음
- 높은 가용성
- 클러스터 모드를 지원함
- 핸들러가 먹통이 되었더라도 큐에 메세지를 저장
- 서비스간 통신은 gRPC 방식을 사용
참고로 Axon Framework + Axon Server 조합이 필수는 아니다.
Axon Server대신 Kafka + NoSQL 등을 조합하여 사용할 수도 있다(Axon framework가 제공하는 Kafka-connector를 사용하여 kafka와 연동가능하다).
개념은 이정도로 살펴보고(사실 봐도 와닿지 않는다.. 따라서 개발하면서 더 찾아보고) 몸빵하면서 익혀야겠다.
springboot2, gradle multi project 등 이미 나에게 익숙한 환경에서 axon dependency 를 활용한 샘플 프로젝트 클론코딩을 진행하려고 한다.
클론코딩 참고 블로그: https://cla9.tistory.com/2?category=814447
1. Axon Framework 개요
1. 개요 앞으로 진행될 포스팅은 MSA에 관심 많은 분을 대상으로 DDD, CQRS 및 Event Sourcing 내용을 알고 있다고 가정하고, Spring 환경에서 AxonFramework를 활용해 개념 구현하는 방법에 대해 소개하고자
cla9.tistory.com
axon guide: https://docs.axoniq.io/reference-guide/
Introduction - Axon Reference Guide
The standard version, called "Axon Server", is open source and free to download and use. It is provided under an AxonIQ-specific open source license. While this license allows you to run the software freely in any environment, it is less permissive than th
docs.axoniq.io
axon vs kafka in axon's point of view: https://axoniq.io/blog-overview/axon-and-kafka-how-does-axon-compare-to-apache-kafka
Axon and Kafka How does Axon compare to Apache Kafka?
We use cookies to analyze our traffic, to optimize the site functionality and to make sure you get the best experience on our website. We do not place cookies to invade your privacy. By continuing to use this site you are giving us your consent to our cook
axoniq.io
'architecture > micro service' 카테고리의 다른 글
[inflearn] Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA) (0) | 2024.02.18 |
---|---|
[gRPC] gRPC gateway란 (0) | 2022.01.24 |
[arch] gRPC란? (0) | 2022.01.20 |
[arch] DDD pattern 와 aggregate란 (0) | 2022.01.13 |
[arch] cqrs란 - 조회와 비조회의 엄연한 분리 (0) | 2022.01.11 |