Skip to content

Redislabs-Solution-Architects/document-lookaside

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of Redis Lookaside Cache with MongoDB

Summary

API server and client implementation of an application using MongoDB for document storage and Redis for lookaside caching.

Architecture

High Level

High-level Architecture

Detailed

Detailed Architecture

Features

  • Implements a simple conjunctive search on MongoDB and Redis.
  • Utilizes RedisJSON for document storage and RediSearch for indexing.
  • Though not designed to be a benchmarking app, it does keep track of fetch latencies associated with cache hits and misses.

Prerequisites

  • Docker
  • Python

Installation

  1. Clone this repo.
  2. Go to document-lookaside folder.
cd document-lookaside
  1. Build and start docker containers
docker compose up

Usage

Test Client

python3 ./tests/test.py

CURL

curl http://localhost:8000/cancellations/airports/ATL/2003/6
{"result":216}

curl http://localhost:8000/metrics
{"cache_hits":86,"cache_misses":915,"ave_cache_latency":0.309,"ave_db_latency":0.77}

Releases

No releases published

Packages

No packages published