Building Cloud Applications: Windows Azure vs. Google App Engine
Building Cloud Applications: Windows Azure vs. Google App Engine
In general, I’m excited about cloud computing and I like the options that are out there.
For small departmental LOB apps it’s nice to have a quick place to deploy to without
requiring new server environments. For something like a Facebook app that might need
enormous scale quickly, Azure or GAE makes this really easy. I think Microsoft did a
great job of creating a product to ease people from stand alone windows servers to a
cloud environment with hosted services, azure and the ability to mix on and off premise
pieces of an application.
Here are some reasons to use Google App Engine (GAE) and advantages of the platform
compared to Azure
• Want to write code in Java, Python/Django or any language that runs on the JVM
• Need integrated mail functionality
o Azure requires your own SMTP server outside of the cloud environment
• Need integrated XMPP messaging
o Again, Azure would need an external server.
• Need scheduled processing jobs
o You can be creative and write something with queues and/or worker roles
or perhaps a service running elsewhere to ping your web server on a
schedule to run a job.
• Need distributed caching via memcahe
o There has been some talk of adding Velocity to Azure which would be
comparable to memcache. Otherwise, if you only have one web instance
you can use ASP.NET caching. If you have multiple web instances, then
you need a way to invalidate the other server’s cache. Inter-role
communication is coming soon which would make this possible. In the
mean time you could use .NET service bus to communicate between web
role instances (in theory it seems like this would work)
• Want mostly free hosting for small applications – GAE has a free quota
o Azure is free up to a limit in the CTP, but once live nothing is free. I’d
really like to see Microsoft keep some free version for developers to
experiment with or include CTP-like free quotas to BizSpark members.
Developers like to tinker and release small apps. If App Engine is free,
they are going to chose that and will probably be less likely to chose
Azure once comfortable with GAE. It seems like a good approach to
provide some level of free support until an app becomes large enough
where a developer can afford to pay (or it’s too costly to provide them free
service)
• GAE has a ridiculously fast deployment time. One click in GAE launcher or a
console command and the application deploys in less than a minute
o Azure deployment is just brutally slow. Make a sandwich, grab a good
book – it’s going to be awhile. This is especially an issue when you
consider the next bullet point. Every time you deploy to Azure it’s
provisioning a new virtual machine unlike GAE which is just copying
files. I’m sure there are good reasons why this needs to be done, but I
really wish it had some quick deploy / file copy option. There is nothing
more gut wrenching then waiting 30 mins to finish deploying and you
forgot to to change one line of code. Now you are stuck waiting another
30-45 mins to delete the current instance and redeploy.
• If it runs locally in GAE, chances are very high it will run the same in GAE once
deployed
o Some things I do that work fine locally in Azure don’t work in the cloud.
99% of the time it’s my fault so I’m not blaming Azure, but it seems to
happen to me somewhat regularly. Unfortunately I don’t have specific
examples, but I’ll Twitter them as they come up. This wouldn’t really be
an issue for me if I could quickly view logs and redeploy on Azure.
• GAE has excellent utilities for CRUD operations on your data store
o Once you deploy to the cloud in Azure you can’t easily
view/delete/edit/add entities to the storage systems. I wrote my own utility
which I’ll post soon to do that and there are some others out there with
various levels of functionality. It’s still kind of a pain though and the
ability to do this would help debugging.
• GAE is fast to change code. For most code changes you can just change the line
and refresh the browser.
o In Azure this can be a real pain. First it’s managed code so you need to
compile. Second, debugging Azure deploys itself to the local dev fabric. If
you make a change to one line of CSS or JS or HTML in Visual Studio,
then you have to stop debugging, change the line and re-run which takes a
min. or two. When you are making small changes like a line of Javascript
this is super tedious. It almost made me cry. I had to make a 2nd web app
in my project, move the js/css into there and change the links to reference
those in the web role. That way I could make changes without having to
stop my local development server. This can’t be right. It’s awful. Clearly
I’m an idiot and am doing something wrong. I really don’t understand how
people are building complex UIs in a web app if this is the case.
• GAE lets you view logs in real-time
o Viewing logs in GAE can be done through the apps dashboard. In Azure I
need to go to the portal, click to copy the logs to the Blob store which
takes some time. Then I have to compile the Drive Mount powershell
script, configure with my credentials, run it, mount the drive, browse to
the log dir on the blob store, copy them locally and view. Granted once
you have the script compiled and the drive mounted you only need to click
copy on the portal and copy them via the command line and view. Still it’s
slow and cumbersome. For a CTP it’s mildly acceptable, but Microsoft
really needs to add some sort of online log viewer if I’m going to be
paying for this. The only way to troubleshoot what’s wrong when you
deploy to the cloud is via the logs and Azure makes this somewhat painful.
• Simple API for accessing GAE data store
o Part of this is just comparing python to C#, but it’s a lot fewer lines of
code to define a model and do any CRUD operations on it in GAE
• Some useful data store functionality
o GAE supports list properties and referencing other entities. In Azure you
could just serialize a list or convert to JSON to store multiple values, but
not as convenient. The references property also makes transitioning from a
relational store to a flat table storage easier. Azure it’s a little more of a
pain to get referenced entities and it’s all manual.
o Secondly you don’t have to worry about creating unique row keys in
GAE. In Azure each entity needs to specify a row key and partition key.
They also have to be named RowKey and ParitionKey which seems odd
when you can specify the attribute: [DataServiceKey("PartitionKey",
"RowKey")] Then I need to add some comments and remember my row
key is really my username or something.
o Indexes. In GAE you can add indexes to some columns with some
restriction. For now Azure doesn’t support indexes on any columns
besides the key
o GAE supports transactions which is helpful when changing multiple
dependent entities
• No hassle config – you basically have an app that scales without worrying about
partitioning data or adding instances.
o In GAE the app automatically scales. In Azure you need to change the
config to add new web or worker role instances. This requires more
monitoring and it’s also harder to write worker roles that balance
effectively especially since in code you can’t tell how many are running.
You also have to think more about partitioning your data, but I suppose
that might let you you do more performance tuning.
• Development environment on Linux/OSX/Windows
o Azure development requires Windows.
Here are some reasons to use Windows Azure and advantages of the platform compared
to GAE:
Between the two I think you have good options depending on the type of apps to build.
The development time on GAE feels faster to me because of deployment, log viewing,
and probably just less code in Python vs. C# The cost of GAE makes it a little cheaper to
launch new applications. In some cases background processing or relational storage are a
must and Azure is a better choice. Or if you need to leverage some onsite data or
services, then Azure is great. If you are porting an existing app then your choice is most
likely made by which language the current app is written.
While I really do like Azure, the previously mentioned development time issues
combined with my Visual Studio not being able to make CSS/JS/HTML changes on the
fly make me hesitant to use Azure for casual projects. I probably spent around 30 hrs to
code all of TwtMyCard on Azure. In App Engine I maybe could have saved a few hours
because of writing a little less code in Django/Python and the GAE data store. But on top
of the 30 hrs in Azure I easily wasted 10-15 hrs with deployment, tracking down issues in
the cloud, getting the logs and fixing HTML/CSS/JS.
If Azure added web viewable logs, fixed the VS issue, supported Velocity, supported
indexes and added inter-role communication, I’d be so happy.
Regardless of hosting choice, I love not having to mess around with web server or
database configuration to deploy an application that scales reasonably well (in theory –
still waiting for Silverlight Draw or TwtMyCard to reach 1 million users to verify).
In the future I’ll update this post as I use them both more or people tell me I’m wrong
about some things or the products evolve.