Sai Krishna
Sai Krishna

Reputation: 671

Implementing backend caching in a serverless AWS architecture recommendation

I have a serverless app using AWS lambda. My lambda fetches some data from other third party APIs and I'm planning to implement backend caching to cache the data my lambda fetches. I've read some articles online and I saw some sample architectures.

enter image description here

If you observe the picture, the dynamoDB is used to store the cache of the data fetched by the lambda. People suggested DynamoDB as the latency it adds while fetching the cache is very minimal. But I cannot go to DynamoDB as each of my data item to be cached is very large, even after gzipping it (approx 5-7MB). Hence, Im planning to use a DocumentDB instead of a DynamoDB. Im just learning how DocumentDB works and have no idea if it is as fast and efficient as DynamoDB. Could anyone comment on this idea and give some suggestions regarding which options I could use in this case apart from DynamoDB and if DocumentDB is a good alternative?

Upvotes: 1

Views: 387

Answers (1)

Seth Geoghegan
Seth Geoghegan

Reputation: 5747

If you need to cache 5-7MB worth of data, have you considered using S3 as a cache? S3 can be used as an effective (and cheap) nosql database. I'm not sure it will meet your specific use case, but it may be worth exploring depending on your needs.

I found a good conversation about this topic on StackOverflow if you want to dive deeper.

Upvotes: 1

Related Questions