public
Description: An alternate datastore backend for App Engine, implemented using BDB JE.
Home | Edit | New

Trying out BDBDatastore

Introduction

Right now, the only way to use BDBDatastore directly is to patch the Python dev_appserver so it can use BDBDatastore as a backend, but as other app runners come out, we’ll provide instructions on how to use them.

Patching the App Engine SDK

In order to use BDBDatastore as a datastore backend for the dev_appserver, the SDK needs to be patched.

  1. Download the .diff file from here , and save it somewhere memorable.
  2. Change into the directory the App Engine SDK is installed in. This is probably called “google_appengine”.
  3. Run this command:
patch -p1 < path/to/bdbdatastore_dev_appserver-0.2.1.diff

You should see a listing of patched files, and no errors.

If your OS doesn’t have the ‘patch’ command (eg, Windows), or if you just don’t want to patch your copy of the SDK, you can download a complete copy of the SDK, with BDBDatastore patches, from here . Save the file as google_appengine.zip, and unzip it.

Getting and running BDBDatastore

Next, download BDBDatastore from here , and save it somewhere memorable. To run the datastore server, execute this command:

java -jar bdbdatastore-0.2.2.jar datastore

The last argument, ‘datastore’, tells BDBDatastore where to store data for apps. This can be any path the process has write access to.

Upgrading from version 0.1

The storage format changed between releases 0.1 and 0.2, meaning your 0.1 database will not function in 0.2 If you have important data, dump it to a file before upgrading, then reload it into version 0.2.

This will be the last backwards-incompatible change in the foreseeable future, as the storage format is now easily extensible.

Running the dev_appserver.

Now that everything else is set up and running, you can run the dev_appserver as normal. The dev_appserver acts just like it used to, but now it has an extra command line argument, —bdbdatastore. To use BDBDatastore, use that argument to specify where it can find the running datastore server:

./dev_appserver.py --require_indexes --bdbdatastore=localhost path/to/your/app

Note that —require_indexes is currently needed, as BDBDatastore won’t automatically create missing indexes for you as the dev_appserver does.

And with that, you’re up and running! The BDBDatastore should act exactly like the real and local datastores do. If it doesn’t please do tell us about it.

Last edited by Arachnid, Tue Jun 02 09:01:08 -0700 2009
Home | Edit | New
Versions: