There are multiple ways of programming the cloud. Before we start actually writing programs, we’ll take a quick look at a few examples to give you a sense of what sorts of options are available.
Amazon EC2
Amazon provides a variety of cloud-based services. Their main programming tool is called EC2, Elastic Computing Cloud.
EC2 is really a family of related services. Compared to App Engine, which provides a single, narrowly focused suite of APIs, EC2 is completely agnostic about programming APIs. It provides hundreds of different environments: you can run your application in EC2 using Linux, Solaris, or Windows Server; you can store data using DB2, Informix, MySQL, SQL Server, or Oracle; you can implement your code in Perl, Python, Ruby, Java, C++, or C#; you can run it using IBM’s Web Sphere or sMash, Apache JBoss, Oracle Web Logic, or Microsoft IIS. Depending on which combination you prefer and how much of each kind of resource (storage, CPU, network bandwidth) you plan to use, the costs vary from $0.10 per CPU hour and $0.10 per gigabyte of bandwidth to around $0.74 per CPU hour for high-end instances.
Amazon S3
Amazon provides another extremely interesting cloud service, which is very different from most other cloud offerings. S3, Simple Storage Service, is a pure storage system. It doesn’t provide the ability to run programs; it doesn’t provide any file system; it doesn’t provide any indexing. It’s pure block storage: you can allocate a chunk of storage that has a unique identifier, and then you can read and write bytes from that chunk using its identifier.
A variety of systems have been created that use S3 for storage: web based file systems, native OS file systems, database systems, and table storage systems. It’s a wonderful example of the cloud’s resource-based paradigm: the computation involved in storage is completely separated from the actual data storage itself. When you need storage, you buy a bunch of bytes of storage space from S3. When you need computation, you buy EC2 resources.
S3 is a really fascinating system. It’s very focused: it does exactly one thing and does it in an incredibly narrow way. But in an important sense, that’s exactly what the cloud is about. S3 is a perfectly focused service; it stores bytes for you.
S3 charges are based on two criteria: how much data you store and how much network bandwidth you use storing and retrieving your data. Amazon currently charges $0.15 per gigabyte per month and about $0.10 per gigabyte uploaded and $0.17 per gigabyte downloaded.
On a related note, Google provides a very similar cloud service, called Google Developer Storage, which replicates the basic features of S3 in the Google cloud.
IBM Computing on Demand
IBM provides a cloud service platform based on IBM’s suite of web service development that uses Web Sphere, DB2, and Lotus collaboration tools. The environment is the same as the IBM-based environment on EC2, but it runs in IBM’s data centers instead of Amazon’s.
Microsoft Azure
Microsoft has developed and deployed a cloud platform called Azure. Azure is a Windows-based platform that uses a combination of standard web services technologies (such as SOAP, REST, Servlets, and ASPs) and Microsoft’s proprietary APIs, like Silverlight. As a result, you get the ability to create extremely powerful applications that look
Very much like standard desktop applications. But the downside is it’s closely tied to the Windows platform, so the application clients run primarily on Windows. While there are Silverlight implementations for other platforms, the applications tend to only be reliable on Windows platforms and only fully functional in Internet Explorer.
So that’s the cloud. Now that we know what it is, we’re going to start learning about how to build applications in the cloud. Google has put together a really terrific platform, called App Engine, for you to build and run your own cloud applications.
In the rest of the book, we’re going to look in detail at the key pieces of building cloud-based web applications. We’ll start off working in Python. Python’s great for learning the basics: it lets you see what’s going on, and it makes it easy to quickly try different approaches and see what happens.
We’ll go through the full stack of techniques that you need for building a Google App Engine application in Python, starting with the basic building blocks: HTTP, services, and handlers. Then we’ll look at how you work with persistent data in the cloud using the App Engine data store service. And then, we’ll look at how to build user interfaces for your applications using HTTP, CSS, and AJAX.
From there, we’ll leave Python for a while and move into Java. In my opinion, Java can be a lot more convenient for building complex applications. Not that Python can’t or shouldn’t be used for advanced App Engine development, but my preference is to use Java. And App Engine provides access to an absolutely brilliant framework called GWT, which abstracts away most of the boilerplate plumbing of a web-based cloud application, allowing you to focus on the interesting parts. We’ll spend some time learning about how to build beautiful user interfaces using GWT and how to do AJAX-style communication using GWT’s remote procedure call service.
Finally, we’ll spend some time looking at the most complicated aspects of real web development. We’ll look at the details of how you can do sophisticated things using the App Engine data store service, how to implement server-side processing and computation using things like cron, and how to integrate security and authentication into your App Engine application.
Source of Information : Pragmatic - Code in the Cloud Programming Google App Engine 2011
1 comment:
Post a Comment