Udi Google Dev Day

Embed Size (px)

Citation preview

Real life experience from AppEngine & Django

Real life experience from AppEngine & Django

Udi h Bauman

Google Developers Day Israel 08

About me

SW architect and developer

Expertise in BI and Semantic Web

Using Python, Django, AppEngine & EC2 for daily work

Could elaborate about following but it will probably defocus from PPT goal:

Perform complex logic & analytics (e.g., Semantic Web services, complex content manipulations)

Work against Flash GUI or XUL-based Desktop application

Successfully use the Google API's available for AppEngine applications

About my company

We develop and automate Value Creation Processes and by that enable enterprises to maximize their profits.

Our solution is Django
based & considered one
of the largest & most
complex enterprise products developed in Django.

Our CEO is Orr Mendelson, a top expert in Value Creation

We are in Beta stage in several enterprises

My experience in web applications

[Been doing Enterprise Web Applications since 1994It was always a pain, even with the best possible architectures & technologiesDecided 2 years ago to try a technology, which changed all this]

(Orr: I hope the effect works for you)

Great Web Technologies Pain!

CGI

ASP

ColdFusion

Servlets

JSP

EJB

.Net

Open-Source Java frameworks

AJAX frameworks

PHP

Ruby

Rails

Lesson #1

is the best Web technology today.

Django Example

Web site for Visualizing time differences around Daylight Saving Time events

http://daylight-savings-time.info

[Some Start-up asked me to build a site for] visualizing time differences around Daylight Saving Time events

[They previously asked some Web shop to develop it, using a more common technology (PHP)Although seemingly simple, the other shop gave up after a few months, due to the logic complexity]

Using Django

Data model takes minutes to define

Django builds the DB based on the data model

Django generates the back-office administration screens

Django provided the I18N layer

The logic written in Python is OO, simple & succinct, so both dev & maintenance are extra fast

I could focus only on the logic

I kept it simple

Start with: [Django enabled me to easily develop the site]

End with: [that even my client (non-programmer) understood everything without explanation]

Is it mature enough? Does it scale?

Dev technology is really tested when the project passes a certain level of size & complexity

Some technologies, optimized for rapid development, don't scale beyond that point: they don't allow the flexibility & power to grow in complexity & scale, without compromising features & simplicity

After working for 2 years, building a very large & complex enterprise product, I can truly say Django is mature enough & scales extremely well

Still have to take care of:

Deployment

Configuring Apache, DB, Virtual hosting, Prod & Staging environments, &c

Specific application requirements:

Traffic peaks

DB clustering & extreme scalability

Start with: [there are still 2 problems one faces today, not handled by Django]

2. Besides that I had to meet 2 challenging requirements:

Very affordable hosting

Must handle extreme peaks of traffic (most of the year traffic is low, but around DST events, traffic can be >1M hits per day)

Using AppEngine

AppEngine is based on Django, & solves the 1 pain left when using it - it just takes from you all the worries & boring work on:

deployment

hosting

scalability

DB management

Ends with: [You really should have seen my face when Google announced AppEngine]

Lesson #2

is awesome!

AppEngine Demo

Alex Arshavski & me made a small Demo of using AppEngine for a previous developers event at Google

It took us 2 cafe meetings

Try application at:

http://ppl-search.appspot.com

Download source code:

http://code.google.com/p/ppl-search

How come we could build it so fast?

Because AppEngine (& Django) let's you focus just on the business logic, & do it simply

Because we used of components & Web-Services, that we just needed to mash-up

Because the documentation is extremely good, & you can get an answer to any problem you encounter

What's the catch?

Experienced people always think long-term & manage risks

So their main concern is vendor locking being tied to Google for ever with their application

It turns out Google had to make some modifications to Django, so writing for AppEngine, isn't like writing pure Django (which can run anywhere)

Tip

Always use the AppEngine Django Helper

Using the Django helper

Let's you write regular Django application, and adapts them to AppEngine

Abstracts some of the Google API's

Allows you to take your site to other cloud/hosting services with only minor changes

To use it:

Create an app using the AppEngine SDK

Replace the content of the folder created with the content of the helper

Rename the app in the app.yaml file

Is AppEngine production ready?

Make sure to be familiar with the quota of the service

Requests are limited to 10s

Throughput is limited

Note that its not yet production ready, mainly in the aspects of uptime SLA & support.

Subscribe to the outage announecement Google group to get notifications on Up-Time

There's also a great monitoring dashboard of cloud services: http://cloudstatus.com

BTW, about Amazon EC2

The main difference is that EC2 just provides the cloud infrastructure, but not the application stack, so you still have the headaches of deployment, configuration &c

The good thing is that it's completely flexible, & can run any technology / legacy application

Say in the end: [You may end up having a cloud hybrid some back-end services on EC2 & the front-end on AppEngine]

Criticism on Django

Why I hate Django - hilarious keynote from DjangoCon, by Cal Henderson (Flickr's Architect):

http://tinyurl.com/hatedjango

Extremely funny..

Thank you !

Udi h Bauman
http://twitter.com/dibau_naum_h
[email protected]