FranckPachot / yb-pglike

Builds a docker image with YugabyteDB that is compatible with the PostgreSQL image for a drop-in replacement

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yb-pglike

This builds an image with YugabyteDB (re-architected PostgreSQL to be cloud native, resilient and horizontally scalable) configured to be a drop-in replacement of the PostgreSQL docker image (same behavior, same environment variables...)

Usage

To run with it, replace the postgres image with this one.

if 'build:' works in docker compose:

For example, in docker compose, replace

    image: postgres

with:

    build: https://github.com/FranckPachot/yb-pglike.git

with pre-built image

⚠️ for some incompatibility reasons between docker and git I got this build: not working and had to build the image first and reference it as image. Here is an example:

docker build -t yb-pglike .
docker compose -f docker-compose-pgbench.yml up

with the following docker-compose-pgbench.yml:

services:
  db:
    image: yb-pglike
    environment:
      POSTGRES_DB: 'mydb'
      POSTGRES_USER: 'myuser'
      POSTGRES_PASSWORD: 'mypass'
    ports:
      - 5432:5432
      - 15433:15433
    restart: always
  app:
    image: postgres
    environment:
      PGDATABASE: 'mydb'
      PGUSER: 'myuser'
      PGPASSWORD: 'mypass'
    command: bash -xc ' pgbench -i -h db && pgbench -h db -P 5 -T 60 '
    depends_on:
      db:
        condition: service_healthy

Reason

With this single-node image, the goal is to have the same behavior as PostgreSQL. There are some advantages: YugabyteDB doesn't need VACUUM and solves many related problems (see Which PostgreSQL problems are solved with YugabyteDB). For production, simply add two additional replicas (same command with additional --join= with the fully qualified address of the first node) and it become resilient to any node failure. You can also use a managed sevice on

List of applications validated with this docker image or similar config

Here are some applications I have tested, replacing the PostgreSQL image by this YugabyteDB image. You can do the same, please let me know to add to the list.

Tested and working

  • Jira (docker compose) An agile project management tool used by teams to plan, track, release and support software
  • Confluence (docker compose) A collaborative platform used for creating, sharing, and organizing content within teams and organizations
  • Plume (docker compose) A a federated blogging engine, based on ActivityPub.
  • Commento (docker compose) A fast, bloat-free comments platform
  • Firefly III (docker compose) A personal finances manager
  • HedgeDoc (docker compose) Was CodiMD: create real-time collaborative markdown notes
  • NocoBase (docker compose) A scalability-first, open-source no-code/low-code platform to build internal tools.
  • Wiki.js (docker compose) 1 A modern and powerful wiki app built on Node.js
  • NocoDB (docker compose) 1 (Slow 2) An Open Source Alternative to Airtable
  • Umani (docker compose) A simple, fast, privacy-focused alternative to Google Analytics.
  • invidious (docker compose) An alternative front-end to YouTube
  • Kine 3 Alternative to Etcd

Tested, working, and PR submitted

Tests waiting for open issues in YugabyteDB

Footnotes

  1. set colocated to true when #17929 is fixed. 2 3 4

  2. queries on catalog are slow #7745.

  3. Application requires no gap sequences (ysql_sequence_cache_minval=1).

  4. DROP CONSTRAINT IF EXISTS fails #14566.

  5. SQLSTATE[XX000]: Internal error: 7 ERROR: timed out waiting for postgres backends to catch up #18994

  6. LOCK TABLE IN ACCESS EXCLUSIVE MODE not yet supported #15179

About

Builds a docker image with YugabyteDB that is compatible with the PostgreSQL image for a drop-in replacement

License:Apache License 2.0


Languages

Language:Shell 93.6%Language:Dockerfile 6.4%