jkida / debezium-poc Goto Github PK
View Code? Open in Web Editor NEWProof of Concept using Debezium for Denormalization
Proof of Concept using Debezium for Denormalization
# Start All Services - you can use -d to run as daemon docker-compose up # Configure Postgres connector - This adds the stream from PostgreSQL WAL into Kafka curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:8083/connectors/ -d @register-postgres.json # Start Kafka DB Event Consumer/Denormalizer - Simple Consumer written to denormalize the companies_view docker-compose run app python -c "from consumer import CDCConsumer; CDCConsumer().run();" # InitDB with Dummy Data - Creates the tables and inserts dummy data 30K. # Note: It doesnt insert data into the denormalized view. The consumer handles that automatically by reading the create/update events. docker-compose run --rm app python -c "from db import initdb, dummy_data; initdb(); dummy_data()" # Connect to PostgresSQL psql -h localhost -U user poc # Password: pass # You can make changes directly to the companies, people and users tables and see the denormalized table company_view_denormalized get updated. ## The query that is being denormalized SELECT companies.id, companies.name AS company_name, companies.phone AS company_phone, companies.website AS company_website, ceo.name AS ceo_name, primary_contact.name AS primary_contact_name, primary_contact.phone AS primary_contact_phone, sold_by.name AS sold_by_name, manager.name as sold_by_manager_name FROM companies LEFT JOIN people as ceo ON ceo.id = companies.ceo_id LEFT JOIN people as primary_contact ON primary_contact.id = companies.primary_contact_id LEFT JOIN users as sold_by ON companies.sold_by_id = sold_by.id LEFT JOIN users as manager ON manager.id = sold_by.manager_id # Note: To get a peek into the Debezium kafka message structure docker-compose exec kafka /kafka/bin/kafka-console-consumer.sh --bootstrap-server kafka:9092 \ --from-beginning \ --property print.key=true \ --topic dbserver1.public.companies # Stop Docker containers docker-compose stop # Destroy docker containers docker-compose down
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.