The developers of the SQLite Testing experimental bacanda HCTREE , which supports the blocking at the level of the strings (ROW) and provides a high level of parallelization during requests. The new backend is aimed at increasing the efficiency of using SQLite in customer server systems, in which you have to process a large number of simultaneous requests for the database for recording.
B-Tree structures originally used in SQLite for data storage are not designed for a similar type of load, which limits SQLite with the ability to record only one stream. As an experiment, the developers began to develop an alternative solution that uses HC-TREE to store the structure, more suitable for parallelization of recording operations.
To organize the simultaneous performing of several operations in HCTREE records, a transaction separation mechanism uses that uses blocking at the level of pages and similar to mvcccc (multi -versionary management of competitive access), but using transactions based on keys and ranges of keys instead of pages sets. Reading and recording operations are carried out in binding to the Snapshot of the database, the change of which becomes visible in the main database only after the transaction is completed.
Clients can use three transaction opening operations:
- “Begin” – transactions do not take into account data on the access of other customers. If the transaction transaction is performed, the transaction can be recorded only if there were no other recording operations in the database during its completion.
- “Begin Concurrent” – transactions collect information about the access of other customers. If the transaction transaction is performed, the transaction can be recorded if other transactions have been recorded from the moment of creating the snapshot in the database.
- “Begin Exclusive” – after the opening of the transaction, it blocks operations from other transactions until its completion.
HCTREE maintains replication in the style of “Master-SLAVE”, which allows to transfer transactions to another database and maintain secondary databases in a state synchronized with the main database. HCTREE also removes the limit on the size of the database – instead of 32 -bit identifiers of the pages of data in HCTRe, 48 discharge are used, which increases the maximum base size from 16 tebibeits to 1 ecbeite (million Tebibait). It is expected that performance sqlite with HCTRee velines will not be lower than the classic single -flow backend.
SQLite customers with HCTRee support will be able to contact both a database of HC-Tree structure and the old SQLite database.