Wednesday 7 September 2016

Static Map APIs (snapshots of maps with drawing on it)

Have you ever run into a requirement where you need to share a static image of a map with things (e.g. Pins, Polylines, Areas etc.) drawn on it? My guess is that this is a regular requirement for social integrations/sharing use cases. Nowadays, almost every new product lets you share statistics (could be either related to user's activities on a new mobile app or just sharing a map where a couple of folks were just drawing lines etc.) on Facebook or Twitter or (is there a third :O?).

As it turns out, most of the big Map API providers i.e. Google and Bing, support what they call a static map API which essentially returns what you need. They return an image in response to a web call with stuff drawn on it as indicated in the HTTP request.


Below is a simple guide to get it done with Google APIs.

1. Get a key from Google Maps API portal.


2. You are set :). Just try out the sample URLs mentioned on the developer portal from your browser. Browser should display the picture.






3. Give it a try from Fiddler.




You are set to share map snapshots with others.

Only thing to keep in mind is the pricing model of different providers. For most general usage scenarios, this API is almost free.




Tuesday 6 September 2016

Azure Data Lake vs Azure Blob Storage

References:
https://azure.microsoft.com/en-us/pricing/details/data-lake-store/
https://azure.microsoft.com/en-us/pricing/details/storage/
https://azure.microsoft.com/en-gb/documentation/articles/data-lake-store-comparison-with-blob-storage/

I was going through the costing structure of Azure Data Lake and was wondering how its pricing stacks up against the pricing of Azure Blob Storage.

As it turns out there is a good difference and for very good reasons.

First of all, its storage cost is a little more expensive than Azure Blob Storage. But that is expected as Azure Data Lake is designed for storing massive amount of unstructured and semi-structured data and has no practical limit on the size of the data that needs to be stored.

Azure Data Lake:

Azure Blob Storage:


So the storage cost is about 10 times per GB for ZRS and comparable for other expensive options like GRS and RA-GRS. If you are keeping data in a single zone and you don't plan to store the whole internet (what?), Azure Blob Storage is definitely cheaper.

Now, let us look at transaction costs:

Azure Data Lake:

Point to note: 1 transaction means reading/writing a 128 KB chunk.

Azure Blob Storage:
        $0.0036 per 100,000 transactions for Block Blobs. Transactions include both read and write operations to storage.

So how do you choose:

1. If you are just piling up unstructured data with the requirement of frequent and fast retrieval, go for Azure Blob Storage.
2. If you want to run analytics (ADAL jobs) on stored data, go for Azure Data Lake.
3. If you want to do both frequent and fast data retrieval and perform analytics, duplicate the data in both stores. There is no either/or scenario here. With current state of PaaS services, it seems to be the only way right now.