Chapter 14: Architecture Best Practices

Chapter 14: Architecture Best Practices

  1. B, E. Amazon Kinesis is a platform for streaming data on AWS, offering powerful services to make it easy to load and analyze streaming data. Amazon SQS is a fast, reliable, scalable, and fully managed message queuing service. Amazon SQS makes it simple and cost-effective to decouple the components of a cloud application.
  • Kinesis 提供了流處理能力,簡化了加載和分析流式數(shù)據(jù)宾尚。
  • Amazon SQS提供了mq能力供解耦丙笋;
  1. B, C. Launching instances across multiple Availability Zones helps ensure the application is isolated from failures in a single Availability Zone, allowing the application to achieve higher availability. Whether you are running one Amazon EC2 instance or thousands ,you can use Auto Scaling to detect impaired Amazon EC2 instances and unhealthy applications and replace the instances without your intervention. This ensures that your application is getting the compute capacity that you expect, thereby maintaining your availability.
  • 多AZ可以提升可用性;
  • AS可以將受損實(shí)例快速替換掉煌贴;
  1. A, E. Amazon DynamoDB runs across AWS proven, high-availability data centers. The service replicates data across three facilities in an AWS region to provide fault tolerance in the event of a server failure or Availability Zone outage. Amazon S3 provides durable infrastructure to store important data and is designed for durability of 99.999999999% of objects. Your data is redundantly stored across multiple facilities and multiple devices in each facility. While Elastic Load Balancing and Amazon ElastiCache can be deployed across multiple Availability Zones, you must explicitly take such steps when creating them.
  • Amazon DynamoDB是按照單region跨AZ設(shè)計(jì)的御板,支持容災(zāi);
  • S3也是按照單Region中多az自動(dòng)復(fù)制設(shè)計(jì)的牛郑,支持容災(zāi)高可用怠肋;
  • ELB、Elastic Cache的跨AZ能力必須在創(chuàng)建的時(shí)候指定淹朋;
  1. A, D. Auto Scaling enables you to follow the demand curve for your applications closely, reducing the need to provision Amazon EC2 capacity manually in advance. For example, you can set a condition to add new Amazon EC2 instances in increments to the Auto Scaling group when the average CPU and network utilization of your Amazon EC2 fleet monitored in Amazon CloudWatch is high; similarly, you can set a condition to remove instances in the same increments when CPU and network utilization are low.
  • 通過CloudWatch來監(jiān)控實(shí)例的網(wǎng)絡(luò)和cpu利用率笙各;通過AS自動(dòng)伸縮實(shí)例個(gè)數(shù);
  1. B, D, E. There is no direct way to encrypt an existing unencrypted volume. However, you can migrate data between encrypted and unencrypted volumes.
  • 沒有辦法將已經(jīng)存儲(chǔ)數(shù)據(jù)的卷進(jìn)行加密础芍¤厩溃可以通過遷移數(shù)據(jù)的方式完成;
  1. A, C, D. The attack surface is composed of the different Internet entry points that allow access to your application. The strategy to minimize the attack surface area is to (a) reduce the number of necessary Internet entry points, (b) eliminate non-critical Internet entry points, (c) separate end user traffic from management traffic, (d) obfuscate necessary Internet entry points to the level that untrusted end users cannot access them, and (e) decouple Internet entry points to minimize the effects of attacks. This strategy can be accomplished with Amazon VPC.
  • 降低或者減少攻擊區(qū)域策略如下:
  • 減少internet entry points個(gè)數(shù)仑性;
  • 終止不重要的internet entry points
  • 分離用戶流量和管理平臺(tái)流量惶楼;
  • 模糊訪問入口,對(duì)不被信任的用戶不開放虏缸;
  • 解耦internet訪問入口鲫懒,減少攻擊效果窥岩;
  1. C. Amazon RDS read replicas provide enhanced performance and durability for Amazon RDS instances. This replication feature makes it easy to scale out elastically beyond the capacity constraints of a single Amazon RDS instance for read-heavy database workloads. You can create one or more replicas of a given source Amazon RDS instance and serve high-volume application read traffic from multiple copies of your data, thereby increasing aggregate read throughput.
  • RDS提供了讀的副本能力颂翼,可以緩解數(shù)據(jù)庫讀的壓力朦乏;
  1. A. An alias resource record set can point to an ELB. You cannot create a CNAME record at the top node of a Domain Name Service (DNS) namespace, also known as the zone apex, as the case in this example. Alias resource record sets can save you time because Amazon Route 53 automatically recognizes changes in the resource record sets to which the alias resource record set refers.
  • 我們不能再R53創(chuàng)建CNAME指向ELB的連接呻疹。主要是我們不能在頂級(jí)DNS空間中創(chuàng)建一個(gè)CNAME記錄刽锤;alias資源記錄設(shè)置可以節(jié)省時(shí)間并思,因?yàn)镽53可以自動(dòng)識(shí)別資源記錄的改變。
  1. D. An instance profile is a container for an AWS Identity and Access Management (IAM) role that you can use to pass role information to an Amazon EC2 instance when the instance starts. The IAM role should have a policy attached that only allows access to the AWS Cloud services necessary to perform its function.
  • 一個(gè)Instance profile 可以將IAM ROLE的信息傳遞到EC2 instance
  1. B. Amazon API Gateway is a fully managed service that makes it easy for developers to publish, maintain, monitor, and secure APIs at any scale. You can create an API that acts as a “front door” for applications to access data, business logic, or functionality from your code running on AWS Lambda. Amazon API Gateway handles all of the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls, including traffic management, authorization and access control, monitoring, and API version management.
  • AWS提供了API gateway支持微服務(wù)落地弄砍;
  1. C. Amazon EFS is a file storage service for Amazon EC2 instances. Multiple Amazon EC2 instances can access an Amazon EFS file system at the same time, providing a common data source for the content of the WordPress site running on more than one instance.
  • EFS這個(gè)共享存儲(chǔ)的卷可以支持多個(gè)EC2節(jié)點(diǎn)共同掛載;
  1. A. Amazon DynamoDB is a NoSQL database store that is a great choice as an alternative due to its scalability, high-availability, and durability characteristics. Many platforms provide open-source, drop-in replacement libraries that allow you to store native sessions in Amazon DynamoDB. Amazon DynamoDB is a great candidate for a session storage solution in a share-nothing, distributed architecture.
  • 一般是nosqldb來存儲(chǔ)session狀態(tài)這類數(shù)據(jù)桃熄,DynamoDB就是NOSQLDB型奥;
  1. B. Amazon SQS is a fast, reliable, scalable, and fully managed message queuing service. Amazon SQS should be used to decouple the large volume of inbound transactions, allowing the back-end services to manage the level of throughput without losing messages.
  • 交易解耦一般通過SQS這種方式來做;
  1. B, C, E. You should protect AWS user access keys like you would your credit card numbers or any other sensitive secret. Use different access keys for different applications so that you can isolate the permissions and revoke the access keys for individual applications if an access key is exposed. Remember to change access keys on a regular basis. For increased security, it is recommended to configure MFA for any sensitive operations. Remember to remove any IAM users that are no longer needed so that the user’s access to your resources is removed. Always avoid having to embed access keys in an application.
  • 保護(hù)aws的ak方式如下:
  • 使用不同的ak對(duì)于不同的application谐宙;
  • 定期更改ak搭综;
  • 使用MFA來控制敏感操作兑巾;
  • 要避免將ak嵌入到application中忠荞;
  • 記得刪除IAM USER的時(shí)候委煤,也會(huì)將用戶的ak刪除府框;
  1. A, B, E. You can enable AWS CloudTrail in your AWS account to get logs of API calls and related events’ history in your account. AWS CloudTrail records all of the API access events as objects in an Amazon S3 bucket that you specify at the time you enable AWS CloudTrail. You can take advantage of Amazon S3’s bucket notification feature by directing Amazon S3 to publish object-created events to AWS Lambda. Whenever AWS CloudTrail writes logs to your Amazon S3 bucket, Amazon S3 can then invoke your AWS Lambda function by passing the Amazon S3 object-created event as a parameter. The AWS Lambda function code can read the log object and process the access records logged by AWS CloudTrail.
  • 記錄api的調(diào)動(dòng)并審計(jì)迫靖,主要使用CloudTrail服務(wù)袜香,然后存儲(chǔ)到S3中蜈首,然后通過lambda函數(shù)來進(jìn)行處理欢策;
  1. B. Amazon Glacier enables businesses and organizations to retain data for months, years, or decades, easily and cost effectively. With Amazon Glacier, customers can retain more of their data for future analysis or reference, and they can focus on their business instead of operating and maintaining their storage infrastructure. Customers can also use Amazon Glacier Vault Lock to meet regulatory and compliance archiving requirements.
  • 最佳性價(jià)比的方法是使用Glacier踩寇,因?yàn)椴恍枰S時(shí)查詢,只是存檔俺孙;
  1. A. Many companies that distribute content via the Internet want to restrict access to documents, business data, media streams, or content that is intended for selected users, such as users who have paid a fee. To serve this private content securely using Amazon CloudFront, you can require that users access your private content by using special Amazon CloudFront-signed URLs or signed cookies.
  • 只針對(duì)付費(fèi)用戶服務(wù)荣茫,可以使用signed URL的方式提供服務(wù)啡莉;
  1. B. Amazon S3 provides highly durable and available storage for a variety of content. Amazon S3 can be used as a big data object store for all of the videos. Amazon S3’s low cost combined with its design for durability of 99.999999999% and for up to 99.99% availability make it a great storage choice for transcoding services.
  • 對(duì)于視頻的存儲(chǔ)轉(zhuǎn)碼咧欣,可以使用S3進(jìn)行存儲(chǔ)魄咕,然后調(diào)用轉(zhuǎn)碼付費(fèi)進(jìn)行轉(zhuǎn)換蚕礼;
  1. A. An Availability Zone consists of one or more physical data centers. Availability zones within a region provide inexpensive, low-latency network connectivity to other zones in the same region. This allows you to distribute your application across data centers. In the event of a catastrophic failure in a data center, the application will continue to handle requests.
  • 如果只是容災(zāi)奠蹬,可以通過多個(gè)az的分布式完成囤躁;
  1. C. You can use a NAT gateway to enable instances in a private subnet to connect to the Internet or other AWS services, but prevent the Internet from initiating a connection with those instances. If you have resources in multiple Availability Zones and they share one NAT gateway, resources in the other Availability Zones lose Internet access in the
    event that the NAT gateway’s Availability Zone is down. To create an Availability Zone independent architecture, create a NAT gateway in each Availability Zone and configure your routing to ensure that resources use the NAT gateway in the same Availability Zone.
  • NAT實(shí)例提供了對(duì)外調(diào)用的能力狸演,如果是擔(dān)心單點(diǎn)故障,可以通過單AZ獨(dú)立創(chuàng)建一個(gè)NAT的方式進(jìn)行處理腊尚;

知識(shí)點(diǎn)總結(jié)

  • Understand highly available architectures. A system is highly available when it can withstand the failure of an individual or multiple components. If you design architectures around the assumption that any component will eventually fail, systems won’t fail when an individual component does.

  • 系統(tǒng)的高可用是指當(dāng)一個(gè)或者多個(gè)組件失敗的時(shí)候,系統(tǒng)仍舊可用民宿。架構(gòu)師設(shè)計(jì)系統(tǒng)的時(shí)候就要假定任何組件會(huì)失敗像鸡,系統(tǒng)不會(huì)宕機(jī)當(dāng)任何單一組件不可用只估。

  • Understand redundancy. Redundancy can be implemented in either standby or active mode. When a resource fails in standby redundancy, functionality is recovered on a secondary resource using a process called failover. The failover will typically require some time before it is completed, and during that period the resource remains unavailable. In active redundancy, requests are distributed to multiple redundant compute resources, and when one of them fails, the rest can simply absorb a larger share of the workload. Compared to standby redundancy, active redundancy can achieve better utilization and affect a smaller
    population when there is a failure.

  • 冗余可以通過standby和active模式實(shí)現(xiàn)赖舟。當(dāng)一個(gè)資源通過standby方式冗余。功能是可以通過failover機(jī)制恢復(fù)的豫喧。failover將會(huì)需要一些時(shí)間完成回復(fù)紧显,資源將保持不可用孵班。在active模式下篙程,請(qǐng)求被分發(fā)到多個(gè)冗余的計(jì)算資源上虱饿,當(dāng)其中一個(gè)失敗了氮发,剩下的會(huì)簡單完成請(qǐng)求分發(fā)爽冕。相對(duì)于standby冗余颈畸,active冗余可以獲得更好的利用率,同時(shí)在發(fā)生失敗的時(shí)候產(chǎn)生的影響較小华弓。

  • Understand elasticity. Elastic architectures can support growth in users, traffic, or data size with no drop in performance. It is important to build elastic systems on top of a scalable architecture. These architectures should scale in a linear manner, where adding extra resources results in at least a proportional increase in ability to serve additional system load.
    The growth in resources should introduce economies of scale, and cost should follow the same dimension that generates business value out of that system. There are generally two ways to scale an IT architecture: vertically and horizontally.

  • 理解彈性伸縮寂屏。彈性架構(gòu)可以支持用戶流量及數(shù)據(jù)量的快速增長,同時(shí)不影響性能考廉。構(gòu)建一個(gè)彈性可伸縮的系統(tǒng)架構(gòu)非常重要昌粤。當(dāng)增加額外的資源提升能力的時(shí)候涮坐,這些架構(gòu)可以支持負(fù)載線性增長袱讹。資源的增加會(huì)導(dǎo)致經(jīng)濟(jì)成本的擴(kuò)展捷雕,成本會(huì)隨時(shí)商業(yè)價(jià)值提升而增長。這里一般有水平擴(kuò)展和垂直擴(kuò)展兩種方法來擴(kuò)展架構(gòu)征绸;

  • Understand vertical scaling. Scaling vertically takes place through an increase in the specifications of an individual resource (for example, upgrading a server with a larger hard drive or a faster CPU). This way of scaling can eventually hit a limit, and it is not always a cost efficient or highly available approach.

  • 垂直擴(kuò)展是通過增加資源規(guī)格的方式提升性淆衷,例如通過增加一個(gè)大的硬盤或者更高的CPU來提升一個(gè)服務(wù)器。這種形式的擴(kuò)展會(huì)有一個(gè)限制渤弛,同時(shí)他不會(huì)是一個(gè)高可用的方法祝拯。

  • Understand horizontal scaling. Scaling horizontally takes place through an increase in the number of resources. This is a great way to build Internet-scale applications that leverage the elasticity of cloud computing. It is important to understand the impact of stateless and stateful architectures before implementing horizontal scaling.

  • 水平擴(kuò)展是通過增加一定數(shù)量資源完成的。這事一個(gè)比較好的方法去構(gòu)建互聯(lián)網(wǎng)應(yīng)用她肯,借助了云的彈性伸縮能力佳头。在實(shí)現(xiàn)水平擴(kuò)展的時(shí)候,理解有狀態(tài)或者無狀態(tài)的架構(gòu)非常重要晴氨。

  • Understand stateless applications. A stateless application needs no knowledge of the previous interactions and stores no session information. A stateless application can scale horizontally because any request can be serviced by any of the available system compute resources.

  • 理解無狀態(tài)應(yīng)用康嘉。一個(gè)無狀態(tài)應(yīng)用不需要上一步的動(dòng)作,同時(shí)不存儲(chǔ)session信息籽前。一個(gè)無狀態(tài)應(yīng)用可以水平擴(kuò)展亭珍,因?yàn)槿魏握?qǐng)求都可以被任何可用的計(jì)算資源處理枝哄。

  • Understand loose coupling. As application complexity increases, a desirable characteristic of an IT system is that it can be broken into smaller, loosely coupled components. This means that IT systems should be designed as “black boxes” to reduce interdependencies so that a change or a failure in one component does not cascade to other components. The more loosely system components are coupled, the larger they scale.

  • 應(yīng)用復(fù)雜度增加的情況下蓖租,小的、組件松耦合的IT系統(tǒng)特性被期望主慰。這就意味著IT系統(tǒng)需要被設(shè)計(jì)成黑盒去減少交互依賴情竹,以保證一個(gè)組件的改變或者失敗不會(huì)關(guān)聯(lián)到其他組件。系統(tǒng)組件松耦合做的越好,他們就越容易擴(kuò)展。

  • Understand the different storage options in AWS. AWS offers a broad range of storage choices for backup, archiving, and disaster recovery, as well as block, file, and object storage to suit a plethora of use cases. It is important from a cost, performance, and functional aspect to leverage different storage options available in AWS for different types of datasets.

  • AWS提供了一系列的的存儲(chǔ)選擇产喉,如備份、歸檔敛腌、容災(zāi)恢復(fù)、塊存儲(chǔ)、文件存儲(chǔ)和對(duì)象存儲(chǔ),去匹配不同的使用場(chǎng)景。對(duì)于不同的數(shù)據(jù)集系羞,從性價(jià)比杠人,功能特性等角度考慮存儲(chǔ)選擇是非常重要的罩引。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末徙融,一起剝皮案震驚了整個(gè)濱河市饺饭,隨后出現(xiàn)的幾起案子扛芽,更是在濱河造成了極大的恐慌空厌,老刑警劉巖赋朦,帶你破解...
    沈念sama閱讀 222,183評(píng)論 6 516
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件承粤,死亡現(xiàn)場(chǎng)離奇詭異彻舰,居然都是意外死亡崖堤,警方通過查閱死者的電腦和手機(jī)胯甩,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,850評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門恶复,熙熙樓的掌柜王于貴愁眉苦臉地迎上來谤牡,“玉大人断序,你說我怎么就攤上這事诸迟。” “怎么了撮竿?”我有些...
    開封第一講書人閱讀 168,766評(píng)論 0 361
  • 文/不壞的土叔 我叫張陵倚聚,是天一觀的道長。 經(jīng)常有香客問我凿可,道長惑折,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,854評(píng)論 1 299
  • 正文 為了忘掉前任枯跑,我火速辦了婚禮惨驶,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘敛助。我一直安慰自己粗卜,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,871評(píng)論 6 398
  • 文/花漫 我一把揭開白布纳击。 她就那樣靜靜地躺著续扔,像睡著了一般。 火紅的嫁衣襯著肌膚如雪焕数。 梳的紋絲不亂的頭發(fā)上纱昧,一...
    開封第一講書人閱讀 52,457評(píng)論 1 311
  • 那天,我揣著相機(jī)與錄音堡赔,去河邊找鬼识脆。 笑死,一個(gè)胖子當(dāng)著我的面吹牛善已,可吹牛的內(nèi)容都是我干的灼捂。 我是一名探鬼主播,決...
    沈念sama閱讀 40,999評(píng)論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼换团,長吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼悉稠!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起啥寇,我...
    開封第一講書人閱讀 39,914評(píng)論 0 277
  • 序言:老撾萬榮一對(duì)情侶失蹤偎球,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后辑甜,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體衰絮,經(jīng)...
    沈念sama閱讀 46,465評(píng)論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,543評(píng)論 3 342
  • 正文 我和宋清朗相戀三年磷醋,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了猫牡。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,675評(píng)論 1 353
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡邓线,死狀恐怖淌友,靈堂內(nèi)的尸體忽然破棺而出煌恢,到底是詐尸還是另有隱情,我是刑警寧澤震庭,帶...
    沈念sama閱讀 36,354評(píng)論 5 351
  • 正文 年R本政府宣布瑰抵,位于F島的核電站,受9級(jí)特大地震影響器联,放射性物質(zhì)發(fā)生泄漏二汛。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,029評(píng)論 3 335
  • 文/蒙蒙 一拨拓、第九天 我趴在偏房一處隱蔽的房頂上張望肴颊。 院中可真熱鬧,春花似錦渣磷、人聲如沸婿着。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,514評(píng)論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽竟宋。三九已至,卻和暖如春形纺,著一層夾襖步出監(jiān)牢的瞬間袜硫,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,616評(píng)論 1 274
  • 我被黑心中介騙來泰國打工挡篓, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留婉陷,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 49,091評(píng)論 3 378
  • 正文 我出身青樓官研,卻偏偏與公主長得像秽澳,于是被迫代替她去往敵國和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子戏羽,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,685評(píng)論 2 360

推薦閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,346評(píng)論 0 10
  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 9,576評(píng)論 0 23
  • 祝我生日快樂担神,其實(shí)并不是很快樂,不過怎么說呢始花,還是不錯(cuò)的妄讯,早上就收到母親和魯婷的祝福,我沒想到魯婷還記得我生日呢酷宵,...
    蕭璉閱讀 357評(píng)論 0 1
  • 《尋人啟事》朴摊,看哭了無數(shù)家長Dⅰ! 看到兒子拿回來的勉強(qiáng)及格的試卷甚纲,我失望透了口锭。兒子都11歲了,還一點(diǎn)兒都不懂事介杆,一...
    聚匯學(xué)平臺(tái)閱讀 432評(píng)論 0 0
  • 今天晚上回來讹弯,下著很大的雨。 我沒帶傘这溅,在街上快速走著。走到住處附近棒仍,突然一個(gè)中年男子靠過來悲靴,把傘往我頭上遮,問我...
    悶豆豆閱讀 178評(píng)論 0 0