03 Feb 2012

Most popular web browser by country

02 Feb 2012

Check if your mobile number affected by the 2G license cancellations

India mobile status

30 Jan 2012

Optimizing App Engine datastore reads

Under the new pricing scheme, Google App Engine has suddenly become very expensive for even moderately active apps. For the free quota, you are only allowed 50k datastore reads (that is 50k entities, not 50k queries).

To take an example, I run a todo app on GAE that needs to query the database for last 7 day trends. So if a user has 10 tasks, the app retrieves 10x7 = 70 db entities.

  query = db.GqlQuery ('SELECT * FROM Records WHERE date > DATETIME (:1)', lastweek)

This design will run through the free quota very rapidly. At 7 tasks per user, this app will only get 1k pageviews per day for free.

Remarkably, no other quota comes close to expiry. If only this db read quota was taken care of, the app will comfortably go back to the free quota limits.

So I decided to tweak the design to drastically reduce the db reads per pageview. Instead of one entity per task record, I consolidated all records into one single master entry using JSON.

  data = [{'task':'Walk the dog', 'records':[1,0,0,1,0,0,0]}, {'task':'Water garden', 'records':[0,0,0,1,1,1,1]}]

  json.dumps (data)

With this design, a single pageview will generate just 1 db read, as opposed to 70-100 earlier.

You should note that the TextProperty can be a maximum of 1Mb, so if you need more space, consider using the Blobstore.

25 Aug 2011

App engine charts Greasemonkey script

For everyone who manages more than a few App engine applications, this greasemonkey script adds an inline chart to each app-id on the dashboard. This way you don’t have to click through to each application page.

GAE demo

// ==UserScript==
// @name          GAE graphs
// @namespace     pratham.name
// @description   Adds inline graphs for GAE apps
// @include       https://appengine.google.com/
// @include       http://appengine.google.com/
// @require       http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserScript==

function main() {
  $('a[title="view dashboard"]').each (...
08 Jun 2011

EveryDNS to shut down in August

EveryDNS, my DNS host of choice, has informed its users that it will shut shop on August 31.

DynDNS, the new owners, will charge a 5$ redeemable fee for this transfer. Apart from that each hosted domain will cost 30$ per year (20$ for the first year). Note that EveryDNS used to be free for 20 domains.

I’ll be moving my hosted domains to Namecheap FreeDNS, who I anyway use as...

29 Apr 2011

Rajiv is the most common India CEO name

Indian CEO names

According to LinkedIn, the name “Rajiv” is the most common Indian CEO name. Oddly, the name “Rajeev” - an alternate spelling for “Rajiv” - also comes in at no. 8.

08 Mar 2011

Django recently deleted the documentation of the 0.96 version, the very same version that Google App Engine uses for its default templating engine. Luckily someone has mirrored the entire documentation.