Ensuring Technical Readiness For Copilot in Microsoft 365
Python Ireland Nov 2009 Talk - Appengine
1. Google App Engine
Writing a
Stack Overflow clone
on App Engine
in under an hour*
http://blog.bitquabit.com/2009/07/01/one-which-i-call-out-hacker-news/
2. Agenda
1. App Engine Introduction
2. Demo: Building an app
3. Demo: Deploying an app
4. Demo: Writing App Overflow
5. App Engine's Services
6. Questions
If I say "Cloud" at any point, Boo!
11. 1. Scalable Serving Architecture
Incoming Requests
App Engine App Engine App Engine
Front End Front End Front End
Load Balancer
AppServer AppServer AppServer
12. 1. Scalable Serving Architecture
Incoming Requests
App Engine App Engine App Engine
Front End Front End Front End
Load Balancer
AppServer AppServer AppServer
Other Google
AppServer Infrastructure
API Layer - Bigtable
- Google Accounts
App App App - Memcache
- Image manipulation
13. 2. Distributed Datastore
The Datastore is...
Distributed
Transactional
Natively Partitioned
Hierarchial Wow. That is
one big table.
Schemaless
Based on Bigtable
14. 2. Distributed Datastore
The Datastore is not...
A relational database
A SQL engine
Just Bigtable
Wow. That is
one big table.
21. Adding authentication
<html>
<head>
<title>{%block title%}App Overflow{%endblock%}</title>
{% block head %}{% endblock %}
</head>
<body>
<div class="login">
{% if user %}
Logged in as {{user.nickname}} |
<a href="{{logout_url}}">Log Out</a>
{% else %}
<a href="{{login_url}}">Log In</a>
{% endif %}
</div>
{% block body %}{% endblock %}
</body>
</html>
22. Storing data
from google.appengine.ext import db
class Question(db.Model):
asker = db.UserProperty(required=True)
title = db.StringProperty(required=True, indexed=False)
body = db.TextProperty(required=True)
asked_at = db.DateTimeProperty(auto_now_add=True)
23. Storing data
class NewQuestionHandler(BaseHandler):
def get(self):
self.render_form(forms.QuestionForm())
def post(self):
form = forms.QuestionForm(self.request.POST)
if not form.is_valid():
self.render_form(form)
return
entity = models.Question(
asker=self.user,
**form.clean_data)
entity.put()
self.redirect('/questions/%d/' % (entity.key().id(),))
28. XMPP
class XmppHandler(xmpp_handlers.CommandHandler):
def ask_command(self, message=None):
question = models.Question(
title=message.arg,
body=message.arg,
sender=message.sender)
question.put()
message.reply('Your question has been received. You will be pinged when an answer
is submitted.')
# Elsewhere...
xmpp.send_message([question.sender], 'Answer: ' +
answer.body)
29. Additional services / APIs
URL Fetch
Memcache
Mail - incoming and outgoing
Images
Google Accounts
Cron support
Task Queue