Aurimas Griciลซnas Profile picture
Dec 21 โ€ข 15 tweets โ€ข 5 min read
Do you know what CDC(Change Data Capture) is and that there are multiple ways to implement it?

Find out in the Thread ๐Ÿ‘‡

--------

๐—™๐—ผ๐—น๐—น๐—ผ๐˜„ ๐—บ๐—ฒ and hit ๐Ÿ”” to ๐—Ÿ๐—ฒ๐˜ƒ๐—ฒ๐—น ๐—จ๐—ฝ in #MLOps, #MachineLearning, #DataEngineering, #DataScience and overall #Data space! Image
๐—–๐—ต๐—ฎ๐—ป๐—ด๐—ฒ ๐——๐—ฎ๐˜๐—ฎ ๐—–๐—ฎ๐—ฝ๐˜๐˜‚๐—ฟ๐—ฒ is a software process used to replicate actions performed against Operational Databases for use in downstream applications.

๐—ง๐—ต๐—ฒ๐—ฟ๐—ฒ ๐—ฎ๐—ฟ๐—ฒ ๐˜€๐—ฒ๐˜ƒ๐—ฒ๐—ฟ๐—ฎ๐—น ๐˜‚๐˜€๐—ฒ ๐—ฐ๐—ฎ๐˜€๐—ฒ๐˜€ ๐—ณ๐—ผ๐—ฟ CDC. ๐—ง๐˜„๐—ผ ๐—ผ๐—ณ ๐˜๐—ต๐—ฒ ๐—บ๐—ฎ๐—ถ๐—ป ๐—ผ๐—ป๐—ฒ๐˜€:

๐Ÿ‘‡
โžก๏ธ ๐——๐—ฎ๐˜๐—ฎ๐—ฏ๐—ฎ๐˜€๐—ฒ ๐—ฅ๐—ฒ๐—ฝ๐—น๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป (refer to 3๏ธโƒฃ in the Diagram).

๐Ÿ‘‰ CDC can be used for moving transactions performed against Source Database to a Target DB. If each transaction is replicated - it is possible to retain all ACID guarantees when performing replication.

๐Ÿ‘‡
๐Ÿ‘‰ Real Time CDC is extremely valuable here as it enables Zero Downtime DB Replication ๐—ฎ๐—ป๐—ฑ and Migration. E.g It is extensively used when migrating ๐—ผ๐—ป-๐—ฝ๐—ฟ๐—ฒ๐—บ ๐——๐—ฎ๐˜๐—ฎ๐—ฏ๐—ฎ๐˜€๐—ฒ๐˜€ serving Critical Applications that can not be shut down for a moment to the cloud.

๐Ÿ‘‡
โžก๏ธ Facilitation of ๐——๐—ฎ๐˜๐—ฎ ๐— ๐—ผ๐˜ƒ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ณ๐—ฟ๐—ผ๐—บ ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น ๐——๐—ฎ๐˜๐—ฎ๐—ฏ๐—ฎ๐˜€๐—ฒ๐˜€ ๐˜๐—ผ ๐——๐—ฎ๐˜๐—ฎ ๐—Ÿ๐—ฎ๐—ธ๐—ฒ๐˜€ (refer to 1๏ธโƒฃ in the Diagram) ๐—ผ๐—ฟ ๐——๐—ฎ๐˜๐—ฎ ๐—ช๐—ฎ๐—ฟ๐—ฒ๐—ต๐—ผ๐˜‚๐˜€๐—ฒ๐˜€ (refer to 2๏ธโƒฃ in the Diagram) ๐—ณ๐—ผ๐—ฟ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜๐—ถ๐—ฐ๐˜€ ๐—ฝ๐˜‚๐—ฟ๐—ฝ๐—ผ๐˜€๐—ฒ๐˜€.

๐Ÿ‘‡
๐Ÿ‘‰ There are currently two Data movement patterns widely applied in the industry: ๐—˜๐—ง๐—Ÿ ๐—ฎ๐—ป๐—ฑ ๐—˜๐—Ÿ๐—ง.
๐Ÿ‘‰ ๐—œ๐—ป ๐˜๐—ต๐—ฒ ๐—ฐ๐—ฎ๐˜€๐—ฒ ๐—ผ๐—ณ ๐—˜๐—ง๐—Ÿ - data extracted by CDC can be transformed on the fly and eventually pushed to the Data Lake or Data Warehouse.

๐Ÿ‘‡
๐Ÿ‘‰ ๐—œ๐—ป ๐˜๐—ต๐—ฒ ๐—ฐ๐—ฎ๐˜€๐—ฒ ๐—ผ๐—ณ ๐—˜๐—Ÿ๐—ง - Data is replicated to the Data Lake or Data Warehouse as is and Transformations performed inside of the System.

There is more than one way of how CDC can be implemented, the methods are mainly split into three groups:

๐Ÿ‘‡
โžก๏ธ ๐—ฃ๐˜‚๐—น๐—น ๐—•๐—ฎ๐˜€๐—ฒ๐—ฑ ๐—–๐——๐—–

๐Ÿ‘‰ A client queries the Source Database and pushes data into the Target Database.

โ—๏ธDownside 1: There is a need to augment all of the source tables to include indicators that a record has changed.

๐Ÿ‘‡
โ—๏ธDownside 2: Usually - not a real time CDC, it might be performed hourly, daily etc.
โ—๏ธDownside 3: Source Database suffers high load when CDC is being performed.
โ—๏ธDownside 4: It is extremely challenging to replicate Delete events.

