Odyssey

可扩展的 PostgreSQL 连接池。「Scalable PostgreSQL connection pooler」

Github星跟蹤圖

Odyssey

Advanced multi-threaded PostgreSQL connection pooler and request router.

Project status

Odyssey is production-ready, it is being used in large production setups. We appreciate any kind of feedback and contribution to the project.

Design goals and main features

Multi-threaded processing

Odyssey can significantly scale processing performance by
specifying a number of additional worker threads. Each worker thread is
responsible for authentication and proxying client-to-server and server-to-client
requests. All worker threads are sharing global server connection pools.
Multi-threaded design plays important role in SSL/TLS performance.

Advanced transactional pooling

Odyssey tracks current transaction state and in case of unexpected client
disconnection can emit automatic Cancel connection and do Rollback of
abandoned transaction, before putting server connection back to
the server pool for reuse. Additionally, last server connection owner client
is remembered to reduce a need for setting up client options on each
client-to-server assignment.

Better pooling control

Odyssey allows to define connection pools as a pair of Database and User.
Each defined pool can have separate authentication, pooling mode and limits settings.

Authentication

Odyssey has full-featured SSL/TLS support and common authentication methods
like: md5 and clear text both for client and server authentication.
Odyssey supports PAM & LDAP authentication, this methods operates similarly to clear text auth except that it uses
PAM/LDAP to validate user name/password pairs. PAM optionally checks the connected remote host name or IP address.
Additionally it allows to block each pool user separately.

Logging

Odyssey generates universally unique identifiers uuid for client and server connections.
Any log events and client error responses include the id, which then can be used to
uniquely identify client and track actions. Odyssey can save log events into log file and
using system logger.

CLI

Odyssey supports multiple command line options. Use /path/to/odyssey --help to see more

Architecture and internals

Odyssey has sophisticated asynchronous multi-threaded architecture which
is driven by custom made coroutine engine: machinarium.
Main idea behind coroutine design is to make event-driven asynchronous applications to look and feel
like being written in synchronous-procedural manner instead of using traditional
callback approach.

One of the main goal was to make code base understandable for new developers and
to make an architecture easily extensible for future development.

More information: Architecture and internals.

Build instructions

Currently Odyssey runs only on Linux. Supported platforms are x86/x86_64.

To build you will need:

  • cmake >= 3.12.4
  • gcc >= 4.6
  • openssl
  • postgresql-server-dev-13
  • pg_config utility is in the PATH
git clone git://github.com/yandex/odyssey.git
cd odyssey
make local_build

Adapt odyssey-dev.conf then:

make local_run

Alternatively:

build/sources/odyssey odyssey-dev.conf

Use docker environment for development (helpful for Mac users)

make start-dev-env

Set up your CLion to build project in container, manual.

Configuration reference

Service
Logging
Performance
System
Global limits
Listen
Routing
Storage
Database and user
Architecture and Internals

主要指標

概覽
名稱與所有者yandex/odyssey
主編程語言C
編程語言CMake (語言數: 9)
平台Docker, Linux
許可證BSD 3-Clause "New" or "Revised" License
所有者活动
創建於2018-05-28 14:57:51
推送於2025-05-22 17:47:33
最后一次提交2025-05-21 10:10:43
發布數14
最新版本名稱1.4rc7 (發布於 )
第一版名稱1.0rc (發布於 )
用户参与
星數3.3k
關注者數57
派生數175
提交數2.3k
已啟用問題?
問題數193
打開的問題數119
拉請求數537
打開的拉請求數12
關閉的拉請求數77
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?