a verse of code

Understanding the cloud and how easy it is to start using cloud computing for your website

I’ve been asked a few times lately about cloud computing and using the cloud for your web site/services so I thought I would share a little.  I’ve been using the cloud for a couple years now for various services (mainly storage). As it’s popularity continues to grow and standards for cloud computing continue to form, I think the ability to efficiently optimize many aspects of your website with cloud computing is definitely worth it’s interest!  Let me share with you…

cloud

What is cloud computing?

This is probably the biggest question.  What the hell is cloud computing?

So lets think of the traditionally conventional method of a website and how it is connected to the internet. You have a server, which is nothing much more than a computer configured to host a website and a connection to the internet.  Your server has disk space, computing process power and applications that allow you to make the processing power and disk space accessible through connections to the internet.  The disk space holds all of the files and applications that run your website and the processing power is responsible on how quickly these files and applications can deliver results to the end user.

So it has always been thought that the more disk space you have for your website, faster processing power, and faster internet connection you have available will provide the best results for your web site.  The problem with this is it really isn’t that efficient and can be very costly to have a server and internet connection like this.  You could be potentially paying monthly payments for unused disk space and bandwidth.

This is where cloud computing comes in.

Instead of thinking of a website that resides on a server (or a discrete number of servers), with a discrete number of processes and a discrete number of connections to the internet, we have the cloud.  The cloud is a software as a service (this is what we call Amazon’s S3, EC3, and CloudFront, for example) which actually is a large network of servers and connections virtualized.

Amazon’s service is a massive software application that is responsible for where files are stored, where processing power comes from and what connection to use to serve your files.

So now Amazon has this ambiguous enigmatic mecca server (the cloud) that everyone shares its storage, processing and distribution power.  The beauty of this is each user of the cloud no longer has to purchase or allocate so much memory and processing power for their website, instead using a SaaS such as Amazon allows you to only use what you need.  This means you only pay for the storage you use, the processing you generate and the number of requests you make.

Everything is incremental and becomes very efficient for you.

With cloud computing services you no longer pay for a large server of gigs upon gigs of memory where you only use maybe 10% of it and a large throttle of bandwidth which you’ll be lucky to use 10% of that. Now with a company such as Amazon, they can provide you with a service, to host files, to provide you with strong processing power, and efficiently fast deliverability.  A website now can be optimized by using cloud computing services to host files and process tasks.

What about the security of the cloud?

The next question raised is the matter of security.  Having a non-finite number of users who access and use the cloud opens potential vulnerabilities which would allow the wrong exploit to cause massive damage.  The security of the files are currently controlled by ACL settings and internal security settings of your cloud service provider.  Since you don’t know the exactly physical location of your files and exactly where your process is coming from, you’re putting a lot of trust in your cloud service provider (such as Amazon) on the integrity of your files, yet that will soon be regulate as standards of the cloud come into play.  I read an article that said there are 8 (or possibly more) groups working on creating the standards for the cloud.  As early as the cloud concept is, I think its only going to better in time.

Should I use the cloud?

I definitely think you should. Actually, a hybrid of the cloud and a secure server setup.  Think of it like this, continue to use your server(s) like you would to host your website, but outsource the less important things to the cloud.  This means public images, video files, PDFs and such (mostly media) should be stored and hosted on the cloud where the more important private and secure files are still on your main server setup.

What this will do is allow you to use a server setup with less hard disk space allocated to files and less bandwidth for delivering the files.  The cloud will host the files and efficiently deliver the files faster (as a service). Now you can be more economical by only paying for the hard drive space and bandwidth you need.

How to get started on the cloud

It’s actually easy than you can imagine to using the cloud. I’ve been using Amazon S3 (Simple Storage Service) and CloudFront to delivering files on a website.  Amazon S3 is a storage solution that allows you to store files as either a public or private storage box.  Using Amazon S3 for your website will make your files public, but very efficient on the amount of disk space and bandwidth you use, since you only pay for what you use.

Here are the current prices on Amazon S3: http://aws.amazon.com/s3/#pricing

As you can see there are 3 different things you can be charged for:

  • Storage – This is a price you pay per GB that your files are being hosted on S3
  • Data Transfer – This is a price you pay per GB of transfer you make to and from S3
  • Requests - This is the price you pay on the number of actions you make on the S3 service.

Amazon provides a monthly calculator to see how much it would cost to use their AWS services here: http://calculator.s3.amazonaws.com/calc5.html

Now that you’ve gotten an idea on how much it will cost to use Amazon S3, the next step is actually using it.

Transferring files is as simple as using a software application that looks similar to your favorite FTP application.  I like to use Cloudberry which available free to download here: http://cloudberrylab.com/default.aspx?page=cloudberry-explorer-amazon-s3

After you’ve installed Cloudberry, you’ll need to connect Cloudberry to your Amazon S3 account.

Here’s how you can do this:

  1. Open CloudBerry and click File->Amazon S3 AccountsaddS3account
  2. Double-click New Accountnewaccount
  3. Give your Account a name (if you plan on connecting to more than one Amazon S3 Account this is useful, otherwise you’ll probably only have one S3 account).
  4. Next you’ll need two things from your Amazon Web Services account.  Go to http://aws.amazon.com and login to your Amazon account.
  5. Click on Your Account->Security CredentialssecurityCredentials
  6. You should see a Access Keys tab, if you don’t have one created yet, create one.  You’ll need the access key ID and secret access key.accessKeys
  7. Enter both of these values into Cloudberry.  At this point Cloudberry is connected to your Amazon S3 Account and you’re ready to start uploading files to the cloud!
  8. You’ll notice that Cloudberry looks similar to an FTP client.  On the left side is your computer then (after selecting your S3 account from the drop down box) on your right side your Amazon S3 account.selectS3
  9. Now you’ll need to create a bucket.  A bucket is Amazon’s terminology for a folder to store files on the cloud.  Click the blue bucket icon to create a new bucket.createBucket
  10. After you’ve created a bucket, you can upload files to that bucket simply by browsing and dragging files from your computer on the left to the bucket on the right.uploadFiles
  11. Next we need to set the ACL settings of the file so that it is accessible by other websites.  Right click the file on your S3 account on the right, choose ACL->ACL Settings and click on [Public (everyone)]. Click [Ok] and now the file is public for access.aclSettings
  12. Finally we need to know the absolute URL of the file to access.  Right-click the file and choose [Web URL]. This will show you the absolute URL of your file.  For example, if you’re using S3 to host your images, you can use this URL when referencing it on your website as the source of the image.absoluteURL
  13. That’s it you’re now successfully using the cloud to store and access a file for your website.

A step further…

If you want to optimize the use of the cloud further you can also use your Amazon S3 files in conjunction with Amazon’s CloudFront.  Amazon CloudFront is a network of edges (locations where files can reside) which will make your file accessible from multiple locations to improve on latency and bandwidth.  Amazon CloudFront will optimize the delivery of your file, by delivering your file to the closest location the file resides.

Think of it like this, you’re neighbor recently viewed a file on Amazon S3, instead of requesting Amazon S3 for the file again, Amazon CloudFront will be able to see that the file was recently accessed from a closer position and deliver it to you faster.  This does decrease the bandwidth costs of your Amazon S3 account, but is made up by using Amazon CloudFront.  Actually the bandwidth rates are the same, so to use Amazon CloudFront or not, will not drastically effect the cost of using Amazon Cloud services.

Using the CloudFront will actually be much more efficient for your website by delivering files to your web users much faster.

Here are Amazon CloudFront prices: http://aws.amazon.com/cloudfront/#pricing

Here’s how you can integrate Amazon CloudFront with your Amazon S3 account:

  1. Open Amazon’s AWS Management Console here: https://console.aws.amazon.com/cloudfront/home
  2. Click [Create Distribution]createDistribution
  3. Select your Amazon S3 Bucket you created above and click [Create]selectBucket
  4. Now you need to modify the URL that you got in step 12 above so that it is hitting Amazon CloudFront’s edge network.  For example the file I added has an absolute URL of http://anthonymontalbano.s3.amazonaws.com/anthony.jpg
  5. We need to replace the bucket URL (which is anthonymontalbano.s3.amazonaws.com with the edge network of d34k2wyjxt4ma5.cloudfront.net)  so my new URL for my file hosted on the cloud is http://d34k2wyjxt4ma5.cloudfront.net/anthony.jpgcloudFront
  6. That’s it! You are now using two Amazon cloud services to distribute and deliver files to your website efficiently and much more cost effective than before!

Side note: If you’re comfortable setting up CNAME you can create one to hide the dirty URL that Amazon gives you.  This means that a URL such as http://d34k2wyjxt4ma5.cloudfront.net/anthony.jpg and simply become http://media.room3064.com/anthony.jpg. To do this you will need to edit your DNS settings with your webhost that is managing your website.

Summary

Hopefully by now you have a better idea of what the cloud is and how you can use it to deliver content on your website much more efficiently and maybe save you some money as well.  As the cloud evolves and standards and services become more available, the idea of the cloud can be used to host a website in it’s entirety!  Actually for files that are accessed by more than one web location, we can be much more efficient with delivering these files using the cloud.  Get use to the idea that a file doesn’t have one simple location (or cached location) to access it, yet it’s true location is managed and delivered by the cloud to speed up efficiency.

I think as the potential behind the technology and services will create a whole new dynamic for how we build, design, and manage websites.

So, are you on the cloud yet?

4 Responses to “Understanding the cloud and how easy it is to start using cloud computing for your website”

  1. harry says:

    thanks for this info.. i have a question however. how can i secure the files i have in my amazon s3 account so that only my website can download from it and not the whole world linking to it?

    so lets say my website is abcdefg.com ; i only want my files to be downloaded from a link on that site; if someone were to find the url to my amazon file, and post it say to facebook or squidoo or something, i would not want someone to be able to download the file then.

    thanks

  2. Anthony says:

    Unfortunately, right now you do not have that control on your files with amazon s3, but it’d be a great feature to look forward to in the future. I used it more for the speedy media delivery on higher volume sites.

  3. Antonette says:

    Take chances, make mistakes. That’s how you grow. Pain nourishes your courage. You have to fail in order to practice being brave.

  4. I think that is among the so much important information for me. And i am glad reading your article. But should observation on few general things, The site taste is wonderful, the articles is really excellent : D. Just right task, cheers

Leave a Reply

Powered by Wordpress | Written by Anthony Montalbano