Google App Engine and JDO databases

So what exactly is Google App Engine and why do we need it? Well, GAE is a platform that enables you to build and host web apps on the same systems that power Google applications. GAE allows us to quickly develop and deploy our applications without having to worry about reliability, scalability, hardware, patches or backups, and so on. However, this reliability and scalability comes at a cost and that cost is the flexibility with which we can select our DBMS and design our database schema. In fact, both of these are more or less chosen for you when you choose to use GAE as your backend!

GAE comes with a JDO database – meaning that it comes with a special database that allows you to directly convert Java objects into rows of data called entities (hence the name). This JDO database is built on top of a special web database called BigTable, which is designed to be extremely quick and scalable, and is actually not a relational DBMS like MySQL (see http://en.wikipedia.org/wiki/BigTable). This primarily means that not all of the features we learned in Chapter 3, SQLite Queries, about SQL (that is, JOINS) will be applicable here, so your design decisions regarding how your database schema should look are somewhat limited.

In light of this, Google does a nice job in providing you with a variant of SQL called GQL, which is a querying language designed for retrieving entities from the App Engine scalable datastore. Again, there are some differences but the general feel of GQL is much like that of SQL: where you have SELECT statements with WHERE filters and other familiar clauses like ORDER BY and LIMIT. In this way, for those who are only familiar with relational systems like MySQL, it shouldn't be terribly difficult to pick up.

For the sake of completeness, other differences include not being able to filter on multiple conditions without having to build an index, not being able to use inequality filters on multiple columns within the same query, and not being able to filter for rows with missing fields, amongst others. The reason for all of these seemingly arbitrary differences involve the architecture of the BigTable database. Because of the way it's designed and the way it indexes each row that is inserted, certain queries that are available in relational databases like MySQL will no longer be applicable with BigTable. However, because of this architecture, BigTable is inherently scalable, and so when choosing between the two just keep these trade-offs in mind.

In any case, words can only take you so far and all of these differences and similarities will become much clearer once we start seeing some actual code. Thus, in addition to having the Android SDK installed, I invite you to take some time getting Google App Engine set up using the following URL as a guide:

http://code.google.com/appengine/downloads.html#Download_the_Google_App_Engine_SDK

At this point, we're ready to dive right into some code and try to piece together a fully functional Google App Engine backend for our Android applications!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.38.92