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.
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…