πŸ’»
Albert's Til
GitHub
  • 맀일맀일 μ‘°κΈˆμ”© μ„±μž₯ν•˜κΈ°
    • README
    • CS
      • Network
      • HTTP
        • NO-CACHE
      • 였λ₯˜ μ½”λ“œ
      • ORM 도ꡬ
      • Design Pattern
        • CQRS Pattern
          • Event Sourcing and CQRS pattern
        • Builder Pattern
    • DB
      • MySQL
        • Timeline
        • Pagination
        • Index
        • Database Performance Optimization Strategies
        • B+ tree
        • MySQL Connectors VS MySQL Shell(Scripting) VS MySQL Workbench
        • MySQL Storage Engine Architecture
      • Normalization & Denormalization
      • JPA
        • @Transactional
        • Why JPA?
        • About JPA
        • N+1 Issue
        • Index
        • ElementCollection&CollectionTable
        • orphanRemoval
        • CascadeType
        • Use Subselect
        • Dynamic Instance Creation
        • Paging
        • Order
        • Spefication
        • mappedBy
      • MongoDB
        • ObjectId
      • Why MySQL?
      • ACID properties of transactions
      • Between JPA and JDBC
      • Identifiers in Hibernate/JPA
    • Java
      • Jackson de/serialize
      • Collections.singletonList() vs List.of()
      • Manage dependencies in Gradle
      • Logging Level
      • Bean Validation
      • JVM Internals
        • Threads
          • Frame
        • Shared Between Threads
          • Classloader
            • Class Loader Hierarchy
            • Loading Linking Initialization
      • Java Collection Framework
      • Annotation
      • Generic
      • λ””λ―Έν„° 법칙
    • Spring
      • Caching
      • Spring Integration Overview
        • ThreadPollTaskExecutor
        • Messaging Bridge
        • Channel Adapter
        • Poller
        • Configuration and @EnableIntegration
        • Message Endpoints
        • Message Channels
      • HATEOAS
      • @Autowired vs Constructor Dependency Injection
      • Spring Security
        • JWT 토큰 μ‚¬μš©ν•œ 인가
        • OAuth 2 Login
        • OAuth 2 인증
        • 인가
        • 인증
        • PasswordEncoder
      • IoC Container
      • Filter,Interceptor,AOP,Argument Resolver
      • Spring Annotation
      • About Spring
    • Kafka
      • Error Channel
    • Infra
      • Scale Up || Scale Out
      • Docker
        • Dockerfile
        • Docker Hub Deploy
        • Command
      • Cloud μœ ν˜•
        • Infrastructure as a Service
        • Platform as a Service
        • Software as a Service
      • 무쀑단 배포
        • μ—”μ§„μ—‘μŠ€(Nginx)
      • μ½”λ“œ μžλ™ 배포
        • Technical
      • AWS EC2
        • PEM(Privacy Enhanced Mail) ν‚€
      • AWS RDS
      • AWS S3
    • CodeSquad
      • Spring Boot Project 1μ£Όμ°¨ 회고
      • Spring Boot Project 2μ£Όμ°¨ 회고
      • Spirng Boot Project 3μ£Όμ°¨ 회고
      • Spring Boot Project 4μ£Όμ°¨ 회고
    • Foody Moody ν”„λ‘œμ νŠΈ
      • Query Performance Comparison
      • HeartCount Asynchronous Issue
      • DeferredResult
      • ResponseBodyEmitter
      • SseEmitter (Spring)
      • Server-Sent Events (SSE)
      • 기술 μŠ€νƒ 적용 이유
      • NO-CACHE(HTTP)
      • Transactional
    • DDD
      • AggregateId
    • Test
      • RestAssured
    • Coding and Algorithmic Problems
      • 819. Most Common Word
      • 344. Reverse String
      • 125. Valid Palindrome
      • 937. Reorder Data in Log Files
    • Node
      • Async... Await...
      • Custom Transactional Decorator Challenger
    • Python
      • Python Basic Grammar
        • Comments and Input/Output
        • Variable
        • Data type
        • Operations and syntax
        • List,Tuple,Dictionary,Set
        • Function
        • Conditional statement
        • Loop
    • HTML
      • HTML Basic
      • HTML Basic Tags
      • HTML Form Tags
      • HTML Table Tags
    • CSS
      • CSS Basic
      • CSS Practice
Powered by GitBook
On this page

Was this helpful?

  1. 맀일맀일 μ‘°κΈˆμ”© μ„±μž₯ν•˜κΈ°
  2. DDD

AggregateId

