AWS Notes
AWS Notes
AWS Notes
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
Virtualization open source: Xen Hypervisor
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
SOAP : Simple Object Access Protocol. Uses XML. Too Comprehensive & Extremely
flexible.
REST : Representative State Transfer. Uses JSON. Less Comprehensive, more
importance to Security.
Sample REST call:
http://search.examplecompany.com/CompanyDirectory/EmployeeInfo?
empname=BernardGolden
JSON: Javascript Object Notation
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
Two Security Keys: I) Access Keys II) Secret Access Key.
1: Encript the pay load using Secret Access Key. 2: Digitally sign the encrypted
payload with the Secret Access Key. C: Send the total encrypted payload along with
Access Key. D: Amazon uses the Access key to look up secret Access Key and decrypt
the payload.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
4 Types of AWS Storage:
Simple Storage Service (S3) : Object Storage. also called as filing cabinet of the
internet"
Elastic Block Storage (EBS) : Volume storage attached to Virtual Machine.
Glacier: Data archiving solution. Called as Glacier Vaults.
DynamoDB: Key Value storage. Schema is flexible.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
Two Storage forms:
Network Attached Storage (NAS) : Extension of local file storage
Storage Attached Network (SAN) : Remote storage, need a special protocol to
communicate
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
S3 Bucket names are global (unique across entire AWS).
Buckets are located in a particular region.
S3�s URL object addressing allows data to be accessed from within AWS as well as
externally from the Internet.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
EBS: Attached to instances to provide additional storage. EBS Volume is
independent. It can be attached to any instance. It is network based. delivered in
volumes and can be attached to EC2 instance just like hard drive. It must have a
file system installled (Formated). Even if the EC2 instance terminates/crashes, EBS
is safe. It can be used as a file system for a database server. EBS volume ranges
form 1GB to 1TB.
IOPS: I/O Operations per second. AWS offers provisioned IOPS that delivers 500 to
4000 IOPS of guaranteed throughout of volumes.
EBS Snapshots Vs Backup: EBS snapshots are useful if you want to re-create storage
in AWS; database backups are useful if you want to restore a database either in AWS
or somewhere else.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
Dynamo DB: To insert a row, Dynamo DB hashes the index value and places the row
randomnly thorughout the storage pool. When you request that row, DynamoDB again
hashes the index value, goes to the location that the hash identifies, retrieves
the data, and gives it back to you. We can define index as Hash-and-Range, in order
to create a secondary index associated with the table. E.g Create a customer table
index using sequential customer number with an associated range of Pin codes.
Cannot pass queries like "Give me all customer name with John". Cannot use Joints
like "Customer name is John and city is Delhi".
by randomly distributing the data around the resource pool, the storage spreads
reads and writes among all servers in the pool, thus avoiding hammering a single
server, which would reduce performance.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
EC2: provides virtual servers in a matter of minutes, all via self-service.
Provides accelerated provisioning access (a huge IT innovation).
Unlike Virtual Machines, where the storage requirements are same with a running
virtual machine and a quiescent virtual machine. This leads to have a wasted
storage space. AMI's with EBS storage is like traditional virtualization.
S3-backed EC2 instances don�t store changes made to the file system when the
instance is shut down (terminated). The next time the image is launched, the
running instance reflects the layout of the image as originally created.
S3 images: are stored as multiple 10MB files, along with a special XML file called
a manifest. When you give AWS the command to launch an S3-backed image, the system
reads the manifest file and uses it to construct and launch the instance by
downloading it to the instance�s local drive.
Root device limitations of S3 images: With S3-backed images, all you have is the
root device � the part of the system containing system files (including the
operating system) � plus, any other software that was installed when the image was
created. The issue is that "if you want to include a lot of software packages or
data in the root device, you may exceed this 10GB limit." Note: EBS-backed images
allow for much larger root volumes than S3-backed images.
The AWS management console doesn�t support the creation of a new image from an S3-
backed instance. If you want to create a new image from an S3-backed instance,
first install AWS AMI tools on the instance, and then run scripts to create the
image.
AWS user community perfers EBS backed images. The primary reservation related to
the EBS is about inconsistent EBS throughput performance associated with network
contention. This issue can be addressed by launching an EBS-backed instance with
Provisioned IOPS.
Key Decisions regarding EC2 Instance: Image Type, Processing Power (# of ECUs - EC2
Compute Units), Memory & Storage.
Few Instance type families: 1: Micro (very small), 2: Standard, 3: High CPU, 4:
High Memory (database apps, analytics apps..), 5: High I/O, 6: Cluster Compute (a
large number of ECUs along with highperformance networking. well suited for high-
performance computing tasks - very large applications for specialized number
crunching, like oil field seismic analysis). 7. Cluster GPU (focus on Graphics)
EC2 Pricing: On-Demand, Reserved & Spot (bid on unused AWS capacity). Pinterest
leverages spot-price.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
TCP/IP Layer-1: Physical Layer. Wireless Access points, LAN cables.
TCP/IP Layer-2: Data-Link Layer. Hosts, Domain Name, Subnets residing in the same
network (LAN). These entities typically have a network interface card (NIC), each
of which carries a unique identifier � its Media Access Control (MAC) address.
Layer 2 specifies how two entities with MAC addresses can send data to one another.
TCP/IP Layer-3: Network Layer. Controls the flow of data between network entities
residing on different networks (WANs). layer. Layer 3 most commonly works by using
the Internet Protocol (IP).
AWS dynamically assigns IP addresses from within its own IP address range. AWS
assigns two IP addresses to an instance�s VNIC: a public IP address and a private
IP address (10.X.X.X). Traffic within local AWS network (private IP address) cost
lesser compared to the traffic with public IP address.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
Amazon Direct Connect: It lets a user put a private circuit between his data center
and AWS to enable traffic to flow across a dedicated network connection, with no
use of the public Internet. Two levels of Direct Connect bandwidth: 1 Gbps and 10
Gbps.
Elastic IP address: which is a public IP address assigned to your account that can
be substituted for the temporary public IP address that�s assigned to your instance
at launch-time. You run the instances with the Elastic IP address. Traffic flows to
the address and then to your instance.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
Security Groups: Simillar to Linux security groups. To allow traffic into an
instance, open one or more ports by creating a security group rule for the default
security group. Control access to EC2 instances.
Webtier security Group: Port 80. Business Logic security Group: Port 4555. Database
security Group: Port 3306. Dedicated security group: Port 22.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
CloudFront: a CDN, Content Delivery Network
CloudFront serves both static content (S3) and dyamic content (cloudFront). Serves
HTTP, HTTPS & RMTP protocol (streaming Adobe Flash based videos). Set expiration
date to the content.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
ElastiCache: caching the database. It runs simillar to RDS. is protocol-compliant
with memcached (used by Twitter, Wikipedia, Flickr..).
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
Elastic MapReduce: With so much data, it makes sense to move the processing to the
data rather than attempt to move the data to the processing. MapReduce takes a very
large datastore that may be spread across hundreds or thousands of machines and
formats the data to structure it for the type of analysis you want to perform (that
is, it maps the data into an analyzable format), and then you filter the data
(reduce the mapped data, in other words) to isolate the information you want to
examine.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
Redshift: a columnar SQL DW service
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
Elastic Beanstalk: Developer-oriented Elastic Beanstalk service is designed to let
you move applications as easily as possible from the development environment to
production in AWS � such as moving code from a laptop to AWS in the shortest
possible time. Comparable to the Platform as a Service (PaaS) 'development
environment'. Application based on Web and Database ( 3Tier).
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
Horizontally scaling: Use of multiple computing instances sharing the load in a
single application tier. Horizontal scaling is a technique for applications to
support load greater than a single instance can handle. Preferred for webscale
applications.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------
SSH: uses a combination of a public key and a private key. The administrator holds
the private key on the client machine. The remote resource (the AWS instance) holds
the public key. The client machine makes an SSH connection and presents the private
key. The remote resource uses the private key and confirms that it matches the
public key and then, assuming that they match, allows SSH access to the remote
resource.
-----------------------------------------------------------------------------------
------------------------------------------------------------------------