Book Image

Implementing Cloud Design Patterns for AWS

Book Image

Implementing Cloud Design Patterns for AWS

Overview of this book

Table of Contents (18 chapters)
Implementing Cloud Design Patterns for AWS
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

In-memory cache pattern


While it is important to create a database in which the data is highly available, there are other optimizations possible, depending on the structure. If an application is very read-heavy but does not write very often, it might make sense to use a read-only database with splitting, as designed in the previous pattern. It might also serve the user or consuming system to cache the data so that it does not have to be retrieved on every request.

Consider an application that uses pagination to display information to a user. A typical query might look like SELECT * FROM products WHERE category=23 LIMIT 50 OFFSET 1000;. At first glance, this might be acceptable, but for this particular query, the application will execute and retrieve the first 1000 rounds, discard them, and then return the next 50 rows. The retrieval of the 1000 would be a waste of time and resources on data that is changing at a very quick rate. This query will degrade over time as the system continues to...