Skip to content

Commit

Permalink
presentation notes
Browse files Browse the repository at this point in the history
  • Loading branch information
CAJan93 committed May 14, 2024
1 parent 483c749 commit ee58f99
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions presentation_london/presentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ show databases;
use dev;
show tables;
select * from tweet limit 10;

# back to TiDB
show tables;
# show that
```
- This is the big streaming demo
Expand Down Expand Up @@ -66,6 +70,7 @@ select * from tweet limit 10;
```sh
# start the setup
cd /Users/janmensch/Documents/github/risingwave; git checkout cajan93/presentation-london-tidb
docker compose -f presentation_london/docker-compose-debezium.yml up
# We have a mysql source, a debezium connector, and a kafka to transport the change events
Expand All @@ -75,6 +80,50 @@ CONTAINER ID IMAGE COMMAND
a0732e1a8894 quay.io/debezium/kafka:latest "/docker-entrypoint.…" 11 seconds ago Up 10 seconds 0.0.0.0:9093->9092/tcp presentation_london-kafka-1
8e2a49cb75b0 quay.io/debezium/zookeeper:latest "/docker-entrypoint.…" 11 seconds ago Up 10 seconds 0.0.0.0:2888->2888/tcp, 0.0.0.0:3888->3888/tcp, 0.0.0.0:2182->2181/tcp presentation_london-zookeeper-1
af3a840a46b4 quay.io/debezium/example-mysql:latest "docker-entrypoint.s…" 11 seconds ago Up 10 seconds 0.0.0.0:3306->3306/tcp, 33060/tcp presentation_london-mysql-1
mysql -h localhost --protocol=TCP -u root -P 3306 -p
# debezium
show databases;
use inventory;
show tables;
select * from customers;
show binary logs;
# let's really see the files
docker exec -it presentation_london-mysql-1 sh
cd /var/lib/mysql
ls
# show binary logs
cat mysql-bin.index
head mysql-bin.000002
# indeed bin logs
# insert data
insert into customers (first_name, last_name, email) values ("evil", "eve", "[email protected]");
show binary logs;
delete from customers where last_name = "eve";
show binary logs; # More or less data in binlog?
insert into customers (first_name, last_name, email) values ("evil", "eve", "[email protected]");
update customers set first_name = "good" where last_name = "eve";
# view the log
docker cp presentation_london-mysql-1:/var/lib/mysql/mysql-bin.000003 ~/Downloads/binlog
mysqlbinlog ~/Downloads/binlog --base64-output=decode-rows --verbose -v
# start CDC
curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" localhost:8083/connectors/ -d '{ "name": "inventory-connector", "config": { "connector.class": "io.debezium.connector.mysql.MySqlConnector", "tasks.max": "1", "database.hostname": "mysql", "database.port": "3306", "database.user": "debezium", "database.password": "dbz", "database.server.id": "184054", "topic.prefix": "dbserver1", "database.include.list": "inventory", "schema.history.internal.kafka.bootstrap.servers": "kafka:9092", "schema.history.internal.kafka.topic": "schemahistory.inventory" } }'
docker exec presentation_london-kafka-1 /kafka/bin/kafka-console-consumer.sh --bootstrap-server kafka:9092 --from-beginning --topic dbserver1.inventory.customers | grep good
echo ... | jq .payload
# Why does this look like an initial write? Snapshotting
update customers set first_name = "good and very smart" where last_name = "eve";
echo ... | jq .payload
# now you also have an update event
```
- Lets have a look at the actual the logs which we mentioned earlier
Expand Down

0 comments on commit ee58f99

Please sign in to comment.