DEV Community

Ajit Singh
Ajit Singh

Posted on

Caching for performance with Amazon DocumentDB and Amazon ElastiCache

Overview of My Submission

I move the AWS sample app from using two databases to a single database. Earlier they were using Elasticache for cacheing and DynamoDb for data persistence bu adding Redis as the primary DB I have removed one file of code and made it super simple to read and manage.

Image description

Image description

Submission Category:

Minimalism Magicians

Language Used

Node.js

Link to Code

GitHub logo ajitsinghkaler / amazon-documentdb-and-amazon-elacticache-caching-for-performance-example

Caching for performance with Amazon DocumentDB and Amazon ElastiCache

Caching for performance with Amazon DocumentDB and Amazon ElastiCache

I move the AWS sample app from using two databases to a single database. Earlier they were using Elasticache for cacheing and DynamoDb for data persistence bu adding Redis as the primary DB I have removed one file of code and made it super simple to read and manage.

Screenshot from 2022-08-28 17-59-07 Screenshot from 2022-08-28 17-58-41

How it works

It saves songs to redis database on the /cd endpoint. Using the createEntity and save function

It can also search songs from the database on the /cd/:title endpoint. USing redis search, where and equal function.

How the data is stored:

Data is stored using the create entity function. Schema is the following

{
    title: { type: 'string' },
    singer: { type: 'string' },
    text: { type: 'text' },
}

How the data is accessed:

The data is access using Redis Seach using the search function and the where…


Top comments (0)