type field that identifies the operation to perform. Nexus Core supports nine request types, each with a defined MongoDB operation and cache behavior. Understanding these types helps you choose the right one for each use case and reason about performance and consistency trade-offs.
All Request Types
RANKING and RANK_FINDER bypass the cache entirely to guarantee a consistent global view of sorted data. BROADCAST has no MongoDB operation — it only routes a payload to another server’s Redis channel.Common Request Types in Detail
GET_DATA
Retrieves a single document by itsisId field value. Nexus Core checks the Redis L2 cache first. On a cache miss, it queries MongoDB and writes the result back to both cache layers before returning.
Example data payload:
SET_DATA
Inserts a new document or replaces an existing one usingreplaceOne with upsert. The updated document is written through to both Redis and the L1 in-memory cache.
Example data payload:
REMOVE_DATA
Deletes a document by its ID and invalidates the corresponding Redis and L1 cache entries. Exampledata payload:
INCREMENT_DATA
Atomically increments a numeric field (int, long, or double) without requiring a full SET_DATA round trip. Nexus Core reads the document, applies the mutation in memory, and writes the result back through the cache.
Example data payload:
Related Topics
- Request Lifecycle — how each type flows through validation, routing, and cache
- Packet Structure — the full JSON format for incoming and outgoing packets
- Cache Strategy — read-through, write-through, and invalidation behaviors