Coder Social home page Coder Social logo

strogo / odyssey Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yandex/odyssey

0.0 2.0 0.0 15.79 MB

Scalable PostgreSQL connection pooler

License: BSD 3-Clause "New" or "Revised" License

CMake 3.90% Shell 2.55% Makefile 0.47% C 90.09% Dockerfile 0.64% Perl 0.05% Go 2.29%

odyssey's Introduction



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.

Coverity Scan Build Status

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

odyssey's People

Contributors

dimastark avatar dsarafan avatar efimkin avatar einkrebs avatar elsid avatar erthalion avatar firm avatar fumiyukikato avatar g0djan avatar gms80 avatar heckad avatar holyprapor avatar lowgear avatar mialinx avatar mkabilov avatar mo4islona avatar mrechte avatar munakoiso avatar paralax avatar pmwkaa avatar quanzl avatar rechtem avatar reshke avatar ruimarinho avatar sklochkov avatar tbroadley avatar thedrow avatar usernamedt avatar vampouille avatar x4m avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.