1 / 20

Getting started with google app engine

Getting started with google app engine. http://www.flickr.com/photos/maggiew/6145245962/. Google App Engine (GAE) is a Platform-as-a-service. Infrastructure-as-a-service ( IaaS ) Virtual (and physical ) machines on demand E.g., Rackspace Platform-as-a-service ( PaaS )

caitir
Download Presentation

Getting started with google app engine

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Getting started with google app engine http://www.flickr.com/photos/maggiew/6145245962/

  2. Google App Engine (GAE)is a Platform-as-a-service • Infrastructure-as-a-service (IaaS) • Virtual (and physical ) machines on demand • E.g., Rackspace • Platform-as-a-service (PaaS) • Scalable servers with rich but restrictive APIs • E.g., Google App Engine (GAE) • Software-as-a-service (SaaS) • Servers with customizable web apps you can lease • E.g., SalesForce.net

  3. Google App Engine (GAE)core functionality • Serving up custom web sites (Servlets API) • Storing data for you (JDO and JPA APIs) • Other APIs • UI Toolkit (GWT) • Asynchronous tasks • Retrieving web content • Caching • Image processing • …

  4. Reasons to start with GAE • Free to start • Uses a language you probably know (Java) or is syntactically similar to a language you know (JS) • Integrated with tools you might know (Eclipse) • Provides exposure to cloud funkiness • No support for inner joins • Automatic load balancing • Non-DBMS transactions • Sandboxing

  5. Some other languages supported by GAE • Java • This is what I will use in this class • Mainly thanks to its nice Eclipse integration • Python • Somewhat richer API and command-line tools • Feel free to use this instead of Java if you like • (But I do not know Python, FYI) • Go • New Google language with built-in concurrency • Feel free to use it (but FYI, I don’t know Go)

  6. Still other languages • As long as you can compile it to Java 1.6-compatible bytecode • JRuby • Scala • Rhino-compatible JavaScript • … • Feel free to use any of these • I know have briefly used Rhino but haven’t used the Rhino compiler to Java

  7. Serving up custom web sites • Servlet == a Java class that handles http requests and generates HTML or other content • Options • Servlets that you explicitly create: • Handlers for URLs of the form “/myservlet” • You create a Java class and then… • Either explicitly map it to a certain URL in an XML document • Or you map it to a certain URL using annotations • Latest standard not currently supported by GAE • JSPs: • You create a file that mixes HTML with special tags and potentially some Java • Automatically converted to servlets • Automatically mapped to certain URL • My demos will use JSPs, but feel free to use servlets

  8. Storing data for you • Google Query Language • SQL-like language for retrieving objects • Java Data Objects (JDO) • A standardized way of storing objects • Create an object, store it, load it later • No need to mess around with INSERT statements • Java Persistence API (JPA) • Another standardized way of storing objects • JPA is basically a refinement of JDO • As well supported in GAE as JDO • Low-level APIs • Which are more powerful and easier to misuse

  9. Other APIs: UI Toolkit • Google Web Toolkit (GWT) • Define your application’s UI in Java • Code looks very similar to what you’d write to create a desktop GUI • Compiles to JavaScript • Support for multiple targets • Desktop browser • Mobile browsers • Available for you to investigate as a How-To

  10. Other APIs: Asynchronous tasks • Very similar to “cron” jobs • Create a task • Pass it some parameters • Schedule to run at a certain time if you like • Put it on a queue • Very handy for… • Loading data • Generating reports • Performing sophisticated transactions

  11. Other APIs: Retrieving web content • Your application can retrieve data from other servers • Retrieve XML from remote web services • Retrieve zip files, uncompress them, store data • Very handy for… • Loading data • Integrating with other systems

  12. Other APIs: Caching • GAE provides a distributed RAM cache • Server RAM is copied to all the other computers • Very very fast data access (versus JDO) • Still can take advantage of using multiple servers • Caveat: it has only a limited capacity • You can’t cache everything • Stuff can disappear (similar to Java “weak references”) • Effective caching and asynchronous computation are two of the most important concepts for achieving high-performance cloud applications

  13. A few of the other APIs • Image Processing • Good for manipulating photos • Channels • Persistent socket-like connection to browser • Emails • Implements the JavaMail specification • Can send attachments • XMPP • For sending messages between applications

  14. Limitations • Functional • Due to the architecture • Sandbox • You can’t access all Java SDK APIs • Quotas and timeouts • You can’t use unlimited resources

  15. Functional limitations • Data are copied and stored on many servers • Sometimes servers fail • Sometimes servers have inconsistent data • Certain data manipulations are not tractable • E.g., GAE cannot do DB table joins like you’re used to • Servers start and stop to meet your load • Servers might lose in-memory state at any time • You can’t write to an individual server’s files • You can’t have a server all to yourself

  16. Sandbox limitations • No writing to file system or DBMS • Serialize to the data store via JDO instead • No spawning threads • Use asynchronous tasks instead • No killing the JVM • Just return from servlet; no need to kill anyone • No loading native code • Put it on another server, invoke via web service • … And several other less important limitations

  17. Quotas and timeouts • Free tier (last time I checked) • Max request size: 32MB • Max handler time per server hit: 60 seconds • Max stored data: 1GB • Max outbound bandwith: 1GB/day, 56 MB/minute • Max incoming bandwidth: ditto • And many other limitations • If you want to raise quotas, pay $$ (optional)

  18. Basic steps for creating app • Create new project in Eclipse • Implement, test browser-based app locally • Push to GAE and test remotely • Test + refine performance, reliability, security • Expose refined functionality via web services • Implement mobile app • Test + refine usability, security

  19. Hello, world Creating a simple GAE application

  20. Next steps for you • Start installing… • Oracle JDK 1.6 (already installed on Macs) • Eclipse Galileo or newer • http://eclipse.org/ • Recommendation: Get Enterprise Edition if you also want to try out Amazon's platform (later in this unit). Get Java Developer Edition if you only want to try out Google App Engine (since Enterprise Edition starts up a little slower & takes more memory). • GAE plugins • http://code.google.com/appengine/downloads.html

More Related