DDDμ—μ„œ AggregateId μ‚¬μš©ν•˜λŠ” 이유

  1. μ‹λ³„μž 뢄리: AggregateIdλ₯Ό μ‚¬μš©ν•¨μœΌλ‘œμ¨ μ—”ν‹°ν‹°μ˜ μ‹λ³„μžλ₯Ό λͺ…μ‹œμ μœΌλ‘œ 뢄리할 수 μžˆμŠ΅λ‹ˆλ‹€. Order μ—”ν‹°ν‹°μ˜ orderId ν•„λ“œλŠ” AggregateId둜 μ„ μ–Έλ˜μ–΄ ν•΄λ‹Ή μ—”ν‹°ν‹°κ°€ κ³ μœ ν•˜κ²Œ μ‹λ³„λ˜λŠ” 것을 λ‚˜νƒ€λƒ…λ‹ˆλ‹€. μ΄λ ‡κ²Œ μ‹λ³„μžλ₯Ό λΆ„λ¦¬ν•˜λ©΄ 도메인 κ°œλ…μ˜ 경계λ₯Ό λͺ…ν™•ν•˜κ²Œ ν•˜κ³ , 도메인 λͺ¨λΈμ˜ 의미λ₯Ό 더 잘 전달할 수 μžˆμŠ΅λ‹ˆλ‹€.

  2. 도메인 의미 λΆ€μ—¬: AggregateIdλŠ” λ„λ©”μΈμ—μ„œ μ€‘μš”ν•œ κ°œλ…μ„ ν‘œν˜„ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, AggregateIdκ°€ UUID ν˜•νƒœλ‘œ μƒμ„±λ˜λ©΄, λ„λ©”μΈμ—μ„œ κ³ μœ μ„±μ„ 보μž₯ν•˜λ©΄μ„œ 일관성을 μœ μ§€ν•  수 μžˆμŠ΅λ‹ˆλ‹€. μ΄λŠ” 도메인 λͺ¨λΈμ„ μ΄ν•΄ν•˜κ³  κ΅¬μ„±ν•˜λŠ” 데 도움이 되며, 도메인 μ „λ¬Έκ°€μ™€μ˜ μ˜μ‚¬μ†Œν†΅μ„ κ°•ν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

  3. λΆ„μ‚° μ‹œμŠ€ν…œκ³Όμ˜ μƒν˜Έ μš΄μš©μ„±: AggregateIdλŠ” λΆ„μ‚° μ‹œμŠ€ν…œμ—μ„œ μ—¬λŸ¬ μ„œλΉ„μŠ€ κ°„μ˜ 톡신과 데이터 일관성을 μœ μ§€ν•˜λŠ” 데 도움이 λ©λ‹ˆλ‹€. 도메인 이벀트λ₯Ό κ΅ν™˜ν•˜κ±°λ‚˜ λ§ˆμ΄ν¬λ‘œμ„œλΉ„μŠ€ 간에 νŠΈλžœμž­μ…˜ 경계λ₯Ό μ„€μ •ν•  λ•Œ AggregateIdλ₯Ό μ‚¬μš©ν•˜μ—¬ 효율적인 μƒν˜Έ μš΄μš©μ„±μ„ 달성할 수 μžˆμŠ΅λ‹ˆλ‹€.

  4. 이벀트 μ†Œμ‹±(Event Sourcing): AggregateIdλŠ” 이벀트 μ†Œμ‹± νŒ¨ν„΄μ—μ„œ 이벀트 μŠ€νŠΈλ¦Όμ„ κ΅¬μ„±ν•˜κ³  μž¬μƒμ„±ν•˜λŠ” 데 μ‚¬μš©λ©λ‹ˆλ‹€. 각 Aggregate의 이벀트 μŠ€νŠΈλ¦Όμ€ ν•΄λ‹Ή Aggregate의 AggregateIdλ₯Ό 기반으둜 μƒμ„±λ˜λ©°, 이λ₯Ό 톡해 데이터 λ³€κ²½μ˜ μ›μ²œμ„ 좔적할 수 μžˆμŠ΅λ‹ˆλ‹€.

μœ„μ™€ 같은 이유둜 DDDμ—μ„œ AggregateIdλ₯Ό μ‚¬μš©ν•˜μ—¬ 도메인 λͺ¨λΈμ„ κ΅¬μ„±ν•˜κ³  κ΄€λ¦¬ν•¨μœΌλ‘œμ¨ λ„λ©”μΈμ˜ 의미λ₯Ό 더 잘 μ „λ‹¬ν•˜κ³ , λ„λ©”μΈμ˜ 경계λ₯Ό λͺ…ν™•νžˆ ν•˜λ©°, λΆ„μ‚° μ‹œμŠ€ν…œκ³Όμ˜ μƒν˜Έ μš΄μš©μ„±μ„ κ°•ν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Last updated 1 year ago

Was this helpful?