data synchronization with linkmove in the context of ddd

31
DB Synchronization with LinkMove: a missing piece in your Domain-Driven Design Architecture by Andrus Adamchik @andrus_a

Upload: andrus-adamchik

Post on 21-Jan-2017

123 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Data Synchronization with LinkMove in the context of DDD

DB Synchronization with LinkMove:a missing piece in your Domain-Driven Design Architectureby Andrus Adamchik @andrus_a

Page 2: Data Synchronization with LinkMove in the context of DDD

About Me• I used to be a WO developer in the past life.• I write open source code.• I run ObjectStyle.

Page 3: Data Synchronization with LinkMove in the context of DDD

Domain-Driven Design

Page 4: Data Synchronization with LinkMove in the context of DDD

Domain: Sports Organization

Page 5: Data Synchronization with LinkMove in the context of DDD

Model: Overlapping PartsScheduling

Website

Page 6: Data Synchronization with LinkMove in the context of DDD

Model: Distinct PartsScheduling

Website

Page 7: Data Synchronization with LinkMove in the context of DDD

Domain-Driven Design

• Business domain is split into "bounded contexts".• Ubiquitous language within each context.• ... many other good ideas...

Page 8: Data Synchronization with LinkMove in the context of DDD

How to Integrate Bounded Contexts?

Page 9: Data Synchronization with LinkMove in the context of DDD

Integration Strategies

• REST services.• Messaging (domain events).

Page 10: Data Synchronization with LinkMove in the context of DDD

Integrating Bounded Contexts: Challenges

• Source context needs to proactively build an integration layer.

• Consuming context need an "anticorruption layer" to avoid coupling with the producer model.

• What to do when the source is down?

Page 11: Data Synchronization with LinkMove in the context of DDD

ETL (Extract-Transform-Load) as Integration Strategy

• Can be applied to legacy sources.• Built-in "anti-corruption" layer.• Consuming context persists data, and can operate when the

source is unavailable.

Page 12: Data Synchronization with LinkMove in the context of DDD

ETL Challenges• Most ETL literature and solutions are data warehouse

specific.• Most solutions are not open-source.• Most solutions are standalone services with extra integration

challenges.

Page 13: Data Synchronization with LinkMove in the context of DDD

Enter LinkMove...One of the least promoted and most used open source tools in our team.

https://github.com/nhl/link-move

Page 14: Data Synchronization with LinkMove in the context of DDD

LinkMove - Model-Driven Embedded ETL

Page 15: Data Synchronization with LinkMove in the context of DDD

Demo - JDBC Extractor

Page 16: Data Synchronization with LinkMove in the context of DDD

LinkMove Solution• Embedded in your app.• Version controlled extractor descriptors and task code.• Driven by consumer's ORM model (Cayenne-based).• Extracts data from any source (can work with legacy

sources).

Page 17: Data Synchronization with LinkMove in the context of DDD

LinkMove - Connectors• JDBC• LDAP (including ActiveDirectory)• Files• URL• you can add your own

Page 18: Data Synchronization with LinkMove in the context of DDD

LinkMove - Extractors• JDBC• LDAP (including ActiveDirectory)• XML• JSON• CSV• you can add your own

Page 19: Data Synchronization with LinkMove in the context of DDD

Demo - JSON Extractor

Page 20: Data Synchronization with LinkMove in the context of DDD

Connecting Sources to Targets

Page 21: Data Synchronization with LinkMove in the context of DDD

Match by Target ID (default, implicit)

Page 22: Data Synchronization with LinkMove in the context of DDD

Match by Target Property (or Properties)

Page 23: Data Synchronization with LinkMove in the context of DDD

Match with Mapping Strategy

Page 24: Data Synchronization with LinkMove in the context of DDD

Transforming Data.. Goals:• Adapt source to conform to target format.• Clean up source data.• Filter source data.• Simplify matching.• Apply business rules.

Page 25: Data Synchronization with LinkMove in the context of DDD

Transforming in Extractors

Page 26: Data Synchronization with LinkMove in the context of DDD

Transforming with Listeners

Page 27: Data Synchronization with LinkMove in the context of DDD

Performance Optimization

Page 28: Data Synchronization with LinkMove in the context of DDD

Batching• Matching and committing targets in batches.• Default batch size is 500 items.• Size can be customized.

Page 29: Data Synchronization with LinkMove in the context of DDD

Non-Blocking Parallel Execution

Page 30: Data Synchronization with LinkMove in the context of DDD

Summary• LinkMove is an embedded model-driven ETL.• Reuses your Cayenne model.• Built-in anti-corruption layer.• Ideal for synchronizing "bounded contexts" in your system.• .. or as a programmable general purpose ETL framework.

Page 31: Data Synchronization with LinkMove in the context of DDD

Questions?

• You can ★ us here: https://github.com/nhl/link-move