Dr. Dobb's Journal - February 2009 - (Page 21) d02moore_p3cp 12/17/08 12:34 PM Page 21 index.html before writing to the browser via self.response.out.write(template.render(tem plate_path, template_data)). The HTML page slots to be filled in are shown bolded in Listing Two. Notice how they match the bolded dictionary references in Listing Two. app is how succinct both code and the configuration can be. Registration and Upload Once you’ve satisfactorily tested your application locally, you can register and upload all required files. Registration is a one-step process in which you supply a mobile phone number to which a registration number may be sent. After you receive a registration code, you can manage deployment and observe the application’s performance and resource consumption using the handy administration console at appengine.google.com/ dashboard. If you want to have Google host your application you need to supply an application name, which is prepended to the domain appspot.com. For the sample application the name goalposter was used; thus the application resides at goalposter .appspot.com, as in Figure 8. Clearly, GAE lets you write applications at a very high level of abstraction, where underlying machine architectures, memory and disk limits tend to disappear; further, there are no “seams” visible to either application developers or end users. A typical application can rely on there being enough resources to support its needs almost regardless of the number of concurrent users. Configuration and Testing Thus far, you’ve seen the model and controller code expressed in goalpost.py and the view, expressed in index.html. These are specified in the configuration file, (by convention called “app.yaml”) necessary for local testing or for web deployment. YAML was chosen for its succinctness and overall simplicity of form. As in most matters, GAE code and configuration philosophy follows that of Rails: “convention over configuration” and “principle of least surprise.” Files , exist in standard directory structure and have names as expected by the application runner. The configuration for goalpost is in Listing Three (available online). Although for this application the configuration specifics are simple, potential configuration details can grow in detail to encompass numerous aspects of a large scale application. Locally, an application may be exercised from the command line using the dev_appserver supplied with the SDK. The general invocation signature of dev_appserver is: dev_appserver.py [options] Figure 8: GoalPoster hosted at Google’s appspot. semantics and a more general call semantic resembling classic embedded SQL (the GqlQuery queries in Listing One) are implemented. If you understand either or both models from traditional programming or full scope styles such as Rails or TurboGears, you already understand enough to get started writing your first GAE cloud-hosted application. Summary One thing of which we can be certain as developers is that cloud computing is going to expand in overall level of acceptance in the enterprise. The concept will continue to mature and gain both features and developers. As this article goes to press, Amazon has just announced CloudFront, a content delivery/content management service based on other Amazon services such as S3. Google continues to mature and update its GAE capabilities. Even Microsoft has decided to get its cloud on with a service platform called “Azure.” The weather out there for us developers is becoming at the same time both more cloudy and brighter. BigTable One reason for the scalability of GAE is the ability to support distributed data storage for an extremely large corpus delivered through Google’s “BigTable” architecture. Google asserts BigTable has the ability to deliver high-performance interaction data in the range of several hundred terabytes. BigTable is essentially a large flat space that provides object-relational semantics does not really implement a full relational model. Although BigTable applications such as goalposter use what appears to be a classic object-relational model, the underlying mechanisms for access, data versioning, and garbage collection share little with “real” RDBs such as MySQL. Even so, both object.method (for example, itemEntry.put() in Listing One) where a number of options are possible. Thus, a typical terminal window invocation for the sample application would be: python2.5 /usr/local/bin/dev_appserver.py —debug —port=8080 GoalPost/ Acknowledgement Thanks to Prakash Manghawani for his help on this article. DDJ You can also use the GoogleAppEngineLauncher application manager on Mac OS/X to give you a boost up in creating and managing a new application or datastore if you’re command-line averse; however, most developers find their favorite editor and the command-line tools sufficient. The rather remarkable aspect of writing a GAE-based Dana and John are Division Scientists at BBN Technologies. They can be contacted at dana.virtual@gmail.com and jhebeler@gmail.com, respectively. February 2009 l www.ddj.com l Dr. Dobb’s Journal 21 http://appengine.google.com/dashboard http://appengine.google.com/dashboard http://www.ddj.com
Table of Contents Feed for the Digital Edition of Dr. Dobb's Journal - February 2009 Dr. Dobb's Journal - February 2009 Contents Friday Night Fish Fry Alia Vox Developer Diaries Conversations Computing in the Clouds Software Development in the Cloud Videos and Oracle Forms 10g Parallel LINQ Decoupling C Header Files Effective Concurrency Disciplined Agility Swaine’s Flames Dr. Dobb's Journal - February 2009 Dr. Dobb's Journal - February 2009 - (Page BB1) Dr. Dobb's Journal - February 2009 - (Page BB2) Dr. Dobb's Journal - February 2009 - Dr. Dobb's Journal - February 2009 (Page Cover1) Dr. Dobb's Journal - February 2009 - Dr. Dobb's Journal - February 2009 (Page Cover2) Dr. Dobb's Journal - February 2009 - Dr. Dobb's Journal - February 2009 (Page 1) Dr. Dobb's Journal - February 2009 - Dr. Dobb's Journal - February 2009 (Page 2) Dr. Dobb's Journal - February 2009 - Dr. Dobb's Journal - February 2009 (Page 3) Dr. Dobb's Journal - February 2009 - Contents (Page 4) Dr. Dobb's Journal - February 2009 - Contents (Page 5) Dr. Dobb's Journal - February 2009 - Friday Night Fish Fry (Page 6) Dr. Dobb's Journal - February 2009 - Friday Night Fish Fry (Page 7) Dr. Dobb's Journal - February 2009 - Friday Night Fish Fry (Page 8) Dr. Dobb's Journal - February 2009 - Friday Night Fish Fry (Page 9) Dr. Dobb's Journal - February 2009 - Alia Vox (Page 10) Dr. Dobb's Journal - February 2009 - Alia Vox (Page 11) Dr. Dobb's Journal - February 2009 - Developer Diaries (Page 12) Dr. Dobb's Journal - February 2009 - Developer Diaries (Page 13) Dr. Dobb's Journal - February 2009 - Conversations (Page 14) Dr. Dobb's Journal - February 2009 - Conversations (Page 15) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 16) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 17) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 18) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 19) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 20) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 21) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 22) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 23) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 24) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 25) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 26) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 27) Dr. Dobb's Journal - February 2009 - Videos and Oracle Forms 10g (Page 28) Dr. Dobb's Journal - February 2009 - Videos and Oracle Forms 10g (Page 29) Dr. Dobb's Journal - February 2009 - Videos and Oracle Forms 10g (Page 30) Dr. Dobb's Journal - February 2009 - Videos and Oracle Forms 10g (Page 31) Dr. Dobb's Journal - February 2009 - Parallel LINQ (Page 32) Dr. Dobb's Journal - February 2009 - Parallel LINQ (Page 33) Dr. Dobb's Journal - February 2009 - Parallel LINQ (Page 34) Dr. Dobb's Journal - February 2009 - Parallel LINQ (Page 35) Dr. Dobb's Journal - February 2009 - Decoupling C Header Files (Page 36) Dr. Dobb's Journal - February 2009 - Decoupling C Header Files (Page 37) Dr. Dobb's Journal - February 2009 - Decoupling C Header Files (Page 38) Dr. Dobb's Journal - February 2009 - Decoupling C Header Files (Page 39) Dr. Dobb's Journal - February 2009 - Effective Concurrency (Page 40) Dr. Dobb's Journal - February 2009 - Effective Concurrency (Page 41) Dr. Dobb's Journal - February 2009 - Effective Concurrency (Page 42) Dr. Dobb's Journal - February 2009 - Effective Concurrency (Page 43) Dr. Dobb's Journal - February 2009 - Disciplined Agility (Page 44) Dr. Dobb's Journal - February 2009 - Disciplined Agility (Page 45) Dr. Dobb's Journal - February 2009 - Disciplined Agility (Page 46) Dr. Dobb's Journal - February 2009 - Disciplined Agility (Page 47) Dr. Dobb's Journal - February 2009 - Swaine’s Flames (Page 48) Dr. Dobb's Journal - February 2009 - Swaine’s Flames (Page Cover3) Dr. Dobb's Journal - February 2009 - Swaine’s Flames (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.