Chapter 10: Amazon ElastiCache
- A, B, C. Many types of objects are good candidates to cache because they have the potential to be accessed by numerous users repeatedly. Even the balance of a bank account could be cached for short periods of time if the back-end database query is slow to respond.
- 这些被cache的数据内容主要是有潜在的可能被巨大的用户重复的访问;
- B, C. Amazon ElastiCache supports Memcached and Redis cache engines. MySQL is not a cache engine, and Couchbase is not supported.
- AWS支持的cache引擎主要是 memcached 和 redis
- C. The default limit is 20 nodes per cluster.
- Redis的集群模式最大分片数量是15,每个分片的副本最大是5
- Redis的常规模式最大副本个数是5
- Memcache最大的节点数量是20
- 两种引擎不同的是memcache是分布式的,每个节点存储的数据不同,redis是集群形态,redis支持多节点的cluster
- redis支持数据写到磁盘
- A. Redis clusters can only contain a single node; however, you can group multiple clusters together into a replication group.
- Redis集群只能包含一个单一节点;
- 但是我们可以将多个redis节点放到一个复制组中;
- B, C. Amazon ElastiCache is Application Programming Interface (API)-compatible with existing Memcached clients and does not require the application to be recompiled or linked against the libraries. Amazon ElastiCache manages the deployment of the Amazon ElastiCache binaries.
- Amazon 的ElasticCache客户端支持现有的Memcached的客户端,不需要重新编译程序。
- ElasticCache的访问需要调整安全组,允许application对端口的访问;
- B, C. Amazon ElastiCache with the Redis engine allows for both manual and automatic snapshots. Memcached does not have a backup function.
- Amazon ElasticCache的redis引擎支持手工和自动创建快照;
- Amazon ElasticCache的 Memcached不支持快照机制;
- B, C, D. Limit access at the network level using security groups or network ACLs, and limit infrastructure changes using IAM.
- 网络级别的限制就是security groups和network ACLs,框架级别的限制就是用IAM;
- C. Amazon ElastiCache with Redis provides native functions that simplify the development of leaderboards. With Memcached, it is more difficult to sort and rank large datasets. Amazon Redshift and Amazon S3 are not designed for high volumes of small reads and writes, typical of a mobile game.
- Amazone ElasticCache的redis引擎提供了排名的原生函数;
- A. When the clients are configured to use AutoDiscovery, they can discover new cache nodes as they are added or removed. AutoDiscovery must be configured on each client and is not active server side. Updating the configuration file each time will be very difficult to manage. Using an Elastic Load Balancer is not recommended for this scenario.
- 因为用的memcached引擎,所以只能是调整客户端的配置了,只能通过客户端发现来增加集群的新节点;这个貌似就是控制客户端的配置文件了。
- A, B. Amazon ElastiCache supports both Memcached and Redis. You can run selfmanaged installations of Membase and Couchbase using Amazon Elastic Compute Cloud (Amazon EC2).
- AWS支持ElastiCache 的memcached和redis引擎
知识点总结
Know how to use Amazon ElastiCache. Improve the performance of your application by deploying Amazon ElastiCache clusters as part of your application and offloading read requests for frequently accessed data. Use the cache-aside pattern in your application first to check the cache for your query results before checking the database.
了解如何使用ElastiCache来提升应用的性能。用来处理频繁度读的请求。使用 cache-aside模型的应用,首先就是在cache中检查是否有你要查寻的结果,然后再检查数据库。
Understand when to use a specific cache engine. Amazon ElastiCache gives you the choice of cache engine to suit your requirements. Use Memcached when you need a simple, in-memory object store that can be easily partitioned and scaled horizontally. Use Redis when you need to back up and restore your data, need many clones or read replicas, or are looking for advanced functionality like sort and rank or leaderboards that Redis natively supports.
了解什么时候去使用一个特定的cache引擎。ElasticCache 提供满足你需求的cache engine。
Memaced:当你需要一个简单的,基于内存对象的存储,同时支持分区和水平扩展到引擎时使用。
Redis:当你需要备份或者还原你的数据,需要多份读的副本的时候,或者当你寻找更加高阶的功能,如排序及排行榜等,这个redis原生支持;
Understand how to scale a Redis cluster horizontally. An Amazon ElastiCache cluster running Redis can be scaled horizontally first by creating a replication group, then by creating additional clusters and adding them to the replication group.
了解如何水平扩展一个Redis集群。一个Amazon ElastiCache集群运行Redis的时候,可以水平的扩展。首先创建一个replication group,然后创建其他的集群,将他们增加到replication group中就可以了。
Understand how to scale a Memcached cluster horizontally. An Amazon ElastiCache cluster running Memcached can be scaled horizontally by adding or removing additional cache nodes to the cluster. The Amazon ElastiCache client library supports Auto Discovery and can discover new nodes added or removed from the cluster without having to hardcode the list of nodes.
理解如何水平扩展一个Memcached集群。ElastiCache集群运行Memcache的时候,可以通过增加或者减少额外的cache node来进行伸缩。ElasticCache的客户端lib支持自动发现,同时将新的节点增加或者remove到现有的集群中,而不需要进行在软件中硬编码。
Know how to back up your Amazon ElastiCache cluster. You can create a snapshot to back up your Amazon ElastiCache clusters running the Redis engine. Snapshots can be created automatically on a daily basis or manually on demand. Amazon ElastiCache clusters running Memcached do not support backup and restore natively.
了解如何对ElastiCache 进行备份。你可以针对运行的Redis 引擎创建一个快照。快照可以被自动的创建,基于一个日常信息或者按需手工创建。ElasticCache集群运行Memcached不需要支持原生的备份或者回复操作;