Binary Protocol
High-performance binary protocol with MessagePack encoding.
13.2x
Faster reads
4.4x
Faster queries
3.7x
Faster writes
Why Binary Protocol?
Persistent Connections
Unlike HTTP which creates a new connection for each request, binary protocol maintains a persistent TCP connection, eliminating handshake overhead.
MessagePack Encoding
Data is serialized using MessagePack, a binary format that's more compact and faster to parse than JSON.
Lower Latency
Binary protocol has median latency of 0.05ms compared to 0.66ms for HTTP/REST.
Usage with Official Clients
The binary protocol is automatically used when you install our official client libraries. No configuration needed!
JavaScript
const NexaClient = require('nexaclient');
const db = new NexaClient({
host: 'localhost',
port: 6970, // Binary protocol port
username: 'root',
password: 'nexadb123'
});
await db.connect();
// All operations use binary protocol
const user = await db.create('users', {
name: 'Alice',
email: 'alice@example.com'
});Python
from nexaclient import NexaClient
with NexaClient(
host='localhost',
port=6970, # Binary protocol port
username='root',
password='nexadb123'
) as db:
# All operations use binary protocol
user = db.create('users', {
'name': 'Alice',
'email': 'alice@example.com'
})Benchmark Results
Based on 100,000 operations comparing Binary Protocol vs HTTP/REST:
- →READ: 13.2x faster (0.05ms vs 0.66ms)
- →QUERY: 4.4x faster
- →CREATE: 3.7x faster