Discover Packages
github.com/lonng/tidb-demo-leaderboard
module
Version:
v0.0.0-...-d41363a
Opens a new window with list of versions in this module.
Published: Jun 22, 2022
License: Apache-2.0
Opens a new window with license information.
README
README
¶
tidb-demo-leaderboard
Demonstrate how to use TiCDC replicate data from TiDB to Kafka
Architecture
Get Start
Install TiUP curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
Run TiDB cluster tiup -T tidb-demo-leaderboard playground --tiflash 0 --ticdc 1
Install Redis reference Redis Get Start and run redis redis-server
Install Kafka reference Kafka Quickstart
Create topic: bin/kafka-topics.sh --create --topic leaderboard --bootstrap-server localhost:9092
Create changefeed tiup cdc cli changefeed create --sink-uri="kafka://127.0.0.1:9092/leaderboard?kafka-version=2.13.0&partition-num=1&max-message-bytes=67108864&replication-factor=1&protocol=canal-json"
Create database mysql -h 127.0.0.1 -P 4000 -uroot -e "create database leaderboard";
Run application
go run ./cmd/leaderboard-service/main.go
go run ./cmd/score-consumer/main.go
Open your browser http://127.0.0.1:8080
About the game
This is just a dummy game. The goal is to show TiCDC's capabilities.
How to play?
In the game, there are 5 pictures and each picture has a unique number on its back. For each round, you will choose (by clicking the picture) the picture with a larger numer. If you choose the right one, you gain one point, otherwise, you lose one point. You can leverage your memory or try you luck. Enjoy!
Expand ▾
Collapse ▴
Directories
¶
cmd
internal
Click to show internal directories.
Click to hide internal directories.