Successfully reported this slideshow.
Get up and running with App Engine in 60 minutes or less Ron Zalkind, Co-Founder & CTO @ CloudLock Boston App Engine Meetu...
What is google app engine ? <ul><li>Service for running you web application on Google's Infrastructure </li></ul><ul><ul><...
It is NOT a toy <ul><li>App Engine Numbers </li></ul><ul><ul><li>Over 150K active apps every week </li></ul></ul><ul><ul><...
Where is my app running ? Google * image from &quot;Programming Google App Engine&quot; (by dan sanderson, Oreilly)
Getting started <ul><ul><li>This example will use python (V 2.5) </li></ul></ul><ul><ul><li>Install the app engine SDK (ht...
Our first app <ul><li>Yes, it's hello world.   again... but in the cloud :-) </li></ul>
Lets create a real app <ul><li>Idea Data Model </li></ul><ul><ul><li>Description </li></ul></ul><ul><ul><li>Publish date <...
App engine web app <ul><li>3 main files </li></ul><ul><ul><li>app.yaml (app configuration file) </li></ul></ul><ul><ul><li...
Create a new idea <ul><li>New Idea form </li></ul><ul><li>         self.response.out.write('<html><body>') </li></ul><ul><...
Save idea to datastore <ul><li>Robust, scalable storage for your web app </li></ul><ul><li>Conceptually a persistent HashM...
Save idea to datastore <ul><li>Data model for Idea </li></ul><ul><li># data modeling API </li></ul><ul><li>from google.app...
List the ideas <ul><li>List the Ideas </li></ul><ul><li>         # get ideas from datastore </li></ul><ul><li>         ide...
Lets vote... <ul><li>Add a vote link </li></ul><ul><li>                 self.response.out.write('votes: %s <a href=&quot;/...
Deploy... <ul><li>Explore the admin console </li></ul><ul><li>Make a change to our query </li></ul><ul><li>         # get ...
Why we love App Engine ? <ul><li>Simple </li></ul><ul><ul><li>Very easy to get started </li></ul></ul><ul><ul><li>Easy to ...
Pricing <ul><li>Free Quota </li></ul><ul><li>Pay ONLY for what you use </li></ul>
Where do i go next <ul><li>Framework via app.yaml or use a framework like Django </li></ul><ul><li>Explore the datastore <...
Thank You <ul><li>[email_address] </li></ul>
Upcoming SlideShare
Loading in …5
×

Get up and running with google app engine in 60 minutes or less

1,792 views

Published on

This is an intro into google app engine for developers. By the end of the presentation you will be able to create your first real app on app engine. The tutorial shows code samples for creating and deploying an app while covering app engine basics.

Published in: Technology
  • Be the first to comment

Get up and running with google app engine in 60 minutes or less

  1. 1. Get up and running with App Engine in 60 minutes or less Ron Zalkind, Co-Founder & CTO @ CloudLock Boston App Engine Meetup - 03222011
  2. 2. What is google app engine ? <ul><li>Service for running you web application on Google's Infrastructure </li></ul><ul><ul><li>Easy to Build </li></ul></ul><ul><ul><li>Easy to Manage </li></ul></ul><ul><ul><li>Easy to Deploy </li></ul></ul><ul><ul><li>Pay for what is used </li></ul></ul>
  3. 3. It is NOT a toy <ul><li>App Engine Numbers </li></ul><ul><ul><li>Over 150K active apps every week </li></ul></ul><ul><ul><li>Over 100K developers use App Engine in a month </li></ul></ul><ul><ul><li>More than 1B pageview per day </li></ul></ul><ul><ul><li>Gigya Socialize have peaked at 1.6Kqps </li></ul></ul><ul><li>Personal Experience @ CloudLock </li></ul><ul><ul><li>Running in production since 08/2010 </li></ul></ul><ul><ul><li>Used by over 300 enterprise customers </li></ul></ul><ul><ul><li>Scales to serve the largest corporations </li></ul></ul><ul><ul><li>It works ! </li></ul></ul>
  4. 4. Where is my app running ? Google * image from &quot;Programming Google App Engine&quot; (by dan sanderson, Oreilly)
  5. 5. Getting started <ul><ul><li>This example will use python (V 2.5) </li></ul></ul><ul><ul><li>Install the app engine SDK (http://code.google.com/appengine/downloads.html) </li></ul></ul><ul><ul><ul><li>Create projects </li></ul></ul></ul><ul><ul><ul><li>Dev server for testing locally </li></ul></ul></ul><ul><ul><ul><li>Easy deploy to app engine </li></ul></ul></ul>
  6. 6. Our first app <ul><li>Yes, it's hello world.   again... but in the cloud :-) </li></ul>
  7. 7. Lets create a real app <ul><li>Idea Data Model </li></ul><ul><ul><li>Description </li></ul></ul><ul><ul><li>Publish date </li></ul></ul><ul><ul><li>Votes </li></ul></ul><ul><li>Actions </li></ul><ul><ul><li>Submit a new Idea </li></ul></ul><ul><ul><li>Vote Up </li></ul></ul><ul><li>Views </li></ul><ul><ul><li>List of Ideas ordered by votes </li></ul></ul><ul><li>  </li></ul>
  8. 8. App engine web app <ul><li>3 main files </li></ul><ul><ul><li>app.yaml (app configuration file) </li></ul></ul><ul><ul><li>main.py  (main routing that runs the app) </li></ul></ul><ul><ul><li>index.yaml (index configuration for queries) </li></ul></ul><ul><li>Webapp framework </li></ul><ul><ul><li>Request Handler </li></ul></ul><ul><ul><ul><li>Instantiated on get/post </li></ul></ul></ul><ul><ul><ul><li>self.request </li></ul></ul></ul><ul><ul><ul><li>self.response </li></ul></ul></ul><ul><ul><li>WSGIApplication instance </li></ul></ul><ul><ul><li>Main () - URL handlers </li></ul></ul><ul><li>  </li></ul>
  9. 9. Create a new idea <ul><li>New Idea form </li></ul><ul><li>         self.response.out.write('<html><body>') </li></ul><ul><li>         self.response.out.write(&quot;<h2>Boston App Engine Meetup </h2>&quot;) </li></ul><ul><li>         </li></ul><ul><li>         # Write the submission form and the footer of the page </li></ul><ul><li>         self.response.out.write(&quot;&quot;&quot; </li></ul><ul><li>               <form action=&quot;/newidea&quot; method=&quot;post&quot;> </li></ul><ul><li>                 <div><textarea name=&quot;desc&quot; rows=&quot;1&quot; cols=&quot;60&quot;></textarea></div> </li></ul><ul><li>                 <div><input type=&quot;submit&quot; value=&quot;New Idea&quot;></div> </li></ul><ul><li>               </form>&quot;&quot;&quot;) </li></ul><ul><li>         self.response.out.write('</body></html>') </li></ul><ul><li>  </li></ul>
  10. 10. Save idea to datastore <ul><li>Robust, scalable storage for your web app </li></ul><ul><li>Conceptually a persistent HashMap (based on Big Table) </li></ul><ul><li>It is NOT a relational database !  </li></ul><ul><ul><li>No Joins </li></ul></ul><ul><ul><li>Built for efficiency & scale. Everything has to be indexed </li></ul></ul><ul><li>Datastore Structure </li></ul><ul><ul><li>Entity Kind (think table) </li></ul></ul><ul><ul><li>Entity (think row) </li></ul></ul><ul><ul><li>Property (think column) </li></ul></ul><ul><li>  </li></ul>
  11. 11. Save idea to datastore <ul><li>Data model for Idea </li></ul><ul><li># data modeling API </li></ul><ul><li>from google.appengine.ext import db </li></ul><ul><li>class Idea(db.Model): </li></ul><ul><li>     desc = db.StringProperty() </li></ul><ul><li>     pub_date = db.DateProperty(auto_now_add=True) </li></ul><ul><li>     votes = db.IntegerProperty() </li></ul><ul><li>Handler to create a new idea </li></ul><ul><li>class NewIdeaHandler(webapp.RequestHandler): </li></ul><ul><li>     def post(self): </li></ul><ul><li>        desc = self.request.get('desc')       </li></ul><ul><li>         newIdea = Idea () </li></ul><ul><li>         newIdea.desc = desc </li></ul><ul><li>         newIdea.votes = 1 </li></ul><ul><li>         newIdea.put() </li></ul><ul><li>         self.redirect('/') </li></ul><ul><li>  </li></ul>
  12. 12. List the ideas <ul><li>List the Ideas </li></ul><ul><li>         # get ideas from datastore </li></ul><ul><li>         ideas = db.GqlQuery(&quot;SELECT * FROM Idea ORDER BY votes DESC LIMIT 10&quot;) </li></ul><ul><li>#check if there are any ideas </li></ul><ul><li>         if ideas == None: </li></ul><ul><li>self.response.out.write(&quot;<h2>Boston App Engine Meetup </h2> No ideas yet&quot;) </li></ul><ul><li>         else: </li></ul><ul><li>             for idea in ideas: </li></ul><ul><li>                 self.response.out.write('votes: %s , %s , %s<br>' % (idea.votes, idea.pub_date,                      idea.desc)) </li></ul><ul><li>  </li></ul>
  13. 13. Lets vote... <ul><li>Add a vote link </li></ul><ul><li>                 self.response.out.write('votes: %s <a href=&quot;/addvote?ideakey=%s&quot;>vote</a> , %s                 , %s<br>' % (idea.votes, idea.key(), idea.pub_date, idea.desc)) </li></ul><ul><li>Add a AddVote Handler </li></ul><ul><li>class AddVote(webapp.RequestHandler): </li></ul><ul><li>     def get(self): </li></ul><ul><li>         ideakey = self.request.get('ideakey') </li></ul><ul><li>         idea = db.get(ideakey) </li></ul><ul><li>         idea.votes += 1 </li></ul><ul><li>         idea.put() </li></ul><ul><li>         self.redirect('/') </li></ul><ul><li>  </li></ul>
  14. 14. Deploy... <ul><li>Explore the admin console </li></ul><ul><li>Make a change to our query </li></ul><ul><li>         # get ideas from datastore </li></ul><ul><li>         ideas = db.GqlQuery(&quot;SELECT * FROM Idea WHERE votes > 2 ORDER BY votes                                              DESC LIMIT 10&quot;) </li></ul><ul><li>Change the version in app.yaml </li></ul><ul><li>  </li></ul><ul><li>Deploy again </li></ul>
  15. 15. Why we love App Engine ? <ul><li>Simple </li></ul><ul><ul><li>Very easy to get started </li></ul></ul><ul><ul><li>Easy to make changes and deploy </li></ul></ul><ul><ul><li>Facilitate quick iterations </li></ul></ul><ul><li>But.... </li></ul><ul><ul><li>No SQL </li></ul></ul><ul><ul><li>App Engine Constraints </li></ul></ul><ul><ul><ul><li>Incoming web request = 30 seconds </li></ul></ul></ul><ul><ul><ul><li>URL Fetch = 10 seconds </li></ul></ul></ul><ul><ul><ul><li>Background processing 10 minutes </li></ul></ul></ul><ul><ul><li>App Engine recovery logic </li></ul></ul><ul><li>Will get you scale </li></ul><ul><ul><li>Limitless almost out of the box </li></ul></ul><ul><ul><li>operational efficiency </li></ul></ul><ul><ul><li>Almost Free </li></ul></ul>
  16. 16. Pricing <ul><li>Free Quota </li></ul><ul><li>Pay ONLY for what you use </li></ul>
  17. 17. Where do i go next <ul><li>Framework via app.yaml or use a framework like Django </li></ul><ul><li>Explore the datastore </li></ul><ul><li>Background processing with the task queue service </li></ul><ul><li>Memcache </li></ul><ul><li>Namespace  </li></ul><ul><li>Other Services - Images, XMPP, Mail, User, URLFetch, Blobstore                                     MapReduce </li></ul>
  18. 18. Thank You <ul><li>[email_address] </li></ul>

×