Intro to App Engine and AppScale

19,516 views
19,321 views

Published on

These slides introduce new users to Google App Engine and AppScale, focusing on the APIs that App Engine offers and how AppScale implements them.

Published in: Technology
0 Comments
8 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
19,516
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
52
Comments
0
Likes
8
Embeds 0
No embeds

No notes for slide

Intro to App Engine and AppScale

  1. 1. 8 build apps faster andb intro easier To > Google K5 app engine developer innovation & Appscale Z x$ ( deploy and scale on any cloud rapid releases Chris bunch chris@appscale.com
  2. 2. • You have a cool ideaa • To make it into an app, you need to:common • Setup hardwarepattern • Configure, deploy appOne of several recurringproblems seen in the real services •world today. And you have to do this for every app!
  3. 3. Why not Amazon?• You don’t want to deploy and maintain: • Servers • Load balancers • App Servers • Databases• And you don’t want to hire people to do it! www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 3
  4. 4. google app engine• A web application hosting service• Never log into a server• Crystallizes web service best practices• Share common services between apps• Focus on writing your app www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 4
  5. 5. Supported LanguagesPython Java Go www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 5
  6. 6. Programming ModelÑ Everything is a web request Stateless, scalable web server, meaning:( • • No filesystem access Persistence via Datastore / memcache • 60 second time limit on requests • APIs from whitelist only www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 6
  7. 7. The DATAstore• Not a relational database, but resembles an object database• You define Kinds of data you want to store• Each object stored is an Entity• Entities can be arranged into Groups www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 7
  8. 8. Defining a kindclass Person(ndb.Model): user = ndb.UserProperty() balance = ndb.FloatProperty() phone = ndb.StringProperty() last_login = ndb.DateTimeProperty() www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 8
  9. 9. EXTENDING a kindclass Person(ndb.Model): user = ndb.UserProperty() balance = ndb.FloatProperty() phone = ndb.StringProperty() last_login = ndb.DateTimeProperty() login_location = ndb.GeoPt() www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 9
  10. 10. Kind, entitiesclass Person(ndb.Model): ...new_person = Person()new_person.put() www.appscale.comPhone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 10
  11. 11. transactions• Updating an Entity happens in a Transaction• Apps tell App Engine which Entities will be updated together by putting them into an Entity Group• Transactions can only occur within an Entity Group* def f(): person = db.get(key1) person.balance = 100.00 person.put() db.run_in_transaction(f) www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 11
  12. 12. memcachedata = memcache.get(‘key’)if data: return dataelse: data = db.get(‘key’) memcache.set(‘key’, data, 300) return data www.appscale.comPhone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 12
  13. 13. usersuser = users.get_current_user()if user: return user.nickname()else: return None www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 13
  14. 14. mailfrom = “Chris Bunch <chris@appscale.com>”to= “You <foo@bar.com>”subject = “Try out AppScale!”body = “http://download.appscale.com”mail.send_mail(sender=from, to=to, subject=subject,body=body) www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 14
  15. 15. task queuetaskqueue.add(url=“/path/to/worker”)cron:- description: sends friendly emails url: /path/to/worker schedule: every 24 hours www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 15
  16. 16. url fetchr = urlfetch.fetch(“http://www.google.com/”)if r.status_code == 200: do_something_with_result(r.content)else: # retry later www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 16
  17. 17. xmppuser = “chris@appscale.com”msg = “Hello there!”status = xmpp.send_message(user, msg)if status != xmpp.NO_ERROR: # decide what to do with the failed msg www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 17
  18. 18. enter appscale• But what if you need: • To fail over to a private cloud? • To run your App Engine app in-house? • To use APIs App Engine doesn’t support?• Then you need AppScale! www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 18
  19. 19. run anywhere www.appscale.comPhone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 19
  20. 20. datastore• Supports NoSQL datastores via a database agnostic API: • get • put • range_query • delete www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 20
  21. 21. we have supported www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 21
  22. 22. now focusing on... www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 22
  23. 23. load balancing + app servers www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 23
  24. 24. API Services www.appscale.comPhone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 24
  25. 25. the development cycle• App Engine SDK for rapid development• Limitations: • Many APIs are stubbed out (XMPP, Mail) • Not designed for production workloads• Use AppScale! www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 25
  26. 26. Demo

×