# Basics

## Overview

<figure><img src="https://4257107599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO7iF3qcu25MOrAYlRsn6%2Fuploads%2FkvCEYQ8FjJs1Jb2mWBZH%2Faws-cheatsheet.webp?alt=media&#x26;token=530925b7-4582-49f9-8001-4fbe613706ec" alt="Wheel of AWS Services"><figcaption></figcaption></figure>

## Cloud Computing

### Cloud Computing Models

{% tabs %}
{% tab title="Infrastructure (IaaS)" %}
**Infrastructure as a Service (IaaS)**

* If we need to launch a Linux Server and we want to manage it ourselves, that is how we would do as an IaaS model.
* Usually the cloud provider won't have access to the server.

Ex.:

> VPC\
> EC2\
> EBS
> {% endtab %}

{% tab title="Plataform (PaaS)" %}
**Plataform as a Service (PaaS)**

* This is where AWS will take a bit of more control.
* AWS manages the underlying infrastructure.
* Usually hardware and operating system.

So if we want a relation database service, we still have to manage all the high level administration of that database.

Ex.:

> RDS\
> EMR\
> ElasticSearch
> {% endtab %}

{% tab title="Software (SaaS)" %}
**Software as a Service (SaaS)**

* Completed product that is run and managed by the service provider.
* Mostly refers to end-user applications.

Ex.:

> Web-based email\
> Office 365\
> Salesforce
> {% endtab %}
> {% endtabs %}

### Cloud Computing Deployment Models

**Public Cloud**

* Fully deployed in the cloud and all parts of the application run in the cloud.

Ex.: AWS, Azure, GCP.

**Hybrid**

* A way to connect infrastructure and applications between cloud-based resources and existing resources that are not located in the cloud.
* A mix of public and private.
* Run AWS Infrastructure and services on premises with `AWS Outposts`.

**Private Cloud (On-Premise)**

* Deploying resources on-premise, using virtualization and resource management tools, is sometimes called "Private Cloud".
* You manage it in your datacenter.

### Serverless Computing

* Allows you to build and run applications and services without thinking about servers.
* Also referred to as Function as a Service (FaaS) or Abstracted services.

Ex.:

> Amazon Simple Storage Service (S3) (To storage files)\
> AWS Lambda (To run code in the cloud)\
> Amazon DynamoDB (NoSQL databases)\
> Amazon Simple Notification Service (SNS) (To send notification messages to your users)

## Business Case for AWS

> *Why use AWS or Cloud Computing?*

### 6 Advantages of Cloud Computing

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td>Trade <strong>fixed</strong> expense for <strong>variable</strong> expense.</td><td><ul><li>Avoid investing in data centers and local servers, and pay only for used computing resources.</li></ul></td><td></td></tr><tr><td>Benefit from massive <strong>economies of scale</strong>.</td><td></td><td></td></tr><tr><td>Stop guessing capacity.</td><td></td><td></td></tr><tr><td>Increase <strong>speed</strong> and agility.</td><td><ul><li>In getting our services and products to market quickly.</li><li>You can lauch an infrastructure within minutes, and be up and running in a very short amount of time.</li></ul></td><td></td></tr><tr><td>Stop spending money on running and maintaining data centers (On-premise).</td><td></td><td></td></tr><tr><td>Go global in minutes.</td><td></td><td></td></tr></tbody></table>

### Cloud Architecture Design Principles

**Design for Failure** *(Multi-AZ, Multi-Region)*

<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Single Region - Single AZ</strong></td><td><ul><li><strong>High latency</strong> for global availability, <strong>no failure</strong> design handle.</li></ul></td><td></td></tr><tr><td><strong>Single Region - Multiple AZ</strong></td><td><ul><li><strong>High latency</strong> for global availability, <strong>high failure</strong> tolerance.</li></ul></td><td></td></tr><tr><td><strong>Multiple Region - Active-Active</strong></td><td><ul><li><strong>Low latency</strong> for global availability, <strong>high failure</strong> tolerance.</li><li><p><code>Active-Active</code> means that each <code>Region</code> is able to independently serve user traffic.</p><ul><li>Must have loose coupling between <code>Regions</code>.</li><li><a href="https://medium.com/@christopheradamson253/multi-region-active-active-architectures-for-zero-downtime-0fecbcd36d9b">More details here</a></li></ul></li></ul></td><td></td></tr><tr><td><strong>Multiple Region - Active-Passive</strong></td><td><ul><li><p><strong>High latency</strong> for global availability, <strong>high failure</strong> tolerance.</p><ul><li><code>Active-Passive</code> means that only one is an active instance handling requests, while other ones are passive operating in standby.</li></ul></li></ul></td><td></td></tr></tbody></table>

**Elasticity (Autoscaling)**

*Should expand and contract based on demand.*

**Loose Coupling**

* Services should be independent.
* Should scale independently.
* Should converse through a `Event Bus`.
* *Basically follow a* `Microservice Architecture`*.*

### **AWS Well-Architected Framework Design Principles**

* Stop guessing your capacity needs.
* Test systems at production scale.
* Automate to make architectural experimentation easier.
* Allow for evolutionary architectures.
  * *Always keep improving the architecture.*
* Drive architectures using data.
  * *Analyzing the data that comes from it, to make it better.*
* Improve through game days.
  * *Conduct simulations on your environment and try forecast what is going to happen.*

### AWS Well-Architected Framework 6 Pillars

* **Operational Excelence**: Focuses on running and monitoring systems, and continually improving processes and procedures. *(Automating changes, responding to events)*
* **Security**: Focuses on protecting information and systems. *(Confidentiality and integrity of data, managing user permissions)*
* **Reliability**: Focuses on workloads performing their intended functions and how to recover quickly from failure. *(Distributed system design, recovery planning)*
* **Performance Efficiency**: Focuses on structured and streamlined allocation of IR and computing resources. *(Selecting resource types and sizes, monitoring performance)*
* **Cost Optimization**: Focuses on avoiding unnecessary costs. *(Selecting resources of the right type and quantity, scaling without overspending)*
* **Sustainability**: Focus on minimizing the environmental impacts of running cloud workloads. *(Shared responsability model for sustainability, minimize required resources)*

### Benefits of AWS Security

* **Keep Your data safe**: The AWS infrastructure puts strong safeguards in place to help protect your privacy.
* **Meet complience requirements**: AWS manages dozens of compliance programs in its infrastructure.
* **Save money**: Cut costs by using AWS data centers. Maintain the highest standard of security without having to manage your own facility.
* **Scale quickly**: Security scales with your AWS Cloud usage. No matter the size of your business, the AWS infrastructure is designed to keep your data safe.

### Why change to AWS?

* **Cost Savings**:
  * Changing from an upfront capital investment to a pay as you go pricing model.
  * Free up budget for investment elsewhere.
* **Staff Productivity**:
  * Staff no longer will have to worry about managing physical servers.
  * Teams can work on higher value activities.
* **Operational Resilience**:
  * Increased reliability, availabiloity and security.
* **Business Agility**:
  * Increased innovation and reduced time to market.

**Migration Best Practices**

1. Get stakeholders and senior leaders aligned.
2. Set Top-down quantifiable goals - focused not organic.
3. Trust the process - Assess -> Mobilize -> Migrate & Modernize.
4. Choose the right migration pattern:
   * `Refactor`: Will completely redesign your architecture and all of the underlying infrastructure.
   * `Re-plataform`: For instance, going from Windows server to Linux.
   * `Repurchase`:
   * `Rehost` (lift and shift): Simply move to another location.
   * `Relocate` (VMware, Hyper-V): Relocate your virtual structure.
   * `Retain`:
   * `Retire`: Retire the old system.

### AWS Compliant to

* `SOC 1` / `SSAE 16` / `ISAE 3402`
* `SOC 2`
* `SOC 3`
* `FISMA`, `DIACAP`, and `FedRAMP`
* `DOC CSM Level 1-5`
* `PCI DSS Level 1`
* `ISO 9001` / `ISO 27001`
* `ITAR`
* `FIPS 140-2`
* `MTCS Level 3`
