"I want to try it" 🚀 YugabyteDB at KubeCon
As a Developer Advocate, staying at the Yugabyte booth at KubeCon Europe 2022 was fun with great discussions arounddistributed SQL databases with awesome people. And so many "I want to try it" reactions! The simplest is a docker container on your laptop:
docker network create-d bridge ybdocker run-d--name yb0--hostname yb0--net=yb-p5433:5433-p7000:7000 yugabytedb/yugabyte:latest yugabyted start--daemon=false--listen yb0.yb--tserver_flags="ysql_enable_auth=false"
That's all. It may take a few minutes to download the image if not already done.yugabyted
creates and starts the cluster. You can connect to it with whatever you use for PostgreSQL - tools, applications, frameworks... you use the same drivers, and you get the same behavior. Why not a simple:
dockerexec-it yb0 bash-c"PGPASSWORD=yugabyte ysqlsh -P pager=off -h yb0 -p 5433 -U yugabyte yugabyte"
This startsysqlsh
in the container. It is the same aspsql
: you quit it with\q
. You can also connect any PostgreSQL application to your localhost port 5433.
From this command line, you create your users, your database, your schema... just as you do in PostgreSQL. This is sufficient to testpostgres compatibility. If you find something not compatible, please checkGitHub issues or open one.YSQL is the name of the PostgreSQL API which re-uses the postgres code for the best compatibility.
With this container, you have the features of PostgreSQL, but with a different storage layer: no vacuum issues, no bloat, no XID wraparound... But you want more, right?
You want to scale-out:
docker run-d--name yb1--hostname yb1--net=yb-p5434:5433 yugabytedb/yugabyte:latest yugabyted start--daemon=false--listen yb1.yb--tserver_flags="ysql_enable_auth=false"--join yb0 docker run-d--name yb2--hostname yb2--net=yb-p5435:5433 yugabytedb/yugabyte:latest yugabyted start--daemon=false--listen yb2.yb--tserver_flags="ysql_enable_auth=false"--join yb0
With those two additional containers joining the cluster, you can play with high availability. The data you have created is balanced and replicated over the three nodes. And you can connect to any node. To scale connections, data processing and storage, just add more nodes.
You have exposed port 7000 on the first container so you can check the control plane inhttp://localhost:7000 - see your cluster status, the tablet server nodes, the tables split into tablets... and claim your free T-Shirt 👕 to match with the sunglasses you got in KubeCon Valencia !
Now that you know how to scale out, just with the--join
option ofyugabyted
, you can build your docker-compose file. For example, to replace PostgreSQL in a Docker Compose used for tests, I use the same variables as the PostgreSQL image - examplehere. Andyugabyted
is convenient for quick start, but you can have more control by starting all components like I do when I demo high availability and elasticity:https://github.com/FranckPachot/ybdemo/tree/main/docker/yb-lab
To claim your free T-Shirt, you joined ourSlack. Please say hello in#introduction channel and if we've met at KubeCon or elsewhere please mention it. We had great discussions at the booth. Our dream team was so happy to be there and meet you
https://twitter.com/Yugabyte/status/1527220029594513411?s=20&t=z8EPnfJP51FXVXwqr8-YFQ
When you are done, you can remove the docker containers with:
docker container rm -f yb0docker container rm -f yb1docker container rm -f yb2docker network rm yb
Top comments(0)
For further actions, you may consider blocking this person and/orreporting abuse