![Page 1: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/1.jpg)
CityGrid’s Journey to 20MM Businesses & 1+ Billion Calls
Ana MartinezKin Lane
M.C. EscherFebruary 2012
![Page 2: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/2.jpg)
Limos.com
CityGrid
![Page 3: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/3.jpg)
Limos.com
The Challange
• 17-20 MM Places in US
• 30+ MM Content
• 300 MM Places Worldwide
• 2010: 100+ MM calls/day • 2011: 200+ MM calls/day
• 2012: 1+ Billion calls/day
![Page 4: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/4.jpg)
The problem
![Page 5: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/5.jpg)
Big Bottleneck!
![Page 6: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/6.jpg)
Single POF!
![Page 7: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/7.jpg)
CityGrid Platform Architecture
![Page 8: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/8.jpg)
Places Processing
![Page 9: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/9.jpg)
Places Processing
![Page 10: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/10.jpg)
Why is it hard?Book is to ISBN what Product is to UPC and what Place is to ______
No centrally regulated unique id (tax id is, but not public). Now what?
Spago176 Canon DrBeverly Hills, CA 90210310-944-3924
R. French Ac & Heating Inc Ray French Air Conditioning & Heating Service
2211 martin luther king blvdlos angeles, CA, 90069
2211 MLK boulevard #104west Hollywood, CA, 90069
310-358-5903 866-465-5303
![Page 11: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/11.jpg)
Problem Definition
• Medium size data set – 21mill rows, 120 cols
• Time to process: Daily
• Hybrid environment
• Not all data is from same source
![Page 12: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/12.jpg)
Solution
![Page 13: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/13.jpg)
Normalizer
Soundex Metaphone NYSIIS
Matching Rating
ApproachCoverphone
![Page 14: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/14.jpg)
Know Your Data
![Page 15: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/15.jpg)
Normalizer
123 Martin Luther King.\n
123 MartinLutherKing.
123 martinlutherking.
Martin Luther King | martinlutherking canon column
the | \n | ave | (tokens)
![Page 16: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/16.jpg)
Matching Strategy
Do what you can on automated fashion and complement with manual steps.
![Page 17: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/17.jpg)
Matching Strategy
Exact matchingSet similarity joins
Custom fuzzy matching
![Page 18: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/18.jpg)
Matching Strategy
• C - Support Vector Machine
• Threashold: 0.996– Precision: 98.1%– Recall: 97.5%
84% + manual -> % Match Rate
![Page 19: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/19.jpg)
Merger
Rules:Provider truthworthinessVoting rulesNew data vs Old dataSuper providers
History:AcceptedRejected
![Page 20: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/20.jpg)
Example123 M L K Road Ste 45 123 Martin Luther King Rd 123 Martin L King Drive #45
123 m l k road ste 45 123 martin luther king rd 123 martin l king drive #45
(123) (m) (l) (k) (road) (ste) (45)
(123) (martin) (luther) (king) (rd)
(123) (martin) (l) (king) (drive) (#) (45)
123 mlk road ste 45 123 martinlutherking rd 123 martinlking drive # 45
123 mlk rd ste 45 123 mlk rd 123 mlk dr #45
123 mlk rd 123 mlk rd 123 mlk dr
123 mlk 123 mlk 123 mlk
MATCH! MATCH! MATCH!
![Page 21: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/21.jpg)
Findings & Tips
• Domain Knowledge
• Automation • Mechanical Turk • Machine Learning
Run every 2hrs -> Match Rate of %
![Page 22: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/22.jpg)
![Page 23: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/23.jpg)
Developer API’s
developer.citygridmedia.com
![Page 24: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/24.jpg)
Solution for Search APIs
![Page 25: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/25.jpg)
Requirements for Places Store• Scalability
• Built in Partitioning & Replication
• No Schema
• De-normalized Fast Document Reads
• Good Documentation / Support
Mongo DB satisfied all our requirements!!
![Page 26: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/26.jpg)
Solution for Places API
![Page 27: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/27.jpg)
The Listing CollectionPRIMARY> db.listing.findOne({"public_id":"pinks-los-angeles"}){
"_id" : ObjectId("4f0c0e974e8ab89b6982d39e"),"public_id" : "pinks-los-angeles","phone" : "2133878525","cs_rating" : "8","business_operation_status" : "1","id_alternates" : ["cg:45457592”,"iusa:615760956”],"address" : {
"street" : "326 S Western Ave","city" : "Los Angeles","postal_code" : "90020","cross_street" : "","latitude" : 34.0684,"longitude" : -118.3089,"state" : "CA”},
"name" : "Pink's”}
![Page 28: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/28.jpg)
The Content CollectionPRIMARY> db.content.findOne({public_id:” pi-on-sunset-los-
angeles",cap_provider_id:{$in:[”0”,”1”]}}){
"_id" : "pi-on-sunset-los-angeles_0_70507571_image", "width" : "216", "public_id" : "pi-on-sunset-los-angeles", "url" : "http://images.citysearch.net/assets/imgdb/auth_ws/2010/4/20/0/ZtOIaiiG0.jpeg", "attribution_text" : "Citysearch", "content_id" : "70507571", "height" : "216", "attribution_logo_path" : "http://images.citysearch.net/assets/imgdb/custom/ue-357/CS_logo88x31.jpg", "content_provider_name" : "CITYSEARCH", "image_type" : "generic_image", "listing_id" : "45228161", "content_type" : "image", "content_provider_id" : "5", "cap_provider_id" : "0"
}
![Page 29: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/29.jpg)
Performance Results
![Page 30: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/30.jpg)
Updates
• Hours
• Real Time
![Page 31: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/31.jpg)
Real Time Updates
![Page 32: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/32.jpg)
Places Detail – Demo Time!
• Details by ID
– http://api.citygridmedia.com/content/places/v2/detail?listing_id=11280452&client_ip=123.4.56.78&publisher=test
– http://api.citygridmedia.com/content/places/v2/detail?public_id=pinks-hot-dogs-los-angeles-2&client_ip=123.4.56.78&publisher=test
![Page 33: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/33.jpg)
Improvements
• Shard Listing and Content Data
• Integrate Mongo across all APIs
![Page 34: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/34.jpg)
APIs
Now we have rich Places API
How do we make developers aware they exist?
How do we get them to successfully integrate?
![Page 35: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/35.jpg)
APIs – Supporting Developer Area
Common Building Blocks
Terms of Use• Getting Started• Publisher Overview• Documentation• FAQ• Terms of Use
![Page 36: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/36.jpg)
APIs – Supporting Developer Area
Developers Tools
Terms of Use• Code Samples• Libraries• Mobile SDKs• Starter Kits• Hackathon Toolkits• Partner APIs
![Page 37: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/37.jpg)
APIs – Evangelism - Online
Terms of Use
• Blogging• Twitter• LinkedIn• Facebook• Github• Stack Overflow• Quora• Hacker News• StumbleUpon• Reddit
![Page 38: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/38.jpg)
APIs – Evangelism - Offline
Terms of Use
• Conferences• Hackathons• Meetups• Workshops
![Page 39: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/39.jpg)
APIs – Easy Start + Engage Immediately
Terms of Use
• Testable APIs• Self-Service• Email After Registration• Follow on Twitter• Follow on LinkedIn
![Page 40: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/40.jpg)
APIs – Feedback Loop + Voice
Terms of Use• Email Support• Forum(s)• Twitter• LinkedIn
![Page 41: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/41.jpg)
APIs – Monetization = Sustainability
Terms of Use
• Local Web Advertising• Local Mobile Advertising• Local Custom Ads• Places that Pay
![Page 42: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/42.jpg)
APIs – Evangelize Internally
Terms of Use
• Developer Feedback• Roadmap Suggestions• Landscape Analysis• Technology Awareness• Trends• Internal Hackathons
![Page 43: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/43.jpg)
APIs – Measure & Repeat
Terms of Use
![Page 44: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/44.jpg)
Q&A - Thanks to the Team!
![Page 45: CityGrid Architecture + API Overview from O'Reilly Strata Conference](https://reader034.vdocuments.us/reader034/viewer/2022051412/54b5eacc4a795948248b46ae/html5/thumbnails/45.jpg)
Q&Adeveloper.citygridmedia.com
We are hiring! citygridmedia.com/careers