Code Monkey home page Code Monkey logo

yottadb-apicache's Introduction

YottaDB-APICache

Alt text

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

Open in Gitpod

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

yottadb-apicache's People

Contributors

ramsailopal avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.