views:

567

answers:

2

Hello,

Is there a way to use a real database(SQLite, Mysql, or even some non-relational one) as datastore for development, instead of memory/file datastore that is provided.

I saw few projects, GAE-SQLite(did not seem to be working) and one tip about accessing production datastore using remote api (still pretty slow for large datasets).

+1  A: 

bdbdatastore is an alternative datastore backend that's considerably better than the one built in to the development server, although the datastore is far from being the only problem with the dev server when it comes to handling large applications.

Wooble
unfortunately it is pretty outdated, I tried to apply the patch to SDK 1.3 but the patch is pretty big to be fixed without understanding all the underlying code.
M. Utku ALTINKAYA
+2  A: 

MongoDB works great for that. You will need:

code:

import datastore_mongo_stub

os.environ['APPLICATION_ID'] = 'test'

datastore = datastore_mongo_stub.DatastoreMongoStub(
    os.environ['APPLICATION_ID'], 'woot', '', require_indexes=False)

apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', datastore)

But if you're looking for truly faster development (like I was) the datastore is actually not the issue as much is the single threaded web server. I tried to replace it with spawning but that was a little too hard. You could also try to set up TyphoonAE which will mimic the appengine stack with open alternatives.

Be aware that if you do any of these, you might lose some of the exact behavior the current tools provide, meaning that if you deploy you could get results you didn't expect. In other words; make sure you know what you're doing :-)

Koen Bok
Koen thanks, that is the closest thing to what I was looking for. Unfortunately admin console is useless since schema introspection is not implemented. I am looking for a gui tool that I can use to view data at least.
M. Utku ALTINKAYA
Ok, then a few other pointers. There is a guy who started a SQLite stub: http://blog.appenginefan.com/search/label/SQLite. I'm nut sure if he ever finished it, but maybe you can get it to work. There should be enough GUI browsers for SQLLite. But keep in mind the data model is not very browsable as it's mimicking a key-value store. Then again, I have done a sh*tload of appengine development and never really needed the data browser, but maybe that's a style thing. Good luck :-)
Koen Bok
Oh, and thinking about it, the databrowser should actually work with any stub as it uses the normal datastore api. So if it doesn't work out of the box it should not be hard to fix.
Koen Bok
I am accepting answer, It is quite usable, thanks again.
M. Utku ALTINKAYA