Your SlideShare is downloading. ×
0
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Get up and running with google app engine in 60 minutes or less
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

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

1,493

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 …

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
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,493
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • 1. Create new application 2. give it a name 3. Run it 4. Review the 3 files    - app.yaml    - index.yaml    - main.py 5. Update main.py hello world 6. re-run locally 7. upload to app engine    - signup for app engine (appengine.google.com    - create an app. * name *    - Upload
  • 1. Show a sample of the app
  • 1. Create a new app from launcher 2. Cover main.py, app.yaml, index.py 3. Explain the concept of webapp framework 
  • 1. Add a this form to MainHandler.get 2. Run the app
  • 1. Create a new app from launcher 2. Cover main.py, app.yaml, index.py 3. Explain the concept of webapp framework 
  • 1. Create the Idea Class 2. Add a handler for new idea 3. Add the new handler to main 4. Run the app and explore the data store
  • 1. GqlQuery. SQL like syntax 2. Retrieves FULL object. don't specify specific propperties 3. Add to MainHandler.get
  • 1. add an href with entity key as parameter 2. add vote handler and connect it to main routine 3. Run the app, explore datastore
  • 1. Upload the app 2. Explore the admin console 3. Add a log line, re-deploy with version
  • 1. Upload the app 2. Explore the admin console 3. Add a log line, re-deploy with version
  • 1. Upload the app 2. Explore the admin console 3. Add a log line, re-deploy with version
  • 1. Upload the app 2. Explore the admin console 3. Add a log line, re-deploy with version
  • Transcript

    • 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. What is google app engine ? <ul><li>Service for running you web application on Google&apos;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. 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. Where is my app running ? Google * image from &amp;quot;Programming Google App Engine&amp;quot; (by dan sanderson, Oreilly)
    • 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. Our first app <ul><li>Yes, it&apos;s hello world.   again... but in the cloud :-) </li></ul>
    • 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. 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. Create a new idea <ul><li>New Idea form </li></ul><ul><li>         self.response.out.write(&apos;&lt;html&gt;&lt;body&gt;&apos;) </li></ul><ul><li>         self.response.out.write(&amp;quot;&lt;h2&gt;Boston App Engine Meetup &lt;/h2&gt;&amp;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(&amp;quot;&amp;quot;&amp;quot; </li></ul><ul><li>               &lt;form action=&amp;quot;/newidea&amp;quot; method=&amp;quot;post&amp;quot;&gt; </li></ul><ul><li>                 &lt;div&gt;&lt;textarea name=&amp;quot;desc&amp;quot; rows=&amp;quot;1&amp;quot; cols=&amp;quot;60&amp;quot;&gt;&lt;/textarea&gt;&lt;/div&gt; </li></ul><ul><li>                 &lt;div&gt;&lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;New Idea&amp;quot;&gt;&lt;/div&gt; </li></ul><ul><li>               &lt;/form&gt;&amp;quot;&amp;quot;&amp;quot;) </li></ul><ul><li>         self.response.out.write(&apos;&lt;/body&gt;&lt;/html&gt;&apos;) </li></ul><ul><li>  </li></ul>
    • 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 &amp; 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. 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(&apos;desc&apos;)       </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(&apos;/&apos;) </li></ul><ul><li>  </li></ul>
    • 12. List the ideas <ul><li>List the Ideas </li></ul><ul><li>         # get ideas from datastore </li></ul><ul><li>         ideas = db.GqlQuery(&amp;quot;SELECT * FROM Idea ORDER BY votes DESC LIMIT 10&amp;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(&amp;quot;&lt;h2&gt;Boston App Engine Meetup &lt;/h2&gt; No ideas yet&amp;quot;) </li></ul><ul><li>         else: </li></ul><ul><li>             for idea in ideas: </li></ul><ul><li>                 self.response.out.write(&apos;votes: %s , %s , %s&lt;br&gt;&apos; % (idea.votes, idea.pub_date,                      idea.desc)) </li></ul><ul><li>  </li></ul>
    • 13. Lets vote... <ul><li>Add a vote link </li></ul><ul><li>                 self.response.out.write(&apos;votes: %s &lt;a href=&amp;quot;/addvote?ideakey=%s&amp;quot;&gt;vote&lt;/a&gt; , %s                 , %s&lt;br&gt;&apos; % (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(&apos;ideakey&apos;) </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(&apos;/&apos;) </li></ul><ul><li>  </li></ul>
    • 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(&amp;quot;SELECT * FROM Idea WHERE votes &gt; 2 ORDER BY votes                                              DESC LIMIT 10&amp;quot;) </li></ul><ul><li>Change the version in app.yaml </li></ul><ul><li>  </li></ul><ul><li>Deploy again </li></ul>
    • 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. Pricing <ul><li>Free Quota </li></ul><ul><li>Pay ONLY for what you use </li></ul>
    • 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. Thank You <ul><li>[email_address] </li></ul>

    ×