Presentation is loading. Please wait.

Presentation is loading. Please wait.

Meet with the AppEngine Márk Gergely eu.edge. What is AppEngine? It’s a tool, that lets you run your web applications on Google's infrastructure. –Google's.

Similar presentations


Presentation on theme: "Meet with the AppEngine Márk Gergely eu.edge. What is AppEngine? It’s a tool, that lets you run your web applications on Google's infrastructure. –Google's."— Presentation transcript:

1 Meet with the AppEngine Márk Gergely eu.edge

2 What is AppEngine? It’s a tool, that lets you run your web applications on Google's infrastructure. –Google's custom-designed computers and datacenters distributed around the world –Secure Sandbox for running applications –Python 2.5 runtime environment –BigTable as Datastore

3 Why not LAMP? LAMP is the industry standard But management is a hassle: –Configuration, tuning –Backup and recovery, disk space management –Hardware failures, system crashes –Software updates, security patches –Log rotation, cron jobs, and much more –Redesign needed once your database exceeds one box

4 Why AppEngine? Does one thing well: running web apps –App Engine handles HTTP(S) requests, nothing else –Works well for the web and AJAX Simple app configuration Secure Rich APIs Scalable

5 Secure Sandbox A secure environment that is independent of hardware, OS and physical location of the web server. No direct OS functionality –no processes, threads –no sockets (use urlfetch API) –can’t write files (use datastore) –disallow Python extensions

6 APIs Webapp Framework –WSGI compatible framework for handling requests Users API –Integrating with Google Account Images API URLFetch API Mail API Memcache API –High performance in-memory key-value cache Datastore API –Interface to the BigTable Custom Framewroks –Built-in Django, WebOb

7 Scalability You don’t need to configure your resource needs One CPU can handle many requests per second Apps are mapped onto CPUs: –One process per app, many apps per CPU –The process hangs around to handle more requests (reuse) Eventually old processes are killed (recycle) Busy apps get assigned to multiple CPUs –This automatically adapts to the need - as long as CPUs are available

8 Quotas Everything an app does is limited by quotas –request count, bandwidth used, CPU usage, datastore call count, disk space used, emails sent, even errors! If you run out of quota that particular operation is blocked Free quotas are tuned so that a well-written app can survive a lifehacker post The point of quotas is to be able to support a very large number of small apps Large apps need raised quotas –currently this is a manual process –pricing (?)

9 BigTable "Bigtable is a distributed storage system for managing structured data that is designed to scale to a very large size: petabytes of data across thousands of commodity servers” /Google/ Scalability –Bigtable is designed to support resources adding without any reconfiguration Efficiency –Allows the clients to perform millions of read/write operation per second Self management –The servers control the load balance

10 Database API Entities are the basic elements –Key id generated automatically, name set by the application –Kind –Property StringProperty, IntegerProperty, FloatProperty, … UserProperty ReferenceProperty AppEngine uses Models to describe data Define your data models as a Python class –to create an entity use the class constructor –Call put() on the object to add it to the datastore

11 Simple model from google.appengine.ext import db class Article(db.Model): title = db.StringProperty() body = db.TextProperty() author = db.UserProperty() object = Article() object.put()

12 Query the data Using get() –really fast, it uses the key of an Entity Using gql –sql-like syntax –uses indexes –no aggregate functions (not even count)

13 Indexes Properties are automatically indexed by type+value –There is an index for each Kind / property name combo –Whenever an entity is written all relevant indexes are updated –However Blob and Text properties are never indexed This supports basic queries: AND on property equality For more advanced query needs, create composite indexes –SDK auto-updates index.yaml based on queries executed –These support inequalities (, >=) and result ordering –Index building has to scan all entities due to parent keys

14 Transactions Every Entity belongs to an entity group To create an entity group, you can assign a parent to an entity when it is created Entities with no parents are root entities Entity groups are stored together An entity group can be manipulated in a single transction


Download ppt "Meet with the AppEngine Márk Gergely eu.edge. What is AppEngine? It’s a tool, that lets you run your web applications on Google's infrastructure. –Google's."

Similar presentations


Ads by Google