odyssey/README.md

72 lines
2.6 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:57:36 +00:00
Odissey can significantly scale processing performance by
2017-07-14 12:05:09 +00:00
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:57:36 +00:00
Odissey allows to define connection pools as a pair of `Database name` and `User`.
2017-07-14 12:05:09 +00:00
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.
2017-07-14 13:12:46 +00:00
**Logging**
Odissey generates universally unique identifiers `uuid` for client and server connections.
Any log events and client error responces include the id, which then can be used to
2017-07-14 13:17:03 +00:00
uniquely identify client and track actions. Odissey can save log events into log file and
using system logger.
2017-07-14 13:12:46 +00:00
2017-07-14 12:05:09 +00:00
**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-17 12:26:45 +00:00
callback approach.
One of the main goal was to make code base understandable for new developers and
2017-07-17 12:23:05 +00:00
to make an architecture easily extensible for future development.
2017-07-14 12:05:09 +00:00
2017-07-17 12:26:45 +00:00
More detailed information: [architecture and internals](INTERNALS.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
```