DEV Community

Cover image for YBDemo: simple ๐Ÿ’ป demo lab for YugabyteDB with Java client and Docker๐Ÿš€โ˜•๐Ÿณ๐Ÿ˜
Franck Pachot for Yugabyte

Posted on

YBDemo: simple ๐Ÿ’ป demo lab for YugabyteDB with Java client and Docker๐Ÿš€โ˜•๐Ÿณ๐Ÿ˜

Here is the demo environment I use on my laptop to test YugabyteDB deployment options and operations. You find the docker-compose.yaml in https://github.com/FranckPachot/ybdemo/tree/main/docker/yb-lab

GitHub logo FranckPachot / ybdemo

Lab environment for YugabyteDB demos

๐Ÿณ The best use of this is from the docker-compose environment set in ./docker/yb-lab

YBDemo

YBDemo is a simple Java program that creates an HikariCP connection pool from the hikari.properties file in the current directory, and takes SQL statements to execute as lines from stdin. There's no multi-line statement: each line is a thread, executing the statement in a loop. The goal is to make it easy to run a demo with concurrent threads by providing the set of queries in a simple way, interactive or though file redirection. Only the first column of the first row is displayed, I use row_to_json() or json_agg() to format a larger result into one value. The thread stops if no row is returned, I use RETURNING to get a row from DML.

The goal is to run it on PostgreSQL compatible databases, especially distributed ones like YugabyteDB. The .jar includes the YugabyteDBโ€ฆ






All feedbacks and comments welcome, follow twitter, linkedin to share and learn more, and โญ are highly appreciated on the repo ๐Ÿ˜Ž

๐Ÿš€ YugabyteDB is a distributed SQL database, open source, and PostgreSQL compatible.

Discussion (0)