App Engine Dev Tips #7 : Datastore Tips

Here are a few tips to dealing with the Datastore:

  1. Persistence is important in your applications. Any application that is useful will eventually need some persistence or the other. So do not stay away from learning it.
  2. The GAE Datastore is not like your typical Relational Database (RDBMS). You can definitely apply some concepts here but it is different. It will help to get some grounding in NoSQL databases and how to work around that.
  3. Remember that data storage is cheap and you have massive computer architectures that help in scaling your application. So having a bit of redundant data is ok as a start.
  4. Keep your entities simple. Do not nest them too deeply.
  5. Understand GQL (Google Query Language) and see how it works. Understand its limitations around the types of queries that you can fire.
  6. Be aware that the amount of data that you can have in your application is governed by Quotas. You have a total of 1GB of datastore available to your application in the free quota. Anything beyond that comes under paid category. Be aware that usage of Datastore Admin and Datastore Viewer count against your application quota.
  7. The database is common across all versions of your application. So if you plan on deploying multiple versions of  your application, be aware of this fact otherwise you might end up compromising your live data. It is better to have a different application if you are not able to cleanly separate this across versions. To understand Application Versioning, check out Tip #6.
  8. Look at libraries like Objectify that make the tasks of working with GAE Datastore very easy. Do evaluate them and see if they work out for your project. In most cases, it will. 
  9. Try to identify the indexes correctly in your application. This will be useful while searching in your application via GQL.
  10. If you are looking at storing large amounts of data e.g. videos, files, etc, do consider the Blobstore or better still Google Cloud Storage for this purpose. That is a better fit rather than trying to fit everything into the GAE Datastore. 
  11. Google also provides a Google Cloud SQL that provides the familiar MySQL database as a service. If you are more comfortable with MySQL, go for that. 

Check out all the App Engine Development Tips.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s