All Products
Search
Document Center

Tair (Redis® OSS-Compatible):TairDoc performance whitepaper

Last Updated:Mar 28, 2026

TairDoc is a document data structure similar to RedisJSON that fully conforms to the JSON standard. This topic describes the test environment, procedure, and results for TairDoc performance benchmarking.

TairDoc supports:

  • Full JSON standard compliance

  • JSONPath RFC draft-ietf-jsonpath-base version 04 (JSON.GET command only)

  • JSON Pointer (RFC 6901)

  • Binary tree storage for efficient child element retrieval

  • Conversion from JSON to XML or YAML format

For command details, see Doc.

How it works

TairDoc stores JSON data internally as a binary tree. This structure simplifies the retrieval of child elements, which is why child element queries and updates run significantly faster than full-document reads, as shown in the test results below.

Test environment

Database

ItemDescription
Region and zoneZone A in the China (Zhangjiakou) region
Storage typeRedis 6.0-compatible, DRAM-based
Instance version6.2.4.6
Instance architectureStandard master-replica architecture (cluster mode disabled). See Standard architecture.
Instance typeThe test results are less susceptible to instance types. In this test, the tair.rdb.4g instance type is used.

Client

ItemDescription
HostElastic Compute Service (ECS) instance, ecs.c6e.8xlarge type. See Overview of instance families.
Region and zoneZone A in the China (Zhangjiakou) region
Operating systemAlibaba Cloud Linux 3.2104 LTS 64-bit
NetworkSame virtual private cloud (VPC) as the Tair instance
SoftwarePython 3.7 or later with python-redis installed

Test data and tool

ItemDescription
Test dataupdate-center.json from GitHub, 521 KB
Test toolredis-benchmark (open source Redis)

Test procedure

Step 1: Download the test data

Log on to the ECS instance and run:

wget https://raw.githubusercontent.com/chadaustin/sajson/master/testdata/update-center.json

Step 2: Insert the test data

Save the following script as insert.py in the same directory as the downloaded test data:

import redis
import json

host = "r-bp1s02ae14mr****.redis.rds.aliyuncs.com"
port = 6379
password = "testaccount:Rp829dlwa"

r = redis.Redis(host=host, port=port, password=password)
with open("update-center.json", "r") as f:
    content = f.read()
json = json.loads(content)
ret = r.json().set("key", ".", json)
print(f"insert json to {host}, ret is {ret}")

Replace the following placeholders:

ParameterDescription
hostVPC endpoint of the Tair instance
portPort number of the Tair instance. Default: 6379
passwordCredentials in <username>:<password> format. For example, if the username is testaccount and the password is Rp829dlwa, set this to testaccount:Rp829dlwa.

Run the script:

python3 insert.py

If the data is inserted successfully, the output is:

insert json to 127.0.0.1, ret is True

Step 3: Run the benchmarks

All commands use -c 10 --threads 10 -n 10000 flags with redis-benchmark.

Query the entire JSON document

./src/redis-benchmark -h r-bp1s02ae14mr****.redis.rds.aliyuncs.com -p 6379 -a testaccount:Rp829dlwa -c 10 --threads 10 -n 10000 JSON.GET key
CPU utilizationQPSAverage latency (ms)99th percentile latency (ms)
20%569.5716.95129.279

Query a child element

./src/redis-benchmark -h r-bp1s02ae14mr****.redis.rds.aliyuncs.com -p 6379 -a testaccount:Rp829dlwa -c 10 --threads 10 -n 10000 JSON.GET key $.plugins.ant.developers[0].developerId
CPU utilizationQPSAverage latency (ms)99th percentile latency (ms)
92%205,879.940.4770.943

Modify a child element

./src/redis-benchmark -h r-bp1s02ae14mr****.redis.rds.aliyuncs.com -p 6379 -a testaccount:Rp829dlwa -c 10 --threads 10 -n 10000 JSON.SET key .plugins.ant.developers[0].developerId '"developer_foo"'
CPU utilizationQPSAverage latency (ms)99th percentile latency (ms)
95%79,865.831.2212.639

Query with a filter expression

./src/redis-benchmark -h r-bp1s02ae14mr****.redis.rds.aliyuncs.com -p 6379 -a testaccount:Rp829dlwa -c 10 --threads 10 -n 10000 JSON.GET key '$.plugins[?(@.scm=="github.com" && @.releaseTimestamp>"2013-01-01")].name'
CPU utilizationQPSAverage latency (ms)99th percentile latency (ms)
30%3,043.6832.64965.311

Summary

The results reflect TairDoc's binary tree storage model:

  • Child element queries and updates are fast (205,879.94 QPS and 79,865.83 QPS respectively) because the binary tree structure simplifies retrieval of individual nodes.

  • Full-document reads are slower (569.57 QPS) because the entire 521 KB structure must be serialized and returned.

  • Filter expression queries traverse the tree and evaluate conditions, resulting in intermediate throughput (3,043.68 QPS).

TairDoc performs well for applications that read or update specific fields within large JSON documents.