ladderlore
  • S3 သို့မဟုတ် IAM လို service အမည်ကို ရိုက်ထည့်ပါ။

သဘောတရား

Immutable infrastructure and deployments

Replace servers with new, tested images instead of changing them in place, so every instance is identical.

ဒီသင်ခန်းစာကို မြန်မာဘာသာ မပြန်ရသေးလို့ အင်္ဂလိပ်လို ပြထားပါတယ်။

Build and test
Golden AMI
Launch template
Auto ScalingEC2
  1. 1Build and test the image once, with the patch or release inside.
  2. 2Register it as a golden AMI.
  3. 3Create a new launch template version that points to the AMI.
  4. 4Auto Scaling replaces the old instances with new ones from that AMI.
A new image replaces the old instances. Nothing is patched in place.

အဆင့်ဆင့်

  1. 1Build and test the image once, with the patch or release inside.
  2. 2Register it as a golden AMI.
  3. 3Create a new launch template version that points to the AMI.
  4. 4Auto Scaling replaces the old instances with new ones from that AMI.

A new image replaces the old instances. Nothing is patched in place.

  • All at once

    Capacity during update
    Brief outage
    Rollback
    Redeploy
    Extra cost
    None
  • Rolling

    Capacity during update
    Reduced
    Rollback
    Redeploy
    Extra cost
    None
  • Rolling, extra batch

    Capacity during update
    Full
    Rollback
    Redeploy
    Extra cost
    Small
  • Immutable

    Capacity during update
    Full
    Rollback
    Terminate the new instances
    Extra cost
    A second fleet for a while
  • Blue/green

    Capacity during update
    Full
    Rollback
    Switch back, instant
    Extra cost
    A second full environment
Elastic Beanstalk deployment policies and blue/green, from cheapest to safest.

1 / 3

  • All at once

    Capacity during update
    Brief outage
    Rollback
    Redeploy
    Extra cost
    None
  • Rolling

    Capacity during update
    Reduced
    Rollback
    Redeploy
    Extra cost
    None

2 / 3

  • Rolling, extra batch

    Capacity during update
    Full
    Rollback
    Redeploy
    Extra cost
    Small
  • Immutable

    Capacity during update
    Full
    Rollback
    Terminate the new instances
    Extra cost
    A second fleet for a while

3 / 3

  • Blue/green

    Capacity during update
    Full
    Rollback
    Switch back, instant
    Extra cost
    A second full environment
Elastic Beanstalk deployment policies and blue/green, from cheapest to safest.

ဘာလဲ

In a mutable design you log in to a server and patch or edit it. Over time every server differs, which is called configuration drift, and a failed change is hard to undo. In an immutable design you never change a running server. You build a new image with the change (a golden AMI), start new instances from it and remove the old ones. To roll back, start the old image again.

ဘာလဲ

On AWS, bake the application and its patches into an AMI. Put the AMI ID in a launch template, which an Auto Scaling group uses to start instances. For a new version, create a new launch template version and replace the instances. Auto Scaling instance refresh does this in rolling batches and keeps a minimum percentage of instances healthy. Elastic Beanstalk offers deployment policies: all at once, rolling, rolling with an additional batch, immutable and traffic splitting. A blue/green deployment runs a full new environment next to the old one and switches traffic with a load balancer or Route 53 weights, so rollback is instant.

ဘာလဲ

Immutable designs need stateless servers whose settings come at launch from a parameter or secret store. They cut drift, make failures predictable and let you recreate an environment from code.

မှတ်ထားရန်

  • Replace, do not patch. Never log in to fix a production server.
  • Golden AMI + launch template + Auto Scaling group.
  • Instance refresh replaces instances in rolling batches.
  • Blue/green: two environments, switch traffic, roll back at once.
  • Elastic Beanstalk: all at once, rolling, rolling with additional batch, immutable, traffic splitting.

မှတ်ထားရန်

  • It needs stateless servers, with settings kept outside the image.

စာမေးပွဲမှာ

  • “Prevent configuration drift between servers” points to immutable infrastructure: a new AMI and replaced instances.
  • “Deploy a new version and roll back instantly” points to a blue/green deployment.
  • “Replace every instance in an Auto Scaling group with a new AMI, keeping most healthy” points to instance refresh.
  • “An Elastic Beanstalk update with the least risk” points to an immutable or blue/green deployment.