๐Ÿ‘‡
โžก๏ธ ๐—ฃ๐˜‚๐˜€๐—ต ๐—•๐—ฎ๐˜€๐—ฒ๐—ฑ ๐—–๐——๐—–

๐Ÿ‘‰ Triggers are set up in the Source Database. Whenever a change event happens in the Database - it is pushed to a target system.

๐Ÿ‘‡
โ—๏ธ Downside 1: This approach usually causes highest database load overhead.
โœ… Upside 1: Real Time CDC.

๐Ÿ‘‡
โžก๏ธ ๐—Ÿ๐—ผ๐—ด ๐—•๐—ฎ๐˜€๐—ฒ๐—ฑ ๐—–๐——๐—–

๐Ÿ‘‰ Transactional Databases have all of the events performed against the Database logged in the transaction log for recovery purposes.

๐Ÿ‘‡
๐Ÿ‘‰ A Transaction Miner is mounted on top of the logs and pushes selected events into a Downstream System. Popular implementation - Debezium.

๐Ÿ‘‡
โ—๏ธ Downside 1: More complicated to set up.
โ—๏ธ Downside 2: Not all Databases will have open source connectors.
โœ… Upside 1: Least load on the Database.
โœ… Upside 2: Real Time CDC.

๐Ÿ‘‡
I will help you Level Up in #MLOps, #MachineLearning, #DataEngineering, #DataScience and overall #Data space.

๐—™๐—ผ๐—น๐—น๐—ผ๐˜„ ๐—บ๐—ฒ and hit ๐Ÿ””

Join a growing community of 3000+ Data Enthusiasts by subscribing to my ๐—ก๐—ฒ๐˜„๐˜€๐—น๐—ฒ๐˜๐˜๐—ฒ๐—ฟ: swirlai.substack.com/p/sai-10-airflโ€ฆ

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Aurimas Griciลซnas

Aurimas Griciลซnas Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Aurimas_Gr

Dec 23
If I could only choose 5 books to read in 2023 as an aspiring Data Engineer these would be them in a specific order:

Read on in the Thread ๐Ÿ‘‡

--------

Follow me and hit ๐Ÿ”” to ๐—Ÿ๐—ฒ๐˜ƒ๐—ฒ๐—น ๐—จ๐—ฝ in #MLOps, #MachineLearning, #DataEngineering, #DataScience and overall #Data space! Image
1๏ธโƒฃ โ€๐—™๐˜‚๐—ป๐—ฑ๐—ฎ๐—บ๐—ฒ๐—ป๐˜๐—ฎ๐—น๐˜€ ๐—ผ๐—ณ ๐——๐—ฎ๐˜๐—ฎ ๐—˜๐—ป๐—ด๐—ถ๐—ป๐—ฒ๐—ฒ๐—ฟ๐—ถ๐—ป๐—ดโ€ - A book that I wish I had 5 years ago. After reading it you will understand the entire Data Engineering workflow. It will prepare you for further deep dives.

๐Ÿ‘‡
2๏ธโƒฃ โ€๐—”๐—ฐ๐—ฐ๐—ฒ๐—น๐—ฒ๐—ฟ๐—ฎ๐˜๐—ฒโ€ - Data Engineers should follow the same practices that Software Engineers do and more. After reading this book you will understand DevOps practices in and out.

๐Ÿ‘‡
Read 9 tweets
Dec 22
What is a ๐—™๐—ฒ๐—ฎ๐˜๐˜‚๐—ฟ๐—ฒ ๐—ฆ๐˜๐—ผ๐—ฟ๐—ฒ and why is it such an important element in ๐— ๐—Ÿ๐—ข๐—ฝ๐˜€ ๐—ฆ๐˜๐—ฎ๐—ฐ๐—ธ?

Find out in the Thread ๐Ÿ‘‡

--------

๐—™๐—ผ๐—น๐—น๐—ผ๐˜„ ๐—บ๐—ฒ and hit ๐Ÿ”” to ๐—Ÿ๐—ฒ๐˜ƒ๐—ฒ๐—น ๐—จ๐—ฝ in #MLOps, #MachineLearning, #DataEngineering, #DataScience and overall #Data space! Image
Feature Store System sits between Data Engineering and Machine Learning Pipelines and it solves the following issues:

โžก๏ธ Eliminates Training/Serving skew by syncing Batch and Online Serving Storages (5)

๐Ÿ‘‡
โžก๏ธ Enables Feature Sharing and Discoverability through the Metadata Layer - you define the Feature Transformations once, enable discoverability through the Feature Catalog and then serve Feature Sets for training and inference purposes trough unified interface (4๏ธ,3).

๐Ÿ‘‡
Read 15 tweets
Dec 21
What does good Model Tracking System look like?

Find out in the Thread ๐Ÿ‘‡

--------

๐—™๐—ผ๐—น๐—น๐—ผ๐˜„ ๐—บ๐—ฒ and hit ๐Ÿ”” to ๐—Ÿ๐—ฒ๐˜ƒ๐—ฒ๐—น ๐—จ๐—ฝ in #MLOps, #MachineLearning, #DataEngineering, #DataScience and overall #Data space! Image
It should be composed of two integrated parts: Experiment Tracking System and a Model Registry.

From where you track ML Pipeline metadata will depend on MLOps maturity in your company.

If you are at the beginning of the ML journey you might be:

๐Ÿ‘‡
1๏ธโƒฃ Training and Serving your Models from experimentation environment - you run ML Pipelines inside of your Notebook and do that manually at each retraining.

If you are beyond Notebooks you will be running ML Pipelines from CI/CD Pipelines and on Orchestrator triggers.

๐Ÿ‘‡
Read 14 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(