mykola
mykola

Reputation: 1808

Long-running read transactions (reports) in Tarantool DB

AFAIK, Tarantool DB works in one thread. But it has MVCC. But as I understood from this description: https://www.tarantool.io/ru/doc/latest/platform/atomic/txn_mode_mvcc/ -- it looks like it still works in a single-thread mode when MVCC is on. The only thing it does is it allows to call fiber.yield() to give control to another fiber.

So, the question is how should I work with long-running read transactions? For example some analytical report. Do I need to manually call yields (fiber.yield()) inside this transaction to make other transactions work? Or maybe there is a way to run such transactions in parallel?

Upvotes: 0

Views: 19

Answers (1)

Alexander Turenko
Alexander Turenko

Reputation: 470

In my understanding MVCC's primary use case is to use interactive transactions over iproto. I don't know about a cost of a really long living transaction, but (as far as I understand) MVCC is not designed for analytical queries. It is for OLTP workloads.

Tarantool Enterprise Edition offers user read views that has a C API that can be used from a separate thread. It is for analytics.

For Tarantool Community Edition I would suggest to join an anonymous replica to perform analytic queries. This way it doesn't affect the primary (OLTP) workload. However, it costs the memory.

Upvotes: 1

Related Questions