odyssey/README.md

62 lines
2.2 KiB
Markdown
Raw Normal View History

2016-11-07 09:49:42 +00:00
2017-07-14 12:05:09 +00:00
## Odissey
2016-11-08 11:01:55 +00:00
2017-07-14 12:05:09 +00:00
Advanced multi-threaded PostgreSQL connection pooler and request router.
2017-07-14 12:05:09 +00:00
### Design goals and main features
**Multi-threaded architecture**
2017-07-14 12:06:51 +00:00
2017-07-14 12:05:09 +00:00
Odissey can significantly scale its 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.
2017-07-14 12:23:08 +00:00
Multi-threaded design plays important role in `SSL/TLS` performance.
2017-07-14 12:05:09 +00:00
**Advanced transactional pooling**
2017-07-14 12:06:51 +00:00
2017-07-14 12:05:09 +00:00
Odissey 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 `Discard` and `Setting` up client options
on each client-to-server assignment.
**Better pooling control**
2017-07-14 12:06:51 +00:00
2017-07-14 12:05:09 +00:00
Odissey allows to define connection pools as a pair of `database name` and `user`.
Each defined pool can have its own authentication, pooling mode and limits settings.
**Pipelining and network optimizations**
2017-07-14 12:06:51 +00:00
2017-07-14 12:05:09 +00:00
Odissey allows to reduce network IO calls by logically buffer several
2017-07-14 12:23:08 +00:00
server replies before sending them to the client. Additionally
2017-07-14 12:05:09 +00:00
client-to-server and server-to-client buffers are zero-copy.
**Authentication**
2017-07-14 12:06:51 +00:00
2017-07-14 12:23:08 +00:00
Odissey has full-featured `SSL/TLS` support and common authentication methods
2017-07-14 12:05:09 +00:00
like: `md5` and `clear text` both for client and server authentication.
Additionally it allows to block each pool user separately.
**Internals**
2017-07-14 12:06:51 +00:00
2017-07-14 12:05:09 +00:00
Odissey has sophisticated asynchonous multi-threaded architecture which
2017-07-14 12:13:12 +00:00
is driven by custom made coroutine engine: [machinarium](https://github.yandex-team.ru/pmwkaa/machinarium).
2017-07-14 12:18:23 +00:00
Main idea behind coroutine design is to make event-driven asynchronous applications to look and feel
2017-07-14 12:23:08 +00:00
like being written in synchronous-procedural manner instead of using traditional
2017-07-14 12:05:09 +00:00
callback approach.
2017-07-14 12:13:12 +00:00
Notes on architecture and internal design: [sources/README.md](sources/README.md).
2017-07-14 12:05:09 +00:00
### Build instructions
```sh
git clone --recursive git://github.yandex-team.ru/pmwkaa/odissey.git
cd odissey
mkdir build
cd build
2017-02-07 15:58:26 +00:00
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```