DEV Community

Franck Pachot for YugabyteDB

Posted on • Updated on

Gitpod with YugabyteDB image

This is a small doc from a PR I submitted to Gitpod's how-to guides but they prefer to have only a few databases in this guide (PostgreSQL, MySQL, Redis, MongoDB). No problem, I'll post this doc here.


If your project uses PostgreSQL, you can test it on YugabyteDB (Open Source PostgreSQL-compatible Distributed SQL database) with the dedicated YugabyteDB image. Simply base your .gitpod.dockerfile on:

FROM gitpod/workspace-yugabytedb
Enter fullscreen mode Exit fullscreen mode

and call ysqlsh instead of psql.

For the application, you connect to port 5433 instead of 5432.

This image starts a single-node YugabyteDB server, and you can use the ysqlsh CLI like you would do with psql:

$ ysqlsh

ysqlsh (11.2-YB-
Type "help" for help.

yugabyte=# select * from yb_servers();

   host    | port | num_connections | node_type | cloud  |   region    | zone  | public_ip 
-----------+------+-----------------+-----------+--------+-------------+-------+----------- | 5433 |               0 | primary   | cloud1 | datacenter1 | rack1 |
(1 row)

Enter fullscreen mode Exit fullscreen mode


I used this for a previous blog post to test Mastodon with YugabyteDB instead of PostgreSQL. You can test it:
Open in Gitpod
Image description


If you want to play with a multi-node, as you need multiple network interfaces, it is better not to use this image but start YugabyteDB nodes in docker, as I do in my ybdemo:

Open in Gitpod

Image description

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git