· 6 years ago · Feb 20, 2020, 10:36 AM
1# AWS Performance Efficiency Pillar<br>
2
3**July 2018**<br><br>
4
5## ? Abstract
6
7The focus of this paper is the Performance Efficiency pillar of the Amazon
8Web Services (AWS)
9[Well-Architected Framework](https://d0.awsstatic.com/whitepapers/architecture/AWS_Well-Architected_Framework.pdf).<br>
10
11It provides guidance to help customers apply best practices in the design,
12delivery, and maintenance of AWS environments.<br><br>
13
14This whitepaper covers the best practices for managing production
15environments.<br>
16
17Designing and managing non-production environments & processes such as
18Continuous Integration or Delivery are out of the scope of this document.<br><br>
19
20## ? Introduction
21
22The [AWS Well-Architected Framework](https://aws.amazon.com/architecture/well-architected/)
23helps you understand the pros and cons of decisions you make while building
24systems on AWS.<br>
25
26By using the Framework, you will learn architectural best practices for
27designing & operating reliable, secure, efficient, and cost-effective
28systems in the cloud.<br>
29
30It provides a way for you to consistently measure your architectures
31against best practices and identify areas for improvement.<br>
32
33We believe that having well-architected systems greatly increases the
34likelihood of business success.<br><br>
35
36The framework is based on five pillars:<br>
37
38✽ **Operational Excellence**<br>
39
40✽ **Security**<br>
41
42✽ **Reliability**<br>
43
44✽ **Performance Efficiency**<br>
45
46✽ **Cost Optimization**<br><br>
47
48This paper focuses on the performance efficiency pillar and how to apply
49it to your solutions.<br>
50
51In traditional, on-premises environments, achieving high and lasting
52performance can be challenging.<br>
53
54By adopting the practices in this paper, you can build architectures
55that are efficient and deliver sustained performance over time.<br><br>
56
57This paper is intended for those in technology roles, such as chief
58technology officers (CTOs), architects, developers, and operations team
59members.<br>
60
61After reading this paper, you'll understand AWS best practices and
62strategies to use when designing a performant cloud architecture.<br>
63
64This paper doesn't provide implementation details or architectural
65patterns.<br>
66However, it does include references to appropriate resources for this
67information.<br><br>
68
69## ?? Performance Efficiency
70
71The **performance efficiency pillar** `focuses on the efficient use of
72computing resources to meet requirements & how to maintain that
73efficiency as demand changes and technologies evolve.`<br>
74
75This paper provides in-depth, best-practice guidance for architecting for
76performance efficiency on AWS.<br><br>
77
78### ? A. Design Principles
79
80In the cloud, there are a number of principles that can help you achieve
81performance efficiency.<br>
82
83❆ **Democratize advanced technologies**:<br>
841. Technologies that are difficult to implement can become easier to
85consume by pushing that knowledge and complexity into the cloud vendor's
86domain.
872. Rather than having your IT team learn how to host and run a new
88technology, they can simply consume it as a service.
893. **For example**, NoSQL databases, media transcoding, and machine
90learning are all technologies that require expertise that is not evenly
91dispersed across the technical community.
924. In the cloud, these technologies become services that your team can
93consume.
945. This lets your team focus on product development rather than resource
95provisioning and management.<br><br>
96
97❆ **Go global in minutes**:<br>
981. Easily deploy your system in multiple AWS Regions around the world with
99just a few clicks.
1002. This allows you to provide lower latency and a better experience for
101your customers at minimal cost.<br><br>
102
103❆ **Use serverless architectures**:<br>
1041. In the cloud, serverless architectures remove the need for you to run
105and maintain servers to carry out traditional compute activities.
1062. **For example**, storage services can act as static websites, removing
107the need for web servers, and event services can host your code for you.
1083. This removes the operational burden of managing these servers and can
109also lower transactional costs because these managed services operate at
110cloud scale.<br><br>
111
112❆ **Experiment more often**:<br>
1131. With virtual and automatable resources, you can quickly carry out
114comparative testing using different types of instances, storage, or
115configurations.<br><br>
116
117❆ **Mechanical sympathy**:<br>
1181. Use the technology approach that aligns best to what you are trying to
119achieve.
1202. **For example**, consider data access patterns when you select database
121or storage approaches.<br><br>
122
123### ? B. Definition
124
125**Performance efficiency in the cloud** is `composed of four areas:`<br>
126
127⌖ **Selection**<br>
128
129⌖ **Review**<br>
130
131⌖ **Monitoring**<br>
132
133⌖ **Trade-offs**<br><br>
134
135Take a data-driven approach to building a high-performance architecture.<br>
136
137Gather data on all aspects of the architecture, from the high-level
138design to the selection and configuration of resource types.<br>
139
140By reviewing your choices on a regular basis, you ensure that you are
141taking advantage of the continually evolving AWS Cloud.<br>
142
143Monitoring will ensure that you are aware of any deviance from expected
144performance so you can take action on it.<br>
145
146Finally, you can make tradeoffs in your architecture to improve
147performance, such as using compression or caching, or relaxing consistency
148requirements.<br><br>
149
150## ? Selection
151
152The optimal solution for a particular system will vary based on the kind
153of workload you have and often combines multiple approaches.<br>
154
155Well-architected systems use multiple solutions and enable different
156features to improve performance.<br><br>
157
158With AWS, resources are virtualized and are available in a number of
159different types and configurations.<br>
160This makes it easier to find an approach that closely aligns with your
161needs.<br>
162
163You can also find options that are not easily achievable with on-premises
164infrastructure.<br>
165
166**For example**, a managed service such as Amazon DynamoDB provides a
167fully managed NoSQL database with single-digit millisecond latency at
168any scale.<br><br>
169
170You can rely on AWS Solution Architects, AWS Reference Architectures, and
171AWS Partners to help you choose an architecture based on what you have
172learned.<br>
173
174However, you need to perform benchmarking or load testing to optimize
175your architecture.<br>
176
177After you have identified your architectural approach, you should use a
178data-driven process to refine your selection of resource types and
179configuration options.<br>
180
181You can obtain this data using benchmarking and load testing.<br>
182
183For more information, see the
184[Review section]()
185later in this whitepaper.<br><br>
186
187Your architecture can combine a number of different architectural
188approaches (**for example**, request-response, event driven; extract,
189transform, load (ETL); or pipeline).<br>
190
191Your architecture's implementation will use the AWS services that can
192optimize your architecture's performance.<br>
193
194In the following sections, we look at the **four main resource types that
195you should consider**: `compute, storage, database, and network.`<br><br>
196
197### ? A. Compute
198
199The optimal compute solution for a particular system varies based on
200application design, usage patterns, and configuration settings.<br>
201
202Architectures can use different compute solutions for various components
203and enable different features to improve performance.<br>
204
205Selecting the wrong compute solution for an architecture can lead to
206lower performance efficiency.<br><br>
207
208When architecting your use of compute, you should take advantage of
209elasticity mechanisms that can ensure that you have sufficient capacity
210to sustain performance as demand changes.<br>
211
212In AWS, compute is available in three forms: instances, containers, and
213functions.<br>
214
215Choose which form of compute to use for each component in your
216architecture.<br>
217
218Instances are generally the default option.<br>
219Using containers can improve the utilization of instances.<br>
220Functions are well suited to event-driven or highly parallelizable
221tasks.<br><br>
222
223#### ❶ Instances
224
225*Instances* are virtualized servers and, therefore, you can change their
226capabilities with the click of a button or an API call.<br>
227
228In the cloud, resource decisions are no longer fixed, so you can
229experiment with different server types.<br><br>
230
231Amazon Elastic Compute Cloud (Amazon EC2) virtual server instances come in
232different families and sizes.<br>
233
234They offer a wide variety of capabilities, including solid-state drives
235(SSDs) and graphics processing units (GPUs).<br>
236
237When you launch an EC2 instance, the instance type that you specify
238determines the hardware of the host computer used for your instance.<br>
239
240Each instance type offers different compute, memory, and storage
241capabilities.<br>
242Instance types are grouped in instance families based on these
243capabilities.<br><br>
244
245When selecting instance families and types, also consider the
246configuration options that your workload needs:<br>
247
248* **Graphics Processing Units (GPU)**
2491. Using general purpose computing on GPUs (GPGPU), you can build
250applications that benefit from the high degree of parallelism that GPUs
251provide by leveraging platforms such as CUDA in the development process.
2522. Also, if your application requires 3D rendering or video compression,
253GPUs enable hardware-accelerated computation and encoding, making your
254application more efficient.<br><br>
255
256* **Field Programmable Gate Arrays (FPGA)**
2571. Using FPGAs, you can optimize your workloads by having custom
258hardware-accelerated execution for your most demanding workloads.
2592. You can define your algorithms by leveraging supported general
260programming languages such as C or Go, or hardware-oriented languages
261such as Verilog or VHDL.<br><br>
262
263* **Burstable instance families**
2641. Burstable instances are designed to provide moderate baseline
265performance and the capability to burst to significantly higher
266performance when it's required by your workload.
2672. These instances are intended for workloads that don't use the full CPU
268often or consistently, but occasionally need to burst.
2693. They are well suited for general-purpose workloads, such as web servers,
270developer environments, and small databases.
2714. These instances provide CPU credits that can be consumed when the
272instance needs to provide performance.
2735. Credits accumulate when the instance doesn't need them.<br><br>
274
275* **Advanced computing features**
2761. Amazon EC2 gives you access to advanced computing features such as
277managing the C-state and P-state registers & controlling the turbo-boost
278of processors.
2792. Access to co-processors allows cryptography operations offloading
280through AES-NI, or advanced computation through AVX extensions.<br><br>
281
282You should
2831. Use data to select the optimal EC2 instance type for your workload,
2842. Ensure you have the correct networking and storage options, &
2853. Consider operating system settings that can improve the performance for
286your workload.<br><br>
287
288#### ❷ Containers
289
290*Containers* are a method of operating system virtualization that allow
291you to run an application and its dependencies in resource-isolated
292processes.<br><br>
293
294Amazon EC2 Container Service (Amazon ECS) allows automated execution and
295management of containers on a cluster of EC2 instances.<br>
296
297You can create services in Amazon ECS that will be served by containers.<br>
298
299By using application Auto Scaling, you can define automated, metrics-based
300scaling for your services so that the number of containers supporting
301your service grows as the service needs grow.<br><br>
302
303Amazon ECS leverages Auto Scaling groups, which enable you to scale the
304Amazon ECS cluster by adding EC2 instances.<br>
305
306This way, you ensure that you always have the appropriate underlying
307server capacity to host your containers.<br><br>
308
309Amazon ECS is integrated with Elastic Load Balancing (ELB) to support
310load balancing your services in the container fleet dynamically.<br>
311
312By creating an Application Load Balancer instance, your containers will
313automatically register themselves to the load balancer when they
314scale.<br>
315
316With these features, you can host multiple containers serving the same
317service on a single Amazon EC2 instance, increasing the scalability of
318your application.<br><br>
319
320When using containers, you should use data to select the optimal type for
321your workload just as you use data to select your EC2 instance types.<br>
322
323You should also consider container configuration options such as memory,
324CPU, and tenancy configuration.<br><br>
325
326#### ❸ Functions
327
328*Functions* abstract the execution environment from the code you want to
329execute.<br>
330
331The use of functions allows you to execute code or provide a service
332without running or managing an instance.<br><br>
333
334AWS Lambda lets you run code without provisioning or managing servers or
335containers.<br>
336
337You just upload your code and AWS Lambda takes care of everything required
338to run and scale your code.<br>
339
340You can set up your code to automatically trigger from other AWS services;
341you can call it directly; or you can use it with Amazon API Gateway.<br><br>
342
343Amazon API Gateway is a fully managed service that makes it easy for
344developers to create, publish, maintain, monitor, and secure APIs at any
345scale.<br>
346
347You can create an API that acts as a "front door" to your Lambda
348function.<br>
349
350API Gateway handles all the tasks involved in accepting and processing up
351to hundreds of thousands of concurrent API calls, including traffic
352management, authorization and access control, monitoring, & API version
353management.<br><br>
354
355To deliver optimal performance with AWS Lambda, you should choose the
356amount of memory you want for your function.<br>
357You are then allocated proportional CPU power and other resources.<br>
358
359**For example**, choosing 256 MB of memory allocates approximately twice
360as much CPU power to your Lambda function as requesting 128 MB of
361memory.<br>
362
363You can also control the amount of time each function is allowed to run
364(up to a maximum of 300 seconds).<br><br>
365
366#### ❹ Elasticity
367
368*Elasticity* allows you to match the supply of resources you have against
369demand for them.<br>
370
371Instances, containers, and functions all provide mechanisms for elasticity
372either in combination with Auto Scaling or as a feature of the service
373itself.<br><br>
374
375Optimally matching supply to demand delivers the lowest cost for a
376system, but you also need to plan for sufficient supply to allow for
377provisioning time and individual resource failures.<br>
378
379Demand can be fixed or variable, requiring metrics and automation to
380ensure that management does not become a burdensome and disproportionately
381large cost in itself.<br><br>
382
383In AWS, you can use a number of different approaches to match supply with
384demand.<br>
385
386The
387*[Cost Optimization Pillar of the AWS Well-Architected Framework](https://d1.awsstatic.com/whitepapers/architecture/AWS-Cost-Optimization-Pillar.pdf)*
388whitepaper describes how to use each of these approaches:<br>
389
390✽ **Demand-based approach**<br>
391
392✽ **Buffer-based approach**<br>
393
394✽ **Time-based approach**<br><br>
395
396#### ❺ Key AWS Services
397
398The key AWS service for elastic compute solutions is **Auto Scaling**
399because `you use it to match the supply of your resources against demand
400for them.`<br>
401
402Instances, containers, and functions all provide mechanisms for elasticity
403either in combination with Auto Scaling or as a feature of the service
404itself.<br><br>
405
406#### ❻ Resources
407
408Refer to the following resources to learn more about AWS best practices
409for compute.<br>
410
411**Documentation**<br>
412
413❁ Instances: [Instance Types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)<br>
414❁ Containers: [Amazon ECS Container Instances](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html)<br>
415❁ Functions: [Compute Requirements – Lambda Function Configuration](http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction-function.html#resource-model)<br><br>
416
417### ? B. Storage
418
419The optimal storage solution for a particular system varies based on the
4201. Kind of access method (block, file, or object) you use,
4212. Patterns of access (random or sequential),
4223. Throughput required,
4234. Frequency of access (online, offline, archival),
4245. Frequency of update (WORM, dynamic), &
4256. Availability and durability constraints.<br><br>
426
427In AWS, storage is virtualized, and there are a number of different
428storage types.<br>
429
430This makes it easier to match your storage methods more closely with your
431needs, and it also offers storage options that are not easily achievable
432with on-premises infrastructure.<br>
433
434**For example**, Amazon Simple Storage Service (Amazon S3) is designed
435for 11 nines of durability.<br>
436
437When you use cloud storage, you can change from using magnetic hard disk
438drives (HDDs) to solid state drives (SSDs), and easily move virtual
439drives from one instance to another in seconds.<br><br>
440
441#### ❶ Characteristics
442
443When you select a storage solution, you should consider the different
444characteristics that you require, such as ability to share, file size,
445cache size, latency, throughput, and persistence of data.<br>
446
447Then match the requirements you want to the AWS service that best fits
448your needs: Amazon S3, Amazon Glacier, Amazon Elastic Block Store (Amazon
449EBS), Amazon Elastic File System (Amazon EFS), or Amazon EC2 instance
450store.<br><br>
451
452Performance can be measured by looking at throughput, input/output
453operations per second (IOPS), and latency.<br>
454
455Understanding the relationship between those measurements will help you
456select the most appropriate storage solution.<br><br>
457
458Storage | Services | Latency | Throughput | Shareable
459------- | -------- | ------- | ---------- | ---------
460**Block** | EBS, EC2 instance store | Lowest, consistent | Single | Mounted on single instance, copies via snapshots
461**File system** | EFS | Low, consistent | Multiple | Many clients
462**Object** | S3 | Low-latency | Web scale | Many clients
463**Archival** | Glacier | Minutes to hours | High | No<br>
464<br>
465
466From a latency perspective, if your data is only accessed by one instance
467then you should use block storage, such as Amazon EBS with Provisioned
468IOPS.<br>
469
470Distributed file systems such as Amazon EFS generally have a small
471latency overhead for each file operation, so they should be used where
472multiple instances need access.<br><br>
473
474Amazon S3 has features that can reduce latency and increase
475throughput.<br>
476
477You can use cross-region replication (CRR) to provide lower-latency data
478access to different geographic regions.<br><br>
479
480From a throughput perspective, Amazon EFS supports highly parallelized
481workloads (**for example**, using concurrent operations from multiple
482threads and multiple EC2 instances), which enables high levels of
483aggregate throughput and operations per second.<br>
484
485For Amazon EFS, use a benchmark or load test to select the appropriate
486performance mode.<br><br>
487
488#### ❷ Key AWS Services (Storage)
489
490The key AWS service for storage is **Amazon S3**, which <code>provides
491secure, durable, highly scalable</code>
492[cloud storage](https://aws.amazon.com/what-is-cloud-storage/).<br>
493
494The following services and features are also important:<br>
495
496* **Amazon EBS**<br>
497Provides persistent block storage volumes for use with EC2 instances.<br>
498
499* **Amazon EFS**<br>
500Provides simple, scalable file storage for use with EC2 instances.<br>
501
502* **Amazon EC2 instance store**<br>
503Provides temporary block-level storage for use with EC2 instances.<br>
504
505* **Amazon Glacier**<br>
506Provides an archival platform for long-term data storage and is
507integrated with Amazon S3 for tiered storage.<br><br>
508
509#### ❸ Resources (Storage)
510
511Refer to the following resources to learn more about AWS best practices
512for storage.<br>
513
514**Documentation**<br>
515
516❁ Amazon S3: [Request Rate and Performance Considerations](http://docs.aws.amazon.com/AmazonS3/latest/dev/request-rate-perf-considerations.html)<br>
517❁ Amazon Glacier: [Amazon Glacier Documentation](http://docs.aws.amazon.com/amazonglacier/latest/dev/introduction.html)<br>
518❁ Amazon EFS: [Amazon EFS Performance](http://docs.aws.amazon.com/efs/latest/ug/performance.html)<br>
519❁ Amazon EBS: [I/O Characteristics](http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-io-characteristics.html)<br><br>
520
521**Videos**<br>
522
523❁ [Amazon EBS Design for Performance](https://www.youtube.com/watch?v=2wKgha8CZ_w)<br><br>
524
525#### ❹ Configuration Options
526
527Storage solutions generally have configuration options that allow you to
528optimize for the type of workload.<br><br>
529
530Amazon EBS provides a range of options that allow you to optimize storage
531performance and cost for your workload.<br>
532
533These options are divided into two major categories:<br>
534* SSD-backed storage for transactional workloads, such as databases and
535boot volumes (performance depends primarily on IOPS), and
536* HDD-backed storage for throughput-intensive workloads, such as
537MapReduce and log processing (performance depends primarily on MB/s).<br><br>
538
539SSD-backed volumes include the highest performance Provisioned IOPS SSD
540for latency-sensitive transactional workloads and General Purpose SSD
541that balance price and performance for a wide variety of transactional
542data.<br><br>
543
544Amazon S3 transfer acceleration enables fast transfer of files over long
545distances between your client and your S3 bucket.<br>
546
547Transfer acceleration leverages Amazon CloudFront globally distributed
548edge locations to route data over an optimized network path.<br>
549
550For a workload in an S3 bucket that has intensive GET requests, you
551should use Amazon S3 with CloudFront.<br>
552
553When uploading large files, you should use multi-part uploads with
554multiple parts uploading at once to help maximize network throughput.<br><br>
555
556#### ❺ Access Patterns
557
558How you access data will affect how the storage solution performs.<br>
559
560Select the storage solution that aligns best to your access patterns, or
561consider changing your access patterns to align with the storage solution
562to maximize performance.<br><br>
563
564Creating a RAID 0 (zero) array allows you to achieve a higher level of
565performance for a file system than you can provision on a single
566volume.<br>
567
568Consider using RAID 0 when I/O performance is more important than fault
569tolerance.<br>
570
571**For example**, you could use it with a heavily used database where data
572replication is already set up separately.<br><br>
573
574Amazon EBS HDD-backed volumes include Throughput-Optimized HDD for
575throughput-intensive sequential workloads and the lowest cost Cold HDD
576for less frequently accessed data.<br><br>
577
578You can further optimize for how you use storage systems by using
579techniques covered in the
580[Partitioning or Sharding section]()
581of the Trade-Offs topic in this whitepaper.<br><br>
582
583#### ❻ Key AWS Services (Storage solutions)
584
585The key AWS services for storage solutions are **Amazon EBS, Amazon S3,
586and Amazon EFS** which `provide block, object, and file system storage
587solutions.`<br>
588
589These services have configuration options that further allow you to
590optimize your storage solution.<br>
591
592The access patterns your components have should influence the storage
593solution you select.<br><br>
594
595#### ❼ Resources
596
597Refer to the following resources to learn more about AWS best practices
598for storage.<br>
599
600**Documentation**<br>
601
602❁ [Storage](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Storage.html)<br>
603❁ [EBS Storage Types](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)<br><br>
604
605### ? C. Database
606
607The optimal database solution for a particular system can vary based on
608your requirements for availability, consistency, partition tolerance,
609latency, durability, scalability, and query capability.<br>
610
611Many systems use different database solutions for different subsystems
612and enable different features to improve performance.<br>
613
614Selecting the wrong database solution and features for a system can lead
615to lower performance efficiency.<br><br>
616
617Although a workload's database approach (**for example**, relational
618database management system or RDBMS, NoSQL, etc.) has significant impact
619on performance efficiency, it is often an area that is chosen according
620to organizational defaults rather than through using a data-driven
621approach.<br>
622
623As with storage, it's critical to consider the access patterns of your
624workload, and also to consider if other non-database solutions could
625solve the problem more efficiently (**for example**, using an object
626store such as Amazon S3, a search engine, or a data warehouse).<br><br>
627
628In on-premises environments, the tendency is to standardize on a common
629platform for ease of management.<br>
630However, in AWS there are services for each approach.<br>
631
632You should consider using different services for different types of
633data.<br>
634
635You can leverage your own platforms that you deploy on Amazon EC2 or use
636fully managed services, allowing you to have the benefits of
637best-of-breed solutions without management effort on your side.<br><br>
638
639#### ❶ Efficiency Factors
640
641There are many factors to consider when selecting your database
642approach.<br>
643
644**For example**, your access patterns will help you choose between
645different types of database technologies.<br>
646
647When selecting your database technology, keep in mind these four
648factors:<br>
649
650⍟ **Access patterns**<br>
651
652⍟ **Characteristics**<br>
653
654⍟ **Configuration options**<br>
655
656⍟ **Operational effort**<br><br>
657
658#### ? Access Patterns
659
660The way that you access data will affect how the database solution
661performs.<br>
662
663Select the database solution that aligns best to your access patterns,
664or consider changing your access patterns to align with the storage
665solution to maximize performance.<br><br>
666
667Optimize how you use database systems based on your access pattern (**for
668example**, indexes, key distribution, partition, or horizontal
669scaling).<br><br>
670
671#### ? Characteristics
672
673Consider the different characteristics you require (**for example**,
674availability, consistency, partition tolerance, latency, durability,
675scalability, and query capability) so that you can select the appropriate
676approach to use (**for example**, relational, NoSQL, warehouse).<br><br>
677
678#### ? Configuration Options
679
680Database solutions generally have configuration options that allow you to
681optimize for the type of workload.<br>
682
683Consider the configuration options for your selected database approach
684such as storage optimization, database level settings, memory, and cache.<br><br>
685
686#### ? Operational Effort
687
688You should consider the effort required to operate your technology
689choice.<br>
690
691The effort of managing and maintaining a database can vary greatly based
692on your technology choice and consumption approach.<br>
693
694You should also consider the effort required to scale these approaches
695as your requirements grow.<br>
696
697**For example**, databases that are provided as managed services remove
698or reduce the effort of managing database servers and their detailed
699configuration.<br>
700
701To further optimize your use of database systems, explore the techniques
702covered in the
703[Partitioning or Sharding section]()
704of the Trade-Offs topic in this whitepaper.<br><br>
705
706#### ❷ Database Technologies
707
708We commonly see four technology approaches used to address database
709requirements:<br>
710
711⍟ **Relational Online Transaction Processing (OLTP)**<br>
712
713⍟ **Non-relational databases (NoSQL)**<br>
714
715⍟ **Data warehouse and Online Analytical Processing (OLAP)**<br>
716
717⍟ **Data indexing and searching**<br><br>
718
719#### ? Relational Online Transaction Processing (OLTP)
720
721Most traditional applications run on an existing relational database,
722such as Oracle, Microsoft SQL Server, MySQL, or PostgreSQL.<br>
723
724These database engines provide high-performance, relational access to
725datasets.<br>
726
727You can make complex queries that will join and aggregate data from
728multiple entities.<br>
729The transactional model allows complex business requests.<br><br>
730
731You can `run these database engines on Amazon EC2 by:`
732
733* Installing the software on your own EC2 instances running Microsoft
734Windows or Linux
735
736* Using pre-configured Amazon Machine Images (AMIs), provided by AWS or
737by third-parties on the AWS Marketplace, with your database engine
738installed<br><br>
739
740There are `four distinct tasks for optimizing these databases:`<br>
741
742* **Optimizing the underlying instance** (compute, memory, storage,
743network) using the best practices presented in this whitepaper
744
745* **Optimizing the operating system settings** such as volume management,
746RAID, block sizes, and settings
747
748* **Optimizing the database engine configuration** and some
749database-specific features, such as partitioning
750
751* **Optimizing the databases themselves** by managing the schemas,
752indexes, views and database-related options<br><br>
753
754Amazon Relational Database Service (Amazon RDS) provides a fully managed
755relational database.<br>
756
757By leveraging Amazon RDS, you can keep using your existing database
758engine (Oracle, Microsoft SQL Server, MySQL, MariaDB, PostgreSQL) and
759benefit from an automated environment.<br><br>
760
761Amazon RDS also proposes a cloud-native database platform called Amazon
762Aurora.<br>
763
764Aurora is compatible with MySQL or PostgreSQL, & has an execution and
765storage environment that is purpose-built for AWS.<br>
766
767You will natively benefit from top-tier performance, with a convenient
768interface that is compatible with MySQL or PostgreSQL, and without
769licensing constraints.<br><br>
770
771`Optimizing an Amazon RDS database comes down to:`<br>
772
773* Selecting the appropriate configuration from the catalog of instance
774types, and the type of storage required
775
776* Tuning the database engine configuration using the options and
777parameter groups
778
779* Optimizing the database (schemas, indexes, views, and database-related
780options)<br><br>
781
782All other tasks are managed by the service.<br>
783Backup, patching, and point-in-time recovery are automated.<br><br>
784
785Some database engines provide options for running read replicas.<br>
786These replicas allow read-heavy workloads to use multiple servers instead
787of overloading a central database.<br><br>
788
789Amazon RDS provides automated read replicas (not available for Oracle or
790SQL Server) to scale out read performance, SSD-backed storage options,
791and provisioned IOPS.<br><br>
792
793Amazon Aurora has a fully redesigned, SSD-based storage layer that scales
794automatically as your needs grow, and supports a large number of
795low-latency read replicas for increased read performance.<br><br>
796
797#### ? Non-Relational Databases (NoSQL)
798
799New applications can be built without the constraints of managing a
800central relational OLTP database system.<br>
801
802These systems can leverage scalable distributed systems such as NoSQL
803databases.<br>
804
805These database platforms scale out and in by adding nodes to or removing
806nodes from the database cluster, making them great candidates for
807large-scale applications.<br>
808
809They also usually allow less structured data structures to be stored
810natively.<br>
811
812This limits the burden of schema management and makes them easy to use by
813application developers.<br>
814
815On the other hand, their scaling nature makes it difficult to run complex
816relational queries such as joining tables and entities to have an
817answer.<br>
818This work is usually deferred to the application layer.<br><br>
819
820You can run NoSQL databases, such as Cassandra, on EC2 instances, design
821their storage tier, optimize the operating system, and then run the
822engine.<br>
823
824You can have high-scale, high-performance platforms for your data needs
825by
8261. Leveraging instance storage and EBS volumes,
8272. Designing your clusters in multiple Availability Zones or Regions, and
8283. Ensuring you have the right model<br><br>
829
830**Amazon DynamoDB** `is a fully managed NoSQL database that provides
831single-digit millisecond latency at any scale.`<br>
832
833For internet-scale information, such as user profiles, shopping carts, or
834any other high volume read and write applications, Amazon DynamoDB can be
835configured to match your needs.<br>
836
837You can specify the exact amount of read and write operations per second
838that you expect your table to process.<br>
839
840Storage scales up and down automatically based on your usage of the
841platform.<br><br>
842
843Amazon DynamoDB has advanced features that increase the performance and
844ease of use of the platform:<br>
845
846* Amazon DynamoDB Accelerator (DAX) provides a read-through/write-through
847distributed caching tier in front of the database, supporting the same
848API as Amazon DynamoDB, but providing sub-millisecond latency for
849entities that are in the cache.
850
851* Amazon DynamoDB also supports throughput Auto Scaling, based on limits.<br><br>
852
853Amazon DynamoDB provides indexing features that allow you to efficiently
854query on any attribute (column).<br>
855
856You can also project attributes (copied from the table into the index) to
857improve performance.<br><br>
858
859Amazon DynamoDB manages table partitioning for you automatically, adding
860new partitions if necessary and distributing provisioned throughput
861capacity evenly across them.<br>
862
863To ensure that your load is evenly distributed across partitions, you
864should design for uniform data access across items in your tables by
865selecting an appropriate partition key.<br><br>
866
867#### ? Data Warehouse and Online Analytical Processing (OLAP)
868
869OLTP and NoSQL platforms are extremely useful for application
870deployment, but often have limitations for large scale analytics.<br>
871
872These use cases are better served by data warehouse platforms that are
873made for fast access to structured data.<br>
874
875Some advanced technologies are particularly adapted for data
876warehousing, such as columnar storage of information, or Massively
877Parallel Processing (MPP) environments.<br><br>
878
879You can host your existing Oracle or Microsoft SQL Server environment
880configured for data warehousing workloads.<br>
881
882Or you could benefit from specialized data warehousing platforms such as
883**Pivotal Greenplum**.<br>
884
885Alternatively, you could use cloud-native environments, such as
886**Snowflake**, by finding them on the AWS Marketplace.<br><br>
887
888**Amazon Redshift** `is a managed petabyte-scale data warehouse that
889allows you to change the number or type of nodes as your performance
890or capacity needs change.`<br>
891
892Use Amazon Redshift when you need SQL operations that will scale.<br>
893
894Amazon Redshift allows you to change the number or type of nodes in your
895data warehouse and scale up all the way to a petabyte or more of
896compressed user data.<br>
897
898Dense compute (DC) nodes allow you to create very high-performance data
899warehouses using fast CPUs, large amounts of RAM, and SSDs.<br>
900
901Amazon Redshift will provide the best performance if you specify sort
902keys, distribution keys, and column encodings as these can significantly
903improve storage, I/O, and query performance.<br><br>
904
905For increased ease of use, Amazon Redshift also supports `a query engine
906called` **Amazon Redshift Spectrum**, `providing the features of Amazon
907Redshift on data directly stored on Amazon S3.`<br>
908
909With Amazon Redshift Spectrum, you can request your data stored in Amazon
910S3 up to exabyte-scale data lake environments.<br><br>
911
912Some customers want to run analytics queries on large amounts of less
913structured data.<br>
914
915**Presto** is a powerful platform that accepts weakly structured
916data.<br>
917It `can query information at large scale from existing storage solutions
918and data lakes, such as Amazon S3.`<br>
919
920**Amazon Athena** `is a fully managed Presto service that can run queries
921on your data lakes.`<br>
922
923Its integration with the data cataloging features of **Amazon Glue** and
924its full serverless model give you strong query capabilities for your
925analytics platforms.<br><br>
926
927#### ? Data Indexing and Searching
928
929In many cases, you may need to index, search, and consolidate information
930at large scale.<br>
931
932This allows your users to access detailed information, and analyze this
933information following multiple angles.<br>
934Technologies such as search engines are particularly efficient for these
935use cases.<br>
936
937Use search engines when you want search or report with low latency and
938high throughput.<br><br>
939
940**Apache Lucene** `is a search engine platform that is widely used
941worldwide because it has been integrated in multiple platforms`, such as
942Elasticsearch.<br>
943
944**Elasticsearch** `provides an easy-to-use platform that can automatically
945discover and index documents at a really large scale.`<br>
946
947Elasticsearch is also at the center of a complete ecosystem that supports
948`reporting with` **Kibana** and `document or log aggregation with`
949**LogStash** and other providers.<br>
950
951Kibana provides a simple solution for creating dashboards and analysis on
952indexed data.<br><br>
953
954You can deploy Elasticsearch on EC2 instances, leveraging EBS volumes, in
955multiple Availability Zones for high-availability and high
956performance.<br>
957
958Elasticsearch supports scale-out, which is increasing capacity by adding
959new nodes to the cluster.<br><br>
960
961Amazon Elasticsearch Service **(Amazon ES)** `is a managed service in the
962AWS Cloud that makes it simple & cost-effective to set up, manage, and
963scale an Elasticsearch cluster for your cloud application.`<br>
964
965Amazon ES offers powerful scaling features on disk size or instance
966configuration (CPU, memory) and a model you can scale-out by adding
967nodes.<br>
968
969As your data or query volume changes, you can scale your search domain's
970resources up or down as needed.<br>
971
972You can control scaling if you know that you need more capacity for bulk
973uploads or are expecting a surge in search traffic.<br><br>
974
975#### ❸ Key AWS Services
976
977The key AWS services for database solutions are **Amazon RDS, Amazon
978DynamoDB, and Amazon Redshift**, `which provide relational, NoSQL, and
979data warehouse solutions.`<br>
980
981These services have configuration options that further allow you to
982optimize your storage solution.<br>
983
984The access patterns of your components should influence the storage
985solution you select.<br><br>
986
987#### ❹ Resources
988
989Refer to the following resources to learn more about AWS best practices
990for databases.<br>
991
992**Documentation**<br>
993
994❁ [Cloud Databases with AWS](https://aws.amazon.com/products/databases/)<br>
995❁ [Amazon Aurora best practices](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.BestPractices.html)<br>
996❁ [Amazon Redshift performance](http://docs.aws.amazon.com/redshift/latest/dg/c_challenges_achieving_high_performance_queries.html)<br>
997❁ [Amazon Athena top 10 performance tips](https://aws.amazon.com/blogs/big-data/top-10-performance-tuning-tips-for-amazon-athena/)<br>
998❁ [Amazon Redshift Spectrum best practices](https://aws.amazon.com/blogs/big-data/10-best-practices-for-amazon-redshift-spectrum/)<br>
999❁ [Amazon DynamoDB best practices](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/BestPractices.html)<br>
1000❁ [Amazon DynamoDB Accelerator](https://aws.amazon.com/dynamodb/dax/)<br><br>
1001
1002### ? D. Network
1003
1004The optimal network solution for a particular system will vary based on latency, throughput
1005requirements, and so on.<br>
1006
1007Physical constraints such as user or on-premises resources will drive location options, which
1008can be offset using edge techniques or resource placement.<br><br>
1009
1010In AWS, networking is virtualized and is available in a number of different types and
1011configurations.<br>
1012This makes it easier to match your networking methods more closely with your needs.<br>
1013
1014AWS offers `product features` (**for example**, enhanced networking instance types, Amazon EBS
1015optimized instances, Amazon S3 transfer acceleration, and dynamic CloudFront) `to optimize
1016network traffic.`<br>
1017
1018AWS also offers `networking features` (**for example**, Amazon Route53 latency routing, Amazon
1019Virtual Private Cloud (Amazon VPC) endpoints, and AWS Direct Connect) `to reduce network
1020distance or jitter.`<br><br>
1021
1022#### ❶ Location
1023
1024The AWS Cloud infrastructure is built around Regions and Availability Zones.<br>
1025
1026A Region is a physical location in the world having multiple Availability Zones.<br>
1027
1028Availability Zones consist of one or more discrete data centers, each with redundant power,
1029networking, and connectivity, housed in separate facilities.<br>
1030
1031These Availability Zones offer you the ability to operate production applications and
1032databases that are more highly available, fault tolerant, & scalable than would be possible
1033from a single data center.<br><br>
1034
1035Choose the appropriate Region or Regions for your deployment based on some key elements:<br>
1036
1037* **Where your users are located**:<br>
1038Choosing a Region close to your application's users ensures lower latency when they use the
1039application.<br><br>
1040
1041* **Where your data is located**:<br>
10421. For data-heavy applications, the major bottleneck in latency is when data is transferred
1043to the computing part of the application.
10442. Application code should execute as close to the data as possible<br><br>
1045
1046* **Other constraints**:<br>
1047Take into account constraints such as security and compliance.<br><br>
1048
1049#### ? Placement Groups
1050
1051Amazon EC2 provides placement groups for networking.<br>
1052A placement group is a logical grouping of instances within a single Availability Zone.<br>
1053
1054Using placement groups with supported instance types enables applications to participate in a
1055low-latency, 20-gigabits-per-second (Gbps) network.<br>
1056
1057Placement groups are recommended for applications that benefit from low network latency, high
1058network throughput, or both.<br>
1059
1060Using placement groups has the benefit of lowering jitter in network communications.<br><br>
1061
1062#### ? Edge Locations
1063
1064Latency-sensitive services are delivered at the edge using a global network of edge
1065locations.<br>
1066
1067These edge locations commonly provide services such as Content Delivery Network (CDN) and
1068Domain Name System (DNS).<br>
1069
1070By having these services at the edge, they can respond with low latency to requests for
1071content or DNS resolution.<br>
1072
1073These services can also provide geographic services such as Geo Targeting of content
1074(providing different content based on end users' location), or latency-based routing to direct
1075end users to the nearest Region (minimum latency).<br><br>
1076
1077**CloudFront** is `a global CDN that can be used to accelerate both static content such as
1078images, scripts, and videos, as well as dynamic content such as APIs or web applications.`<br>
1079
1080It relies on a global network of edge locations that will cache the content and provide
1081high-performance network connectivity to our users.<br>
1082
1083CloudFront also accelerates many other features such as content uploading and dynamic
1084applications, making it a performance addition to all applications serving traffic over the
1085internet.<br><br>
1086
1087**Route53** is `a highly available and scalable cloud DNS web service.`<br>
1088
1089It's designed to give developers and businesses an extremely reliable and cost-effective way
1090to route end users to internet applications by translating names, like www.example.com, into
1091numeric IP addresses, like 192.168.2.1, that computers use to connect to each other.<br>
1092
1093Route53 is fully compliant with IPv6 as well.<br><br>
1094
1095You should use edge services to reduce latency and to enable caching of content.<br>
1096
1097You need to ensure that you have configured cache control correctly for both DNS and
1098HTTP/HTTPS to gain the most benefit from these approaches.<br><br>
1099
1100#### ❷ Product Features
1101
1102In cloud computing, networking is critical, and therefore services commonly offer features to
1103optimize network performance.<br>
1104
1105You should consider product features such as EC2 instance network capability, enhanced
1106networking instance types, Amazon EBS-optimized instances, Amazon S3 transfer acceleration,
1107and dynamic CloudFront to optimize network traffic.<br><br>
1108
1109Amazon S3 content acceleration is a feature that lets external users benefit from the
1110networking optimizations of CloudFront to upload data to Amazon S3.<br>
1111
1112This makes it easy to transfer large amounts of data from remote locations that don't have
1113dedicated connectivity to the AWS Cloud.<br><br>