Thursday, September 19, 2013

Boosting Speed of ZST

If you're here for the cell culture/biologics support/contamination/OSI PI commentary, go ahead and skip this post.

With Google's increasing emphasis on the speed at which pages load in the browser, users of the Zymergi SQL Tool (ZST) will have a chance to download the newest version which can decrease the page load time by 90%.

For enterprise users, this shouldn't be too big a deal since there is no expectation of fast pages when you're on a corporate portal or intranet. But when you're using ZST as an outward facing query tool, speed matters to SEO rankings.

The ZST process goes:
  • Use the URL to determine database (db), query (qry) and data presentation (t)
  • Execute queries against database.
  • Transform the data into desired output.
  • Send to user.
Pretty simple. But the problem is that we dip into the database every, single, time. If we saved the data to disk we wouldn't have to go to the database. And if we saved the output to disk, we could just pull straight from the output.

Here's the newest version:
  • Use the URL to determine database (db), query (qry) and data presentation (t)
  • Check to see if output file already exists, if so send this file to user... skip following steps.
  • Check to see if data file exists, if so... skipi to the Transform step.
  • Execute queries against database.
  • Save result to data file.
  • Transform the data into desired output.
  • Save result to output file.
  • Send to user.
It's easier to understand what's going on starting from the middle and work your way out. Here's the logic:

If we've already queried the database, why not save this data to disk?
And if we've already transformed the result, why not save the output to disk?

If the output file exists, no need to run the query and the transform, just send the output file.
If the output file doesn't exist, but the data file does, just run the transform and send the output.

Our tests are showing significant decreases in page load times.


No comments: