Every packet sent to Nexus Core includes a 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 its isId 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 using replaceOne 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.
Example data 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: