- The "nearest branches" feature is now much more accurate. Before the update, the API tended to favour nearest branches by longitude (east-west of your location) over latitude (north-south), resulting in branches further away but in an east-west direction ending up higher up the list than those north-south. The API was behaving like this because changes in longitude are much greater for the same distance on the ground than changes in latitude where UK and Ireland are located on the planet's surface. I had over-compensated for this effect in my arithmetic. In fact, for longitude the conversion to distance is the same as latitude except the value is multiplied by the cosine of the latitude. Lesson learned!
- Obtaining product information is much faster. This works by pooling the search session to a special account on our grocery API so all Tesco Finder users share the same login session - since you don't have to login as anyone to use Tesco Finder, the API has to login to a special grocery account in order to search for products and provide pricing and offer information. Before now, each search was preceded by a login for that user - nice and safe in the multi-threaded computing environment of the API. Sharing the same login session is a lot trickier because that session has to be locked to each user in turn while the search takes place. Fortunately it's so quick that the queue of search requests waiting in turn to lock the session does not build up.
That's why it's taken some time and lot of testing to ensure that this programming pain is worth the performance improvement for Tesco Finder customers. I'm glad to say it has worked out well - it's now live as of 1:30pm today.
my poor Android phone...
ReplyDeletejust itching to order some groceries :(
Hi Nick. Big fan of the blog. I work in Corporate Marketing at Tesco HQ.
ReplyDeleteI'm very impressed that you've considered the curvature of the earth in bringing out the list of nearby stores. Something I've never considered! However, i have a couple of questions, if I may.
1. Why doesn't the app use drivetime data, rather than straight line distance? This data is available at Tesco, and is a more accurate view of a customer's nearest store, esp in urban areas.
2. Also, as accurate as the calculation might be, if the store location data is incorrect (store location is a few 100m out), surely this would have more impact on the overall accuracy? How do you vouch for the accuracy of over 2,000 stores?
Gareth