Parse.com and ScriptDB performance comparison

Lately I’ve been doing a lot of posts to do with messing around with color. I’m using a selection of technologies such as scriptDB, Parse.com, jQuery promises, Google Apps Script, Google Spreadsheets, Google Visualization API and VBA to create a series of colorscheming apis and apps.

I found that neither parse.com nor scriptdb were ideal for bulk loading of data. I hit many problems to do with execution time, throttling and so on, but once the data was loaded, I wanted to compare how they performed for data retrieval.

The test is to retrieve a few thousand rows from each of scriptDB and parse.com for from Google Apps script. We’ll also use the parse.com javascript api from a jQuery app as a benchmark.

Normalization

There are a few things that are different that I have had to normalize to be able to abstract away the database layer. A few of them are

  • Different query limits – I batch up queries to the same limit so that the number of actual accesses are comparable. 
  • Throttling – You need to throttle parse when using the API for write. However for this retrieval test, it doesn’t seem to cause any issues.
  • You extend the parse object with your own class definition, but scriptDB doesn’t have that concept. Instead I use siloing to partition the scriptDB. I also write control information such as timestamps, in the same way as parse.com does.
Shared source code
In oder to ensure I’m using the same code in both Google Apps Script and javaScript, I use GAS to serve up library source code to client based javascript apps. It’s not entirely efficient but it is effective to ensure a single codebase.

The results

Here are the results to query and retrieve about 4000 rows from each of the combinations. 2-3 seconds is pretty good for this operation. There’s nothing in it between the parse.com REST API and scriptDB when used from Google Apps Script. Parse.com can be improved by using the Google Cache service as below. Using the Parse.com javaScript API from a local client is a lot slower than all the others.

The code

Here’s the tester. For the libraries and code behind all this see Excel Liberation.

http://xliberation.com/p/gaspubcontainer.html?source=script&library=colorschemer&func=timeIt&module=common

More color schemes

I’m looking for more color schemes. If you would like to contribute a color scheme, all I  need is the link to a Google Document with the scheme in it, like the colortable tab in this spreadsheet.

Colorschemer App

Here’s a live app built using many of the techniques described in this post. Enter a color code, try a different scheme or click on one of the palette colors to cause interaction with parse.com.
http://xliberation.com/parse/colortable/colorschemerui.html

(function() { var po = document.createElement(‘script’); po.type = ‘text/javascript’; po.async = true; po.src = ‘https://apis.google.com/js/plusone.js’; var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(po, s); })();

Author: bm082975

Leave a Reply

Your email address will not be published. Required fields are marked *