Amazon Web Services lection 6

46
AWS: architecture patterns Dmitriy Beseda Binary Studio 2016

Transcript of Amazon Web Services lection 6

Page 1: Amazon Web Services lection 6

AWS: architecture patterns

Dmitriy BesedaBinary Studio

2016

Page 2: Amazon Web Services lection 6

There are lots of metrics to build architecture

●Hardware

●Availability

●Performance

●Data transferring

●Database interaction

●Consistency

●Partitioning

●Security

●Network

●……..

Page 4: Amazon Web Services lection 6

Amazon Web Services1. There are ~63 services

2. According to selected region pricing and available services can different

Page 5: Amazon Web Services lection 6
Page 6: Amazon Web Services lection 6

Patterns

48+ patterns to implement apps

Page 7: Amazon Web Services lection 6

Snapshot

Page 8: Amazon Web Services lection 6

SnapshotBenefits:

●Limitless cloud storage

●Automating process via API

●S3 as a storage

●Not only data but also OS with settings can be backed up

Cautions:

●You must maintain data consistency when taking snapshots

Page 9: Amazon Web Services lection 6

Stamp Pattern

Page 10: Amazon Web Services lection 6

Stamp PatternBenefits:

●You can easily create as many EC2 instances with equal characteristics as you want.

●You can share AMI to give ability other users to launch such servers

Cautions:

●Hard to upgrade hardware characteristics.

●If you need to launch path - you should do this to all AMIs

Page 11: Amazon Web Services lection 6

Scale up (vertical)

Page 12: Amazon Web Services lection 6

Scale up (vertical)Benefits:

●It is easier to predict necessary resources, because you can upgrade them in few clicks.

●You pay only what you use

Cautions:

●30 seconds to few minutes latency during restarting new instance

Page 13: Amazon Web Services lection 6

Scale out

Page 14: Amazon Web Services lection 6

Scale outBenefits:

●Easy to increase performance automatically and manually

●Pay only for what you use

Cautions

●Scale group is equal by characteristics

●In case when lots of instances are required - not all can be launched immediately

●Scale out is pretty difficult

●If path or update is required it is necessary to make a snapshot and relaunch group

Page 15: Amazon Web Services lection 6

On-demand disk size

Page 16: Amazon Web Services lection 6

On demand disk sizeBenefits:

●You can easily increase/decrease your disk size

●Striping can improve I/O performance

●Secure disk space

Cautions:

●Securing costs for large amount of space (100Gb)

●Max single disk limit - 1Tb

Page 17: Amazon Web Services lection 6

Multi-Server Pattern

Page 18: Amazon Web Services lection 6

Multi-Server PatternBenefits:

●Redundancy provides durability

●Multi region running

●Automation of running new and turning of unnecessary instances

●Ability to spare internet gateways

Cautions:

●Cost (lots of instances can cost more than powerful one)

●Sharing data and synchronization are difficult (db, files, patches, upgrades)

Page 19: Amazon Web Services lection 6

Multi-Datacenter

Page 20: Amazon Web Services lection 6

Multi-DatacenterBenefits:

●You can structure a system that will continue to provide service even when there is a major failure on the data center level (earthquake and other natural disaster)

●High speed communication line between neighbors data-centers

●In AWS there are neither initial setup fees nor monthly use fees for each individual AZ, there is no difference in your cost regardless of whether you use a single AZ or multiple AZs

Page 21: Amazon Web Services lection 6

Multi-DatacenterCautions:

●For Dbs master can be only in one AZ

●During massive data transferring bottleneck problem is possible

●Elastic Load Balancing (ELB) does not support redundant structures that span regions

●To make maximum fault tolerance it is necessary to launch instances in all AZs, which is expensive

Page 22: Amazon Web Services lection 6

Floating IP Pattern

Page 23: Amazon Web Services lection 6

Floating IP PatternBenefits:

●You can swap servers by merely reassigning the EIP, unaffected by the TTL of the DNS

●Because you can apply EIPs across different Availability Zones (AZs), even if there were a failure on an AZ level, you can reassign the EIP to a server in a different AZ

Cautions:

●Switching an EIP normally takes several seconds

●When you make a Secure Shell (SSH) connection to a new instance behind an EIP, a potential security issue warning will be issued, and login may become impossible

Page 24: Amazon Web Services lection 6

Deep Health Check

Page 25: Amazon Web Services lection 6

Deep Health CheckBenefits:

●This makes it possible for you to check all of the servers required for system operation (even with details)

Cautions:

●If there is a large number of servers, then the health checks themselves will contribute to the traffic, so you must carefully consider the timing for the health checks

●In case with DBs health check will only show a problem which can already set all service down

Page 26: Amazon Web Services lection 6

Web Storage (Static)

Page 27: Amazon Web Services lection 6

Web Storage (Static)Benefits:

●The use of S3 eliminates the need to worry about network loads and data capacity

●S3 performs backups in at least three different datacenters, and thus has extremely high durability

●Because a URL is issued for each content object, the files can be used for a broad range of purposes, such as file sharing, merely through placement on S3

Cautions:

●Set up correct paths

Page 28: Amazon Web Services lection 6

Private Distribution Pattern

Page 29: Amazon Web Services lection 6

Private Distribution PatternBenefits:

●This enables delivery of private content through time-limited use by specified users only

●Because the actual content download is performed directly from S3 (rather than passing through an EC2 instance), the properties of S3 of being robust to load and to failures are directly applicable

Cautions:

●You must provide a validation system and a server for issuing time-limited URLs

Page 30: Amazon Web Services lection 6

Cache Distribution

Page 31: Amazon Web Services lection 6

Cache DistributionBenefits:

●This makes it possible for you to provide a better user experience to users in geographically distant places

●This lets you distribute the file download processes, which is useful in load distribution as well

●You can also use S3 directly as the origin, using it as an origin server

Cautions:

●Data can be old for some period time because of cache

Page 32: Amazon Web Services lection 6

Clone Server

Page 33: Amazon Web Services lection 6

Clone ServerBenefits:

●This lets you perform load distribution through Scale Out easily, without modifying the existing system

Cautions:

●The master EC2 instance becomes a single point of failure

●If DB runs on master - don’t run it on cloned volumes

●File uploading should be performed only by master instance

Page 34: Amazon Web Services lection 6

Other solutions for Dynamic content●NFS Share or replicating

●State sharing (locally stateless)

●Proxy patterns

Page 35: Amazon Web Services lection 6

Relational DB Replication patterns

Page 36: Amazon Web Services lection 6

Relational DB Replication patternsBenefits:

●This makes it possible to continue the operations without loss of data, even in the case of a disaster or failure

●Switching the access destination to the replicated database lets you apply a patch to a database without shutting down the system

●If the load in reading from a database is high, you can use this to distribute that load

Cautions:

●While this makes fail-over to the slave possible when a failure has occurred in the master database, be aware that the fail-over will require some downtime

Page 37: Amazon Web Services lection 6

In-memory DB

Page 38: Amazon Web Services lection 6

In-memory DBBenefits:

●You can use high-speed memory for the cache to reduce the load of reading from the database, improving overall system performance

●You can use ElastiCache to streamline the operation, and ElastiCache is robust to failures

Cautions:

●Using the cache may require you to modify the program that accesses the database

●You should consider the trade-offs when caching query results

Page 39: Amazon Web Services lection 6

RDS Sharding

Page 40: Amazon Web Services lection 6

Benefits:

●You can achieve higher availability through using RDSs as backend databases for sharding (in Multi-AZ)

●You can distribute the backend databases to multiple regions to provide improved performance in various regions of a worldwide system

Cautions:

●When the backend databases are distributed to multiple regions, encryption may be required when communicating with the sharding software

Page 41: Amazon Web Services lection 6

OnDemand NAT Pattern

Page 42: Amazon Web Services lection 6

OnDemand NAT PatternBenefits:

●This lets you maintain system security because there is no routing of access from within to the Internet except for during maintenance

●The NAT instance operates only during use, reducing costs

Cautions:

●Because, at the time of maintenance, operations are performed ranging from starting up the NAT instance through adjusting the routing of the subnets, it is safest if you automate these operations through a script, so that there will be no operator errors

Page 43: Amazon Web Services lection 6

Functional Firewall

Page 44: Amazon Web Services lection 6

Functional FirewallBenefits:

●Multi-tier access control improves security. The EC2 virtual servers are grouped by individual functions, eliminating the need to change the virtual firewall settings even when using the scale-out pattern

Cautions:

●While several different definitions are possible because virtual firewalls are logical entities, creating too many makes them difficult to understand, so you need to think about the granularity of the groups

Page 45: Amazon Web Services lection 6

Multi Load Balancer

Page 46: Amazon Web Services lection 6

Multi Load BalancerBenefits:

●The behavior (on the load balancer level) for mobile sites and PC sites can be different, even when using the same EC2 instance

●Even when multiple SSLs (HTTPS) are used by the same EC2 instance, you can prepare ELBs for each SSL (HTTP)

Cautions:

●When you use the SSL Termination function of an ELB, the EC2 instance side will be able to receive requests via HTTP, making it difficult to evaluate the HTTPS connection by the applications