Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thurloat/httpdb

An HTTP Interface to AppEngine's datastore.
https://github.com/thurloat/httpdb

Last synced: 9 days ago
JSON representation

An HTTP Interface to AppEngine's datastore.

Awesome Lists containing this project

README

        

===================
Project Description
===================

HTTPDB is a very simple and fast publically accessible key:value datastore that runs on App Engine. The idea is to give developers who have rich client applications the ability to store application information in the cloud with no setup. As a naming convention, the developer should strictly define data structures on the front end with keys such as "Class:Identifier:Property" which could map to something like "User:105:foo" which holds the value "bar".

=====================
External Dependencies
=====================

The current incantation of the code is built on Google App Engine, however it disregards App Engine's built-in framework which uses webapp and a stripped down Django.

Cherrypy framework to map urls and handle general requests
- http://www.cherrypy.org/

simplejson to help convert the Protocol Buffer formatted db entities to pretty JSON strings
- http://pypi.python.org/pypi/simplejson/

App Engine Datastore api to store the data
- http://code.google.com/p/googleappengine/source/browse/trunk/python/google/appengine/api/datastore.py

===============
Current Example
===============

Request for Empty Data
~: curl http://httpdbapp.appspot.com/get/foo/
{}

Set Key to Value:
~: curl http://httpdbapp.appspot.com/set/foo/bar/
SET

Re-Consume the Data:
~: curl http://httpdbapp.appspot.com/get/foo/
{"foo": "bar"}

===================
Performance Results
===================

A lot of the discoveries in this project are performance based. Here's a list of real test performed on the appspot domain from a dedicated server, and what was done to achieve the result in the comments.

App Engine Version || Comments || Req / Sec || Req mean time (ms)
------------------------------------------------------------------------------------
Java GAE: norexmedals || || 178 || 1068
------------------------------------------------------------------------------------
v. Cherrypy || Using sync DS req. /w || 223 || 887
|| Datastore.get() || ||
------------------------------------------------------------------------------------
v. Protobuff || Async DS req. using || 297 || 682
|| protobuff.__json__() || ||
------------------------------------------------------------------------------------
v. None || returns True in main() || ~500 || ~450
------------------------------------------------------------------------------------

Notes:
- All tests were run 4 times, and the average was taken (not thorough, i know) ab -c 200 -n 2000
- the norexmedals project runs on Java App Engine and returns a heavily memcached JSON result.
- no caching was used for the Cherrypy or Protobuff versions.
- the same payload was generated and returned for all tests (minus the barebones True test)

Started Using CherryPy wsgi framework. feature stripped, 10-20ms response.