Help us shape the future of Go! Take the 2026 Go Developer Survey

orion

module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: Apache-2.0

README

orion - PostgreSQL cluster manager

Orion Logo

Orion is a cluster manager for PostgreSQL cluster toplogies. It is cloud native because by nature (Loosely Coupled, Microservice oriented, scalable, resilient, observable, etc.). You can run Orion on Virtual Machines, and K8s environemts.

Features

  • Leverages PostgreSQL physicl and logical streaming replication.
  • Resilient to any kind of partitioning. While trying to keep the maximum availability, it prefers consistency over availability.
  • kubernetes integration letting you achieve postgreSQL high availability.
  • Uses a cluster store like etcd, consul or kubernetes API server as an high available data store and for leader election
  • Asynchronous (default) and synchronous replication.
  • Full cluster setup in minutes.
  • Easy cluster administration with the api nd cli.
  • Can do point in time recovery integrating with your preferred backup/restore tool.
  • Standby cluster (for multi site replication and near zero downtime migration).
  • Automatic service discovery and dynamic reconfiguration (handles postgres and orion processes changing their addresses).
  • Can use pg_rewind for fast instance resynchronization with current master.

Architecture

Orion is composed of the following main components

  • keeper: it manages a PostgreSQL instance converging to the clusterview computed by the leader sentinel.
  • sentinel: it discovers and monitors keepers and proxies and computes the optimal clusterview.
  • proxy: the client's access point. It enforce connections to the right PostgreSQL master and forcibly closes connections to old masters.
  • api: Manage Orion clusters with a restful API
  • cli: consume the api in an easy way

For more details and requirements see Orion Architecture and Requirements

Orion architecture

Documentation

Documentation Index

Installation

Quick start and examples

Project Status

Orion is under active development and used in different environments. Probably its on disk format (store hierarchy and key contents) will change in future to support new features. If a breaking change is needed it'll be documented in the release notes and an upgrade path will be provided.

Anyway it's quite easy to reset a cluster from scratch keeping the current master instance working and without losing any data.

Requirements

  • PostgreSQL 15, 14, 13, 12, 11, 10, 9.6

  • etcd2 >= v2.0, etcd3 >= v3.0, consul >= v0.6 or kubernetes >= 1.8 (based on the store you're going to use)

  • OS: currently orion is tested on GNU/Linux (with reports of people using it also on Solaris, *BSD and Darwin)

build

To build orion we usually test and support the latest two major versions of Go like in the Go release policy.

make

High availability

Orion tries to be resilient to any partitioning problem. The cluster view is computed by the leader sentinel and is useful to avoid data loss (one example over all avoid that old dead masters coming back are elected as the new master).

There can be tons of different partitioning cases. The primary ones are covered (and in future more will be added) by various integration tests

FAQ

See here for a list of faq. If you have additional questions please ask.

Contributing to orion

orion is an open source project under the Apache 2.0 license, and contributions are gladly welcomed! To submit your changes please open a pull request.

Contacts

  • For bugs and feature requests file an issue

Directories

Path Synopsis
api
v0
Package v0 holds the v0 api of the cluster info
Package v0 holds the v0 api of the cluster info
v1
Package v1 defines all resources for version v1
Package v1 defines all resources for version v1
cmd
Package cmd is a package which provides utilities that underlie the specific command
Package cmd is a package which provides utilities that underlie the specific command
api command
api/v1
Package cmd holds all CLI code for the keeper
Package cmd holds all CLI code for the keeper
cli command
Package main is a package that provides functionality concerning postgresSQL lifecycles
Package main is a package that provides functionality concerning postgresSQL lifecycles
cli/cmd
Package cmd is a package which provides utilities that underly the specific command
Package cmd is a package which provides utilities that underly the specific command
keeper command
Package main is a package that provides functionality concerning postgresSQL lifecycles
Package main is a package that provides functionality concerning postgresSQL lifecycles
keeper/cmd
Package cmd holds all CLI code for the keeper
Package cmd holds all CLI code for the keeper
proxy command
Package main is a package that provides functionality concerning postgresSQL lifecycles
Package main is a package that provides functionality concerning postgresSQL lifecycles
proxy/cmd
Package cmd holds all CLI code for the keeper
Package cmd holds all CLI code for the keeper
sentinel command
Package main is a package that provides functionality concerning postgresSQL lifecycles
Package main is a package that provides functionality concerning postgresSQL lifecycles
sentinel/cmd
Package cmd holds all CLI code for the keeper
Package cmd holds all CLI code for the keeper
internal
common
Package common contains some common constants and structures for orion
Package common contains some common constants and structures for orion
consensus
Package store contains all code regarding consensus stores
Package store contains all code regarding consensus stores
flagutil
Package flagutil implements all commandline flags
Package flagutil implements all commandline flags
logging
Package logging brings a generic logging interface
Package logging brings a generic logging interface
mock/consensus
Package mock_consensus is a generated GoMock package.
Package mock_consensus is a generated GoMock package.
mock/postgresql
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
postgresql
Package postgresql has all orion specific postgresql code
Package postgresql has all orion specific postgresql code
timer
Package timer is used as a generic interface for time and timing operations
Package timer is used as a generic interface for time and timing operations
util
Package util has all kind of util functions to support orion
Package util has all kind of util functions to support orion
pkg
Package main is a package that provides functionality concerning postgresSQL lifecycles
Package main is a package that provides functionality concerning postgresSQL lifecycles
tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL