The NOVA Protocol (NVP) is a binary, framed, multiplexed application-layer protocol designed to run over TCP (default port: 7400).
+------------+-------------+------------+-------+----------------+----------------+-----------------+----------+
| MAGIC | VERSION | FRAME_TYPE | FLAGS | REQUEST_ID | PAYLOAD_LENGTH | PAYLOAD | CHECKSUM |
| 4 Bytes | 2 Bytes | 1 Byte | 1 B | 8 Bytes | 4 Bytes | N Bytes | 4 Bytes |
+------------+-------------+------------+-------+----------------+----------------+-----------------+----------+
- MAGIC:
[0x4E, 0x56, 0x50, 0x31]("NVP1"). - VERSION:
u16Big Endian (1). - FRAME_TYPE:
u8indicating frame category:0x01:Request(Query / Command from client to server)0x02:Response(Result payload from server to client)0x03:Event(LiveDataEventpushed to WATCH subscribers)0x04:Error(Structured error notification)0x05:Ping(Heartbeat check)0x06:Pong(Heartbeat response)
- FLAGS:
u8reserved for compression and encryption flags. - REQUEST_ID:
u64Big Endian identifier used to multiplex concurrent requests over a single TCP stream. - PAYLOAD_LENGTH:
u32Big Endian length of the payload in bytes (Max: 16 MB). - PAYLOAD: Serialized JSON or binary payload.
- CHECKSUM:
u32IEEE CRC32 over Header + Payload.
- Client generates monotonic
request_id. - Encodes
RequestPayload::Query { nql }into an NVP frame and writes to TCP socket. - Server receives and decodes frame, computes CRC32, parses NQL, executes against storage engine.
- Server replies with
NvpFramewith typeResponseusing matchingrequest_id.
- Client sends
RequestPayload::Watch { nql: "WATCH users WHERE age > 21" }withrequest_id = 42. - Server registers subscription and returns
ResponsePayload::WatchAck { subscription_id: 42 }. - Whenever mutations occur that match the predicate, server pushes frames with
frame_type = Eventandrequest_id = 42. - The client dispatches events directly to the corresponding
EventStream.