In Simplest terms, cloud computing means storing and accessing the data and programs on remote servers that are hosted on the internet instead of the computer’s hard drive or local server. It is also referred to as Internet-based computing.
Features of cloud
- No up-front investment (Non-mandatory)
- Lowering operating cost
- Highly scalable, resilient
- Easy access
- Reducing business risks and maintenance expenses
Amazon Web Services
Amazon Web Services is a subsidiary of Amazon.com that provides on-demand cloud computing platforms to individuals, companies, and governments, on a paid subscription basis.
Prerequisites: Go through Introduction to S3 before moving on to this article.
It is a content delivery network service that speeds up the distribution of static(Mostly S3) and dynamic web content (EC2 for static/dynamic) to the users. It keeps the content on the edge locations so that users can retrieve it easily whenever he requests it. It delivers the content with the best possible performance by routing the user at the closest edge location.
Working of AWS Cloudfront:
AWS Cloudfront delivers the content in the following steps.
Step 1: When the user sends a request for an object like an image file, DNS routes the request to the closest CloudFront edge location to serve the user request.
Step 2: At the edge location, the requested files are checked in its cache. If the requested files are found then it is returned to the user otherwise below steps are followed
- Cloudfront now forwards the request to the origin server for the particular file.
- The origin servers send the requested files to the CloudFront edge location.
- When the first byte of file arrives from the origin server, CloudFront starts forwarding it to the user and adds the files to the cache in the edge location for the next time when someone again requests for the same file.
Step 3: The object remains in the cache of edge location for the provided duration present in file headers.
- Cloudfront forwards the request for the object to the origin server to check if the file at the edge location is updated or not.
- If the version of the file at the edge location is updated, then CloudFront delivers the requested file to the user.
- If the version of the file at the edge location is not updated, then the origin server sends the latest version of the file to cloudfront edge location. Now cloudfront delivers the latest version of the object to the user and also stores it in the cache at the edge location.
Steps to set up cloudfront in AWS
Set up the S3 bucket on AWS management console
Step 1: Go to services in the AWS management console and type S3. Click on S3 services link.
Step 2 : Click on create bucket
Step 3: Write the name of the bucket, select the region. Click Create.
Step 4: The S3 bucket is created. Click on link of the bucket name.
Step 5: Click on upload to upload the desired files you want to store in S3.
Step 6: Click on Add files and add files from your system.
Step 7: The added file will be visible now. Now upload this file by clicking on the Upload button.
Step 8: The files are now uploaded in your S3 bucket and ready for use.
Set up the AWS cloudfront on AWS management console
Step 1: Search for cloudfront in services and click on cloudfront link
Step 2 : Click on create Distribution
Step 3: Click on Get Started
Step 4: Choose the origin domain name of the S3 bucket you created. Keep all the settings as default. Click on create a distribution.
Step 5: Our AWS cloudfront is created.