https://github.com/arawn/building-modular-monoliths-using-spring
SpringApplication application = new SpringApplicationBuilder()
.sources(MonolithsApplication.class)
.child(FirstServiceConfiguration.class)
.sibling(SecondServiceConfiguration.class)
.sibling(ThirdServiceConfiguration.class)
.build();
application.run(args);
}
✔ 단일 프로젝트에 모든 코드가 모여있다
✔ 시스템 구조가 간결하고, 빠르게 구축할 수 있다
✔ 테스트 및 배포 파이프라인 구성이 간단하다
✔ 인프라스트럭처 구축와 운용이 간결하다
✔ 시스템을 조직 구조에 맞게 더 적절히 정렬 할 수 있다
✔ 서비스를 독립적으로 배포 또는 확장 할 수 있다
✔ 서비스 장애가 시스템 전체 장애로 전파되지 않는다
✔ 문제 해결에 특화된 다양한 기술을 도입할 수 있다
https://github.com/odrotbohm/sos
https://gotober.com/2018/sessions/515/modular-monoliths
https://engineering.shopify.com/blogs/engineering/deconstructing-monolith-designing-software-maximizes-developer-productivity
https://en.wikipedia.org/wiki/Hexagonal_architecture_(software)
usecase
repository
notifications
Application
Core
Ports
commands
jdbc/restful
message/email
message
restful/userinterface
Ý
.
https://github.com/arawn/building-modular-monoliths-using-spring
catalogs orders
shipments
.
└── orders
   ├── domain
   │   ├── entity
   │   │   ├── Order.java
   │   │   ├── OrderProduct.java
   │   │   ├── OrderProductMapper.java
   │   │   ├── OrderRepository.java
   │   │   └── ShippingDesk.java
   │   └── usecase
   │   ├── Orders.java
   │   └── OrderProcessing.java
  ├── integrate
   ├── data
   └── web
.
└── catalogs
   ├── domain
  ├── integrate
   ├── data
   └── web
.
└── shipments
   ├── domain
  ├── integrate
   ├── data
   └── web
https://martinfowler.com/bliki/PresentationDomainDataLayering.html
<<Interface>>
Catalogs
ShipmentOrderService
OrderCatalogService
Order
<<Interface>>
OrderProductMapper
<<Interface>>
ShippingDesk
CatalogManager
<<Interface>>
DeliveryProcessingDeliveryManager
catalogs orders
shipments
https://youtu.be/dJ5C4qRqAgA
step_1: modularization
https://github.com/arawn/building-modular-monoliths-using-spring
<<Interface>>
ProductRepository
OrderCatalogService
<<Interface>>
OrderProductMapper
InMemory
ProductRepository
CatalogManager
<<Interface>>
Catalogs
<<Interface>>
ProductRepository
OrderCatalogService
<<Interface>>
OrderProductMapper
InMemory
ProductRepository
CatalogManager
<<Interface>>
Catalogs
service
module module module
step_2: encapsulation and separately
https://github.com/arawn/building-modular-monoliths-using-spring
Services Repositories
Root WebApplicationContext
(containing middle-tier services, datasources, etc)
DispatcherServlet
HandlerMapping
Controllers
ViewResolver
Servlet WebApplicationContext
(containing controllers, view resolvers, and other web-related beans)
OrderCatalog Shipment
OrderCatalog Shipment
step_3: context boundaries
https://github.com/arawn/building-modular-monoliths-using-spring
OrderCatalog Shipment
step_4: modularizing configurations
https://github.com/arawn/building-modular-monoliths-using-spring
serviceservice
module module
step_5: decomposing system and stand alone services
https://github.com/arawn/building-modular-monoliths-using-spring
✓ Modular Monoliths • Simon Brown
✓ Deconstructing the Monolith • Shopify
✓ Modulithic Applications with Spring Boot • Oliver Drotbohm
✓ 패턴 지향 소프트웨어 아키텍처
✓ 클린 아키텍처
✓ 마이크로서비스 아키텍처 구축
✓ 도메인 주도 설계 핵심
✓ 오브젝트: 코드로 이해하는 객체지향 설계
✓ 자바 9 모듈 프로그래밍

우아한 모노리스