# EC2

Q1. Difference between dedicated host and dedicated instance in EC2 purchasing option.

| Parameters                                | Dedicated Host                                                                                                                                                                                                                                                                                | Dedicated Instance                                                                                                                                                                                                                                                                                                                                                                                     |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Definition                                | An Amazon EC2 Dedicated Host is a physical server with EC2 instance capacity fully dedicated to your use. Dedicated Hosts allow you to use your existing per-socket, per-core, or per-VM software licenses, including Windows Server, Microsoft SQL Server, SUSE, and Linux Enterprise Server | Dedicated Instances are EC2 instances that run on hardware that's dedicated to a single customer. Dedicated Instances that belong to different AWS accounts are physically isolated at a hardware level, even if those accounts are linked to a single payer account. However, Dedicated Instances might share hardware with other instances from the same AWS account that are not Dedicated Instance |
| Billing                                   | Per-host billing                                                                                                                                                                                                                                                                              | Per-instance billing                                                                                                                                                                                                                                                                                                                                                                                   |
| Visibility of sockets, cores, and host ID | Provides visibility of the number of sockets and physical cores                                                                                                                                                                                                                               | No visibility                                                                                                                                                                                                                                                                                                                                                                                          |
| Automatic instance recovery               | Supported                                                                                                                                                                                                                                                                                     | Supported                                                                                                                                                                                                                                                                                                                                                                                              |
| Host and instance affinity                | Allows you to consistently deploy your instances to the same physical server over time                                                                                                                                                                                                        | Not supported                                                                                                                                                                                                                                                                                                                                                                                          |
| Capacity Reservations                     | Not supported                                                                                                                                                                                                                                                                                 | Supported                                                                                                                                                                                                                                                                                                                                                                                              |

Q2. Difference between EBS and EFS

|  Parameters  |                                                   EBS                                                   |                      EFS                      |
| :----------: | :-----------------------------------------------------------------------------------------------------: | :-------------------------------------------: |
|  Definition  |                              Elastic Block Store, network attached volumes                              |              Network file system              |
| Multi-attach | Can attach to single EC2 instance at a time, except io1/io2 volume types _(16 EC2 instances at a time)_ |   Can attach to any number of EC2 instances   |
|     Scope    |                                          Restricted to AZ level                                         |           Not restricted at AZ level          |
|     IOPS     |        Increases as disk size increase except io1, for which IOPS can be increased independently        |       IOPS is independent of disk space       |
|   Migration  |                           Take a snapshot in one AZ and restore in another AZ                           | Available in multiple AZ unless using OneZone |
|    Pricing   |                                       Lower price compared to EFS                                       |                   Expensive                   |
