This project contains a simple distributed cache as a way to experiment with FastAPI. FastAPI is a new Flask like framework, it brings some advantages like having automatic documentation using Swagger or ReDocs. Also, with FastAPI, we will be using typing to ensure the code has some compile time checks.
Steps to play:
- Run the appication by
sh ./run_server.sh
- Access
http://localhost:8000/docs
and add a remotehttp://localhost:8001/pets
- Access
http://localhost:8001/docs
and add a new Pet - Go back to
http://localhost:8000/docs
and execute theSync/Execute
request to fetch the pet added on the other application - Profit
- Show cache.py - we use an OrderedDict to keep track of the recent added items
- Show distributed.py - using the recent added items, we sync between caches