https://github.com/ramsailopal/yottadb-apicache
A demonstration of using YottaDB as an API cache in a similar way to the way Redis is used
https://github.com/ramsailopal/yottadb-apicache
api cache-storage intersystems-cache intersystems-iris javascript mumps nodejs yottadb
Last synced: 23 days ago
JSON representation
A demonstration of using YottaDB as an API cache in a similar way to the way Redis is used
- Host: GitHub
- URL: https://github.com/ramsailopal/yottadb-apicache
- Owner: RamSailopal
- Created: 2022-03-24T15:02:52.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-24T21:15:28.000Z (about 4 years ago)
- Last Synced: 2024-12-29T10:26:49.689Z (over 1 year ago)
- Topics: api, cache-storage, intersystems-cache, intersystems-iris, javascript, mumps, nodejs, yottadb
- Language: JavaScript
- Homepage:
- Size: 3.63 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YottaDB-APICache

A demonstration of using YottaDB as an API cache in a similar way to the way Redis is used
Redis in an in memory key value data store, where as YottaDB is an on disk key value store. The speed of RAM against disk, would therefore make Redis more performant but the native speed of YottaDB, and the lower cost of disk space would make YottaDB beneficial none the less
Three external endpoints are used of for testing with varying payloads:
https://www.reddit.com/r/Wallstreetbets/top.json?limit=10000&t=year - 10000 records
https://jsonplaceholder.typicode.com/photos - 5000 records
https://jsonplaceholder.typicode.com/comments - 500 records
# Gitpod
[](https://gitpod.io/#https://github.com/RamSailopal/YottaDB-APICache)
Get a free gitpod account at https://gitpod.io and then click on the Gitpod button above to provision in Gitpod
# On Prem with docker-compose
git clone https://github.com/RamSailopal/YottaDB-APICache.git
cd YottaDB-APICache/Docker
docker-compose up
# Testing with Postman
You can attain a web based version of Postman from here:
https://go.postman.co
The following endpoints will first call the external api's (referenced above) and create a cache within YottaDB. All subsequent calls will use the cache up until a period a 30 seconds when the cache is cleared.
http://dockerserveraddress:4000/photos or https://4000-gitpodserveraddress/photos
http://dockerserveraddress:4000/comments or https://4000-gitpodserveraddress/comments
http://dockerserveraddress:4000/reddit or https://4000-gitpodserveraddress/reddit
The M routine **yottacache** - https://raw.githubusercontent.com/RamSailopal/YottaDB-APICache/main/yottadb/yottacache.m is used to create and clear the cache and **Rob Tweed's** **mg-dbx** used to write and read from YottaDB as well as calling the yottacache M functions
# References
**mg-dbx** - https://www.npmjs.com/package/mg-dbx