A city mobile app needs to look up session tokens quickly using only a session id. Which NoSQL type fits this access pattern best?
Select an answer to reveal the explanation.
Short Explanation
Session tokens are basically "give me the value for this key"—nothing fancy. Key-value stores are built for that lightning lookup. Do not haul out a graph engine just to fetch a login token.
Full Explanation
Session token lookup by session id is a classic key-value access pattern: given one key, return the associated value quickly with minimal join or traversal logic. A key-value NoSQL store keyed by session id therefore fits a city mobile app’s hot authentication path. Graph databases optimized for multi-hop fraud rings solve relationship exploration, not simple id-to-token retrieval, and add unnecessary traversal cost on every login. Columnar warehouses aimed at quarterly budget rollups are analytical systems with latency and model characteristics wrong for interactive session checks. Document stores that require full-collection scans for every login violate the point of keyed access; even a document store should retrieve by id, and designing for scans would collapse under concurrent mobile traffic. Exam caveat: pick the NoSQL family from the dominant access pattern—KV for simple keyed gets, document for nested entities, graph for edges, wide-column for sparse time series. Operational check: load-test session gets by id against the KV tier, confirm sub-millisecond to low-millisecond latency at peak, and ensure expired sessions are removed by TTL rather than table scans. In production terms for key-value session token lookups, assign an owning team, wire a dashboard that shows the pattern is healthy under peak civic load, and require a staging drill that rehearses failure and recovery before resident impact. Revisit the choice when traffic shape, retention, or integrity needs change, and keep a named rollback owner on the change record. Re-test both the happy path and the failure path for key-value session token lookups after material dependency upgrades so regressions are caught before the next public release.