Skip to content

v4#56

Open
goodwise wants to merge 12 commits intotarantool:masterfrom
goodwise:master
Open

v4#56
goodwise wants to merge 12 commits intotarantool:masterfrom
goodwise:master

Conversation

@goodwise
Copy link
Contributor

4.0.0

BREAKING

  • nonWritableHostPolicy is deprecated and no more supported due to the overhead, low-frequency usability and complexity. Finally, it may be better to handle the connection's 'close' errors by developer and reconnect.
  • For a syntax clearance and new features you should pass parameters of eval and call methods as an array, e.g.:
    tarantool.eval('return ...', [a, b])
    instead of the previous:
    tarantool.eval('return ...', a, b)
  • Dropping support for old Node.JS versions:
    now this module is guaranteed to work on a Maintenance, Active and Current versions in order to introduce new features and stability.
  • selectCb() method is deprecated. This (.select()) and all other commands now can be invoked in a callback style (but then/catch-style is also supported, just don't specify the cb parameter and the function will return a Promise):
    tarantool.select(
        spaceId, 
        indexId, 
        limit, 
        offset, 
        iterator, 
        key, 
        opts, 
        (error, success) => { 
            // process the result as usual
        }
    )

Bug fixes

  • Fixed bug of a buffer reuse approach
  • Fixed use of keepAlive and noDelay
  • Fixed use of Transactions if connection is not inited yet
  • Fixed memory leak of 'connect' / 'close' events (appeared during many reconnects)

Improvements

  • Optimized offline queue
  • New option tupleToObject, which allows you to receive an array of objects instead of array of arrays:
    • Keys are similar to the Tarantool space's key names, and value is a corresponding value from the tuple
    • Note that there is an extra overhead of converting array to object
    • This option is usable only for the following request types: select, update, delete, insert, replace
  • Introduced 2 custom error classes, which are exported on the connector class. They are useful for a better development experience when you can handle errors more properly:
    • ReplyError: errors created by the Tarantool server in a similar format
    • TarantoolError: general errors thrown by the driver
  • New option commandTimeout to define the max execution time of the sent request. Can be configured on the class globally or per each command
  • packDecimal() function now also accepts BigInt
  • Improved performance of the built-in MsgPack extensions (used in a packDecimal(), packUuid(), etc)
  • Improved compression of the 'update' / 'upsert' operations by converting a string field names to their corresponding ID's
  • New iterators: OVERLAPS and NEIGHBOR
  • Extended tests (with help of a native node:test and node:assert)
  • Updated benchmarks, README, eslint config
  • New guides
  • Even better performance
  • New .quit() method - awaits for the sent commands to become fullfilled before the connection closes
  • Pipeline response is now an instance of PipelineResponse with 2 additional methods: findPipelineError() and findPipelineErrors()

- Now supports [prepared](https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_sql/prepare/#box-sql-box-prepare) SQL statements.
- Huge rewrite of the codebase, which improved performance by N%:
    - Now using 'msgpackr' instead of 'msgpack-lite'
    - Buffer reuse
    - Decreased memory consumption
- New AutoPipelining mode: send a batch of commands periodically with no need to rewrite your existing code. Benchmark showed x3 performance for the Select requests: 
    - 330k/sec without AutoPipelining
    - 1100k/sec with AutoPipelining period set to ~10ms
- [IPROTO_ID](https://www.tarantool.io/en/doc/latest/reference/internals/iproto/requests/#iproto-id) can be invoked as 'conn.id()' function.
- [Streams](https://www.tarantool.io/en/doc/latest/platform/atomic/txn_mode_mvcc/#streams-and-interactive-transactions) support.
### <b>BREAKING</b>
- `nonWritableHostPolicy` is deprecated and no more supported due to the overhead, low-frequency usability and complexity. Finally, it may be better to handle the connection's 'close' errors by developer and reconnect.
- For a syntax clearance and new features you should pass parameters of `eval` and `call` methods as an array, e.g.:
    ```javascript 
    tarantool.eval('return ...', [a, b])
    ``` 
    instead of the previous:
    ```javascript 
    tarantool.eval('return ...', a, b)
    ```
- Dropping support for old Node.JS versions:
    now this module is guaranteed to work on a `Maintenance`, `Active` and `Current` [versions](https://nodejs.org/en/about/previous-releases#release-schedule) in order to introduce new features and stability.
- `selectCb()` method is deprecated. This (`.select()`) and all other commands now can be invoked in a callback style (but `then/catch`-style is also supported, just don't specify the `cb` parameter and the function will return a Promise):
    ```javascript
    tarantool.select(
        spaceId, 
        indexId, 
        limit, 
        offset, 
        iterator, 
        key, 
        opts, 
        (error, success) => { 
            // process the result as usual
        }
    )
    ```

### Bug fixes
- Fixed bug of a buffer reuse approach
- Fixed use of keepAlive and noDelay
- Fixed use of Transactions if connection is not inited yet
- Fixed memory leak of 'connect' / 'close' events (appeared during many reconnects)

### Improvements
- Optimized offline queue
- New option `tupleToObject`, which allows you to receive an array of objects instead of array of arrays: 
    - Keys are similar to the Tarantool space's key names, and value is a corresponding value from the tuple
    - Note that there is an extra overhead of converting array to object
    - This option is usable only for the following request types: `select`, `update`, `delete`, `insert`, `replace`
- Introduced 2 custom error classes, which are exported on the connector class. They are useful for a better development experience when you can handle errors more properly:
    - ReplyError: errors created by the Tarantool server in a similar [format](https://www.tarantool.io/ru/doc/latest/reference/internals/msgpack_extensions/#the-error-type)
    - TarantoolError: general errors thrown by the driver
- New option `commandTimeout` to define the max execution time of the sent request. Can be configured on the class globally or per each command
- `packDecimal()` function now also accepts BigInt
- Improved performance of the built-in MsgPack extensions (used in a `packDecimal()`, `packUuid()`, etc)
- Improved compression of the 'update' / 'upsert' operations by converting a string field names to their corresponding ID's
- New iterators: OVERLAPS and NEIGHBOR
- Extended tests (with help of a native `node:test` and `node:assert`) 
- Updated benchmarks, README, eslint config 
- New guides
- Even better performance
- New `.quit()` method - awaits for the sent commands to become fullfilled before the connection closes
- Pipeline response is now an instance of `PipelineResponse` with 2 additional methods: `findPipelineError()` and `findPipelineErrors()`
Fix tests
Fix support for NodeJS v20
@sergos sergos requested a review from usenko-timur February 14, 2026 20:26
@oleg-jukovec
Copy link

oleg-jukovec commented Feb 25, 2026

Thank you for the patch! Please, split the PR into individual parts with different functionality. As example, you could create a separate PR for a separate bug, than an another one, and another one...

In its current form, PR is difficult to review and it can take too much time without any progress.

See:

https://github.com/tarantool/tarantool/wiki/Code-review-procedure?ysclid=mm1tddvaqi260159427#commit-message
https://www.tarantool.io/en/doc/latest/contributing/developer_guidelines/#how-to-write-a-commit-message

@oleg-jukovec oleg-jukovec self-requested a review February 25, 2026 09:14
@goodwise
Copy link
Contributor Author

You're partly right, but there were some reasons for that.

First, this was development for internal needs. It wasn't considered necessary to publish every update to you.
Second, any change triggered a domino effect. The old methods were very difficult to change.
For example, to add a new property, opts to .eval() we had to change the query itself. But these changes broke the tests. The tests were written using a module that was deprecated 10 years ago. Therefore, we had to change the tests (using the native module) at the same time.

Overall, the functionality is compatible (except for call and eval as noted above) with previous versions of the connector, as confirmed by the tests.
Feel free to contact me if you need any assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants