AWS SAA study notes 06

17 May, 2021
Back

Index

  • EIP on ELB
  • Glacier Vault Lock
  • S3 components
  • Transferring object ownership in S3
  • EBS volume termination
  • New AMI in ASG
  • Cache locations
  • Caching strategy
  • Cloud Map
  • Step Functions

EIP on ELB

  • You can assign an EIP to an NLB, but not an ALB.
  • If the ALB needs and EIP, place an NLB with an EIP in front of it.
  • EIP (Elastic IP address), ALB (Application Load Balancer), and NLB (Network Load Balancer).

Glacier Vault Lock

  • Vault lock policy can be used to prevent data deletion for a set period of time (eg. 365 days). The policy is immutable, preventing anyone from deleting the data before expiry.

S3 components

  • Bucket name is globally unique.
  • Object key uniquely identifies the object. Use object key if querying the object with S3 Select.
  • Object metadata is a name-value pair about the object.
  • Object tag is a key-value pair to categorize objects.

Transferring object ownership in S3

  • S3 objects are owned by the account that uploads them.
  • Steps to transfer ownership if source S3 account is different from the destination S3 account.

    1. Enable cross-account permissions via IAM customer-managed policy.
    2. Attach policy to the new owner's account.
    3. Use the new owner's account to copy the objects over to her own S3 bucket.

EBS volume termination

  • Root volumes is deleted when an instance is terminated (default).
  • Non-root volumes are preserved when an instance is terminated (default).
  • To preserve root volumes, set DeleteOnTermination to false. AWS Ref.
  • Recall that root volumes are the ones that contain the image to literally spin up the instance. AWS Ref.
  • Not to be confused with boot volumes (available in EBS SSD classes) - the partitions that contains the OS.

New AMI in ASG

  • You only need to create a new launch configuration if you need a new AMI.
  • Then attach it to the ASG.

Cache locations

You can perform caching at four locations:

  1. Client - at the browser
  2. Internet - via CloudFront
  3. Web - with ELB or DynamoDB
  4. App - with DynamoDB
  5. Database - with ElastiCache

Caching strategy

  • Lazy loading is a caching strategy that loads the data only when there is a cache miss. AWS Ref.
  • Cache hit is when the requested data is found in the cache.
  • Cache miss is when the data is absent.
  • Cache churn is unused data that waste space.
  • The advantages of lazy loading is:

    • Cache space doesn't quickly fill up.
    • Cache node failures are not consequential. Requests to newly restored nodes will be empty initially, but that's ok.
  • The disadvantages of lazy loading are:

    • Each cache miss will result in 3 trips.
    1. Initial request to cache.
    2. Request to db.
    3. Write to cache.
    • There will be stale data because updates to db is not known to the cache.
  • There are two strategies to reduce the effects of the penalties.

    • Write-through updates the cache and db for every request.
    • Adding TTL (time to live) reduces cache churn by expiring them.

Cloud Map

Cloud Map is a resource discovery service that allows you to register resources and perform health-checks on them.

  • You can use Cloud Map to build and troubleshoot microservices.

Step Functions

  • Step Functions allow you to coordinate microservices, set triggers and tracking, and catch errors.
  • This allows you to orchestrate your Lambda functions to run:

    • In series
    • In parallel
    • Retries
    • If else
  • Suitable for state machines. Applications where the next steps are dependent on previous outputs.

Back