SlideShare a Scribd company logo
Using MongoDB & Python for rapid 
application development at Dealertrack 
© 2014 DealerTrack, Inc. All rights reserved.
Dealertrack Technologies SaaS overview 
■ We offer a SaaS and data products for the retail automotive supply chain 
■ Customers include: 
■ - 18,500 Dealers (New & Used) 
■ - 6,000 Lenders 
■ - 38 Manufacturers 
■ - 500 Part Mfgrs & Insurers 
■ - 14 State Governments 
■ Implemented with old & new tools: 
■ - IIS / .NET / MSMQ / VB / C# 
■ - Apache / Java / Python / Perl 
■ - RPG2 / DDS / SQL 
■ - Oracle / MS SQL Server / DB2 / MongoDB / MySQL / MUMPS 
© 2014 DealerTrack, Inc. All rights reserved.
Core 
Solu)ons 
and 
Services 
Offered 
■ Transac)on-­‐based 
© 2014 DealerTrack, Inc. All rights reserved. 
solu)ons 
for 
dealers 
and 
lenders 
l Largest 
Online 
Credit 
Applica)on 
Processing 
Network 
in 
the 
U.S. 
and 
Canada 
l Largest 
Outsourced 
Provider 
of 
Contract 
Processing 
in 
the 
U.S. 
and 
Canada 
l Contract 
and 
Vehicle 
Lien 
Processing 
for 
Lenders 
l Vehicle 
Registra)on 
and 
Titling 
Services 
for 
Dealers 
■ Subscrip)on-­‐based 
solu)ons 
for 
dealers 
(SoGware-­‐as-­‐a-­‐Service) 
l #1 
Web-­‐based 
Dealer 
Management 
System 
(DMS) 
l Industry 
Leading 
Sales 
And 
Finance 
Solu)ons 
l Desktop 
And 
Mobile 
Inventory 
Solu)ons 
l Interac)ve 
Solu)ons 
Including 
Web, 
Mobile, 
Search, 
Social 
And 
Chat 
l Unique 
Digital 
Retailing 
Solu)ons 
That 
No 
Other 
Industry 
Compe)tor 
Can 
Provide
DealerTrack 2.0 Conceptual Architecture 
Architecture Goals and Challenges 
• Enable rapid growth in products and services 
• Doing away with point-to-point integration 
• “spaghetti code” 
• Managing merger and acquisition driven 
• growth 
• Enabling applications or content for multiple 
• front-ends, including mobile devices 
• Getting better operational visibility, management, and control of the 
integration / SOA infrastructure 
• Legacy system modernization 
© 2014 DealerTrack, Inc. All rights reserved.
Dealertrack Platform Topology 
© 2014 DealerTrack, Inc. All rights reserved.
Technology 
■ Platform: RedHat Linux 
■ Front-End: Python/Django/Apache WSGI 
■ Services layer – Python/Django/TastyPie 
■ Enterprise Service Bus – Mule ESB 
■ Messaging Broker – RedHat MRG 
■ Databases – Oracle, MongoDB, DB2, MySQL 
■ Local Cache - Redis 
© 2014 DealerTrack, Inc. All rights reserved.
Case #1 – Using Mongo as HTTP Session backend 
■ Python 
■ Django 
■ Mongo DB 
© 2014 DealerTrack, Inc. All rights reserved.
Why ? 
■ The application presents related but separate vertical functionality under one 
umbrella 
■ The shared features require their own schemas in the HTTP session but 
they all share same HTTP session 
■ Data needed in the HTTP session can vary by the specific functionality of 
the shared feature 
■ Performance is critical. We don't want to hold UI thread any more then we 
absolutely have to 
© 2014 DealerTrack, Inc. All rights reserved.
This is what this web application UI looks like 
© 2014 DealerTrack, Inc. All rights reserved.
Introducing Mongo DB as session storage 
© 2014 DealerTrack, Inc. All rights reserved.
It is a question of responsibilities 
■ Need to know basis 
■ Front-End does NOT need to know where the session data is stored 
© 2014 DealerTrack, Inc. All rights reserved.
What do we like about this? 
■ Allows for the the shared features to use their own schemas in the HTTP 
session while sharing the HTTP session 
■ Allows the data to vary by the specific functionality of the shared feature 
■ Front End is completely oblivious of where the data actually stored 
■ Using Mongo DB – obviously cool 
© 2014 DealerTrack, Inc. All rights reserved.
Is this the optimal solution? 
■ The session data is stored in a central datastore 
■ There is some local area network overhead writing into remote centralized MongoDB 
■ What do you think? Any ideas, suggestions? Lets share some thoughts 
© 2014 DealerTrack, Inc. All rights reserved.
It beats our old solution, but can we make it even better? 
■ We like a lot of this approach 
■ We have one concern – remote centralized database calls for every 
session request 
■ Why don't we optimize? 
□ Let’s introduce a local cache. 
□ It is still important for the front end not to know anything about it 
■ What can we do? 
■ Introduce local cache – we are using redis 
© 2014 DealerTrack, Inc. All rights reserved.
Enter local cache 
■ If the data is not present in the local cache – read it from Mongo and 
then cache it locally 
■ If the data is not in Mongo – create new session and return 
© 2014 DealerTrack, Inc. All rights reserved.
Redis local cache + MongoDB centralized session store 
■ Sessions are sticky to the web servers 
■ Session and reference data stored in local cache and mostly accessed from 
there 
■ Data also stored in Mongo as a master cache backend 
■ redis = Local Session Cache 
■ MongoDB – Centralized Session Persistence 
■ Custom Django session backend makes it all transparent to the front end 
web application 
■ Custom redis session backend connects local redis with centralized Mongo 
© 2014 DealerTrack, Inc. All rights reserved.
Case #2 – Using Mongo DB to cache relational data in 
Inventory+ 
■ Inventory+ – another Dealertrack Technologies Solution for auto dealers 
Major Features 
■ Vehicle Inventory Management – Marketing, Pricing, Aging, etc… 
■ Pricing Analytics – Price your inventory based on real market data 
■ Dealership Websites – Based on vehicle inventory and updated in real time 
■ Chat – Host and manage chat services for dealership websites 
■ Many more features for our dealer users 
© 2014 DealerTrack, Inc. All rights reserved.
Case #2 – Using Mongo DB to cache vehicle data in 
Inventory+ 
■ eCarList is using Mongo DB in to cache large amounts of relational data and make it 
searchable 
© 2014 DealerTrack, Inc. All rights reserved.
UI View 
Vehicle Attributes cached 
and read from MongoDB 
• VIN 
• Year, Make, Model, etc… 
• Vehicle Photo URLs 
• Attributes 
• Odometer 
• Color 
• Transmission 
• Engine 
• Etc… 
• Optional Equipment 
• Standard Equipment 
• Pricing Info & Price History 
© 2014 DealerTrack, Inc. All rights reserved.
General Use Case 
■ The objects that eCarList manages are built around Perl’s 
strengths: arrays and hashes 
■ Relational databases do not afford a one-for-one mapping of these 
data structures, so storing and retrieving them is a challenge 
■ Mongo natively handles these structures, and therefore presents a 
cleaner interface for storing and retrieving Perl objects 
■ If a Perl query is conforming to Mongo’s indexing, lookups are 
nearly O(1) 
■ MongoDB is preloaded with search results, further extending the 
O(1) lookup time 
Advantages of Mongo over MySQL in Inventory+ 
© 2014 DealerTrack, Inc. All rights reserved.
Vehicle MySQL Schema 
© 2014 DealerTrack, Inc. All rights reserved. 
vehicle_schema.txt 2013-02-13 
mysql> desc vehicle; 
+----------------------------+---------------------+------+-----+---------+--- 
---+ 
| Field | Type | Null | Key | Default | 
Extra | 
+----------------------------+---------------------+------+-----+---------+--- 
---+ 
| eid | varchar(22) | NO | PRI | | 
| 
| year | year(4) | YES | | NULL | 
| 
| make_eid | varchar(22) | YES | | NULL | 
| 
| model | varchar(255) | YES | | NULL | 
| 
| vin | varchar(255) | YES | MUL | NULL | 
| 
| stock_number | varchar(255) | YES | | NULL | 
| 
| staff_eid | varchar(22) | YES | | NULL | 
| 
| attribute_set_eid | varchar(22) | YES | | NULL | 
| 
| dealer_eid | varchar(22) | YES | MUL | NULL | 
| 
| style_eid | varchar(22) | YES | MUL | NULL | 
| 
| style_interior_color_eid | varchar(22) | YES | MUL | NULL | 
| 
| style_exterior_color_eid | varchar(22) | YES | | NULL | 
| 
| style_engine_eid | varchar(22) | YES | | NULL | 
| 
| cost | varchar(255) | YES | | NULL | 
| 
| price_selling | float | YES | | NULL | 
| 
| price_starting | float | YES | | NULL | 
| 
| price_retail | float | YES | | NULL | 
| 
| active | tinyint(4) | YES | | NULL | 
| 
| model_code | varchar(255) | YES | | NULL | 
| 
comments text YES NULL description2 text description text write_in_options text mpg_highway int(11) mpg_city int(11) include_standard_equipment tinyint(4) market_on_google 255) market_on_autotrader tinyint(4) market_on_cars tinyint(4) other_make_name 255) engine_name 255) price_reserve float subtitle number_videos int(11) number_pictures int(11) interior_color varchar(255) exterior_color varchar(255) | 
- 1/4 - 
| mileage | int(11) | YES | | NULL | 
| 
| trim | varchar(255) | YES | | NULL | 
| 
| price_retail | float | YES | | NULL | 
| 
| active | tinyint(4) | YES | | NULL | 
interior_color varchar(255) exterior_color varchar(255) | 
| mileage | int(11) | YES | | NULL | 
| 
| trim | varchar(255) | YES | | NULL | 
vehicle_schema.txt 2013-02-13 
| 
| model_code | varchar(255) | YES | | NULL | 
| 
| comments | text | YES | | NULL | 
| 
| description2 | text | YES | | NULL | 
| 
| description | text | YES | | NULL | 
| 
| write_in_options | text | YES | | NULL | 
| 
| mpg_highway | int(11) | YES | | NULL | 
| 
| mpg_city | int(11) | YES | | NULL | 
| 
| include_standard_equipment | tinyint(4) | YES | | NULL | 
| 
| market_on_google | varchar(255) | YES | | NULL | 
| 
| market_on_autotrader | tinyint(4) | YES | | NULL | 
| 
| market_on_cars | tinyint(4) | YES | | NULL | 
| 
| other_make_name | varchar(255) | YES | | NULL | 
| 
| engine_name | varchar(255) | YES | | NULL | 
| 
| price_reserve | float | YES | | NULL | 
| 
| subtitle | varchar(255) | YES | | NULL | 
| 
| number_videos | int(11) | YES | | NULL | 
| 
| number_pictures | int(11) | YES | | NULL | 
| 
| interior_color | varchar(255) | YES | | NULL | 
| 
| exterior_color | varchar(255) | YES | | NULL | 
| 
| mileage | int(11) | YES | | NULL | 
| 
| trim | varchar(255) | YES | | NULL | 
date_in_stock date date_sold date date_created datetime date_updated datetime date_craigs_list datetime date_pictures_updated datetime sworm_vehicle_id bigint(20) unsigned MUL sworm_dealer_id bigint(20) unsigned MUL sworm_owner_id bigint(20) unsigned vehicle_condition_eid 22) main_picture_file main_picture_media_eid varchar(22) main_video_media_eid 22) storable text pricing_report_setting_eid varchar(22) autotrader_id int(11) cars_id int(11) trade_eid varchar(22) MUL expenses float | 
- 2/4 - 
| carfax_status | int(11) | YES | | NULL | 
| 
| autocheck | int(11) | YES | | NULL | 
vehicle_schema.txt 2013-02-13 
| 
| date_in_stock | date | YES | | NULL | 
| 
| date_sold | date | YES | | NULL | 
| 
| date_created | datetime | YES | | NULL | 
| 
| date_updated | datetime | YES | | NULL | 
| 
| date_craigs_list | datetime | YES | | NULL | 
| 
| date_pictures_updated | datetime | YES | | NULL | 
| 
| sworm_vehicle_id | bigint(20) unsigned | YES | MUL | NULL | 
| 
| sworm_dealer_id | bigint(20) unsigned | YES | MUL | NULL | 
| 
| sworm_owner_id | bigint(20) unsigned | YES | | NULL | 
| 
| vehicle_condition_eid | varchar(22) | YES | | NULL | 
| 
| main_picture_file | varchar(255) | YES | | NULL | 
| 
| main_picture_media_eid | varchar(22) | YES | | NULL | 
| 
| main_video_media_eid | varchar(22) | YES | | NULL | 
| 
| storable | text | YES | | NULL | 
| 
| pricing_report_setting_eid | varchar(22) | YES | | NULL | 
| 
| autotrader_id | int(11) | YES | | NULL | 
| 
| cars_id | int(11) | YES | | NULL | 
| 
| trade_eid | varchar(22) | YES | MUL | NULL | 
| 
| expenses | float | YES | | NULL | 
| 
| carfax_status | int(11) | YES | | NULL | 
| 
| autocheck | int(11) | YES | | NULL | 
- 3/4 - 
vehicle_schema.txt 2013-02-13 
| 
| ebay_id | int(5) | YES | | NULL | 
| 
| category_eid | varchar(22) | YES | | NULL | 
| 
| feed_vehicle | tinyint(4) | YES | | NULL | 
| 
| other_price | float | YES | | NULL | 
| 
| sworm_window_sticker_id | int(11) | YES | | NULL | 
| 
| date_closed | date | YES | | NULL | 
| 
+----------------------------+---------------------+------+-----+---------+--- 
---+ 
66 rows in set (0.00 sec) 
- 4/4 - 
This table is 
linked to twenty-two 
additional 
tables. 
Caching 
assembled 
objects in 
MongoDB pays 
off
Mongo Overview in Inventory+ 
■ MongoDB used to cache Vehicle related data from associated tables 
■ Single lookup by EID, or DEALER_EID allows for simple ways to get at Vehicle documents 
■ Previous methods to access data required multiple table lookups, or complex JOIN SQL 
mongos> db.vehicle.find({'vehicle_eid':'59VpEPG8F2I6vUO4Uh1HCw'}).pretty() 
{ 
"vin" : "SCFFDCCD2BGE12420", 
"year" : 2011, 
"make_eid" : "Cc0Jlpb5gi5lc1RFgbh+iw", 
"make" : "Aston Martin”, 
"model" : "DBS Volante", 
"selling_price" : 192888, 
"engine_name" : "5.9L DOHC 48-Valve V12 Engine", 
"vehicle_attributes" : { 
"transmission" : "Automatic", 
"drivetrain" : "Rear Wheel Drive", 
"body_type" : "Convertible" 
… 
"main_photo" : { 
"photos" : { 
"640" : "http://photos.ecarlist.com/jS/Qn/Rl/4k/8y/Nw/9w/WE/xP/2c/pA_640.jpg", 
"original" : "http://photos.ecarlist.com/jS/Qn/Rl/4k/8y/Nw/9w/WE/xP/2c/pA.jpg", 
... 
© 2014 DealerTrack, Inc. All rights reserved.
Relational Databases MongoDB 
■ Hundreds of columns per row 
■ SQL Native Format conversion to Perl 
associative array 
■ No easy way to cluster servers 
■ Inner join operations are I/O blocking, 
slowing down retrievals and forcing 
sequential access of large objects 
■ Update efficiency for normalized data 
models 
■ Referential integrity preserves data 
quality from central definitions 
© 2014 DealerTrack, Inc. All rights reserved. 
■ Nested JSON arrays of arrays 
■ JSON values returned by Mongo in 
‘native’ Perl format 
■ Server clustering built in 
■ No inner joins required, retrievals are 
‘atomic’ and very fast 
Comparison of Features
General Use Case 
■ Given a unique identifier, retrieve all information associated with a Vehicle in 
nested form 
■ MySQL cannot do this in a single step, even with a large number of 
embedded inner join operations. 
■ We have now moved the relational tables to a high-performance DB2 cluster 
■ Whenever any of the attributes of a vehicle are updated (either in batch or 
by an interactive user) MongoDB is updated as the DB2 transaction commits 
■ MongoDB returns (via JSON) a complete Perl object, including internal 
classes with instance values for any requested Vehicle ID 
© 2014 DealerTrack, Inc. All rights reserved.
Batch Data Feed Management 
■ Our customers and partners send us thousands of files (large and small) 
multiple times per day with a variety vehicle inventory information for 
analytical processing and for preparation for web listing (on dealer websites 
and portals) 
■ We have a complex workflow to process the contents of these files and 
update the information in our databases, recalculate analytics, reformat 
information, and update our managed websites as well as send the data out 
to other systems 
■ Decomposition of incoming jobs into file-by-file parallel executions requires 
complex scheduling and tracking of the state of processing to control 
scheduling of parallel execution 
■ MongoDB provides the speed of a queuing system and the multi-index 
inquiry flexibility of a DBMS (this is a one-table/one-collection data model) for 
managing the flows. 
© 2014 DealerTrack, Inc. All rights reserved.
Three MongoDB use/cases at Dealertrack: 
Distributed back-end for an optimistic local cache 
High-speed key:value datastore for complex objects 
Batch data feed management 
Next Up: Backing store for AMQP/QPID/MRG 
Discussion and Questions 
© 2014 DealerTrack, Inc. All rights reserved.
© 2014 DealerTrack, Inc. All rights reserved.
We are growing and hiring! 
www.dealertrack.com/portal/careers-home 
© 2014 DealerTrack, Inc. All rights reserved.

More Related Content

PDF
Using IBM DataPower for rapid security and application integration with an op...
PPTX
IBM DataPower Weekly Webcast - The Value of Datapower Frameworks - 11.03.17
PPTX
IBM DataPower Gateways - What's new in 2016 v7.5.2
PPTX
2015/06/12 - IBM Systems & Middleware - IBM DataPower and API Management
PPT
WebSphere DataPower B2B Appliance overview
PDF
Elastic ESB - Cloud Bursting with webMethods ESB - Cobus Boshoff
PDF
IBM Think 2018: IBM MQ Appliance
PDF
Whats new in data power
Using IBM DataPower for rapid security and application integration with an op...
IBM DataPower Weekly Webcast - The Value of Datapower Frameworks - 11.03.17
IBM DataPower Gateways - What's new in 2016 v7.5.2
2015/06/12 - IBM Systems & Middleware - IBM DataPower and API Management
WebSphere DataPower B2B Appliance overview
Elastic ESB - Cloud Bursting with webMethods ESB - Cobus Boshoff
IBM Think 2018: IBM MQ Appliance
Whats new in data power

What's hot (18)

PDF
APIC/DataPower security
PDF
Datapowercommonusecases 130509114200-phpapp02
PDF
API Management point of view
PDF
Data Power For Pci Webinar Aug 2012
DOC
Resume_OmPrakash_12yrs
PDF
IBM Connectivity and Integration
PDF
How to integration DataPower with Zos
PPTX
What's new in IBM MQ
PPT
j2ee Building components
PDF
Session 3 - i4Trust components for Identity Management and Access Control i4T...
PDF
Powering the digital economy with CICS and z/OS connect - at the "z Systems...
PPTX
The Future of ERP on IBMi
PDF
Infor on the Road 10.10.13
PPT
Exceptional Digital Experience (Gartner PCC 2014)
PDF
NetCache Accelerates Web Servers
PDF
Siebel crm strategy and roadmap ()
PPTX
Web Api services using IBM Datapower
PDF
Upperside Webinar- WebRTC from the service provider prism-final
APIC/DataPower security
Datapowercommonusecases 130509114200-phpapp02
API Management point of view
Data Power For Pci Webinar Aug 2012
Resume_OmPrakash_12yrs
IBM Connectivity and Integration
How to integration DataPower with Zos
What's new in IBM MQ
j2ee Building components
Session 3 - i4Trust components for Identity Management and Access Control i4T...
Powering the digital economy with CICS and z/OS connect - at the "z Systems...
The Future of ERP on IBMi
Infor on the Road 10.10.13
Exceptional Digital Experience (Gartner PCC 2014)
NetCache Accelerates Web Servers
Siebel crm strategy and roadmap ()
Web Api services using IBM Datapower
Upperside Webinar- WebRTC from the service provider prism-final
Ad

Viewers also liked (6)

PPT
The Wild
PPT
Chapter 15-atmosphere
PPT
Analyzing Primary Sources
PPT
Analyzing Primary Sources
PPT
6th Grade Chapter 1
The Wild
Chapter 15-atmosphere
Analyzing Primary Sources
Analyzing Primary Sources
6th Grade Chapter 1
Ad

Similar to Mongo db meetuppresentation-2014-v5-1 (20)

PPTX
Connected Fleet with SAP IoT - Webinar - Westernacher Consulting
PPTX
Accelerate integration with SAP using MuleSoft
PDF
MuleSoft SAP Integration using IDocs
PPTX
apidays LIVE Paris - Break up Monoliths and lay them to REST! by Arun Narayan...
PPTX
TOTAL CAR CARE SOLUTIONS presentation.pptx
PPTX
International Search Summit - How to scale technical SEO globally v4
PPTX
Anypoint DataGraph - Consume & Re-use your APIs faster | MuleSoft Mysore Meet...
PPTX
Mobile Architecture at Scale
PPTX
Brand2Global - 20 tips to scale technical SEO internally by Miranda Gahrmann
PDF
Key Methodologies for Migrating from Oracle to Postgres
 
PPTX
Sitecore & Salesforce DMP integration
PDF
Single Source of Truth for Network Automation
PPTX
ERP - Automative Industry
PDF
What's new in webMethods - Gareth Whitaker - Software AG
PDF
OGSD 7.0 Release Overview
PPTX
E-Commerce and MongoDB at Backcountry.com
PPTX
Anypoint new features_coimbatore_mule_meetup
PPTX
Top 5 .NET Challenges, Performance Monitoring Tips & Tricks
PDF
FIWARE Wednesday Webinars - NGSI-LD and Smart Data Models: Standard Access to...
PPTX
WebXpress Yard and Distribution Management Solution
Connected Fleet with SAP IoT - Webinar - Westernacher Consulting
Accelerate integration with SAP using MuleSoft
MuleSoft SAP Integration using IDocs
apidays LIVE Paris - Break up Monoliths and lay them to REST! by Arun Narayan...
TOTAL CAR CARE SOLUTIONS presentation.pptx
International Search Summit - How to scale technical SEO globally v4
Anypoint DataGraph - Consume & Re-use your APIs faster | MuleSoft Mysore Meet...
Mobile Architecture at Scale
Brand2Global - 20 tips to scale technical SEO internally by Miranda Gahrmann
Key Methodologies for Migrating from Oracle to Postgres
 
Sitecore & Salesforce DMP integration
Single Source of Truth for Network Automation
ERP - Automative Industry
What's new in webMethods - Gareth Whitaker - Software AG
OGSD 7.0 Release Overview
E-Commerce and MongoDB at Backcountry.com
Anypoint new features_coimbatore_mule_meetup
Top 5 .NET Challenges, Performance Monitoring Tips & Tricks
FIWARE Wednesday Webinars - NGSI-LD and Smart Data Models: Standard Access to...
WebXpress Yard and Distribution Management Solution

Recently uploaded (20)

PDF
Getting Started with Data Integration: FME Form 101
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Big Data Technologies - Introduction.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
Tartificialntelligence_presentation.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
cuic standard and advanced reporting.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Getting Started with Data Integration: FME Form 101
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
1. Introduction to Computer Programming.pptx
Group 1 Presentation -Planning and Decision Making .pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Tartificialntelligence_presentation.pptx
Encapsulation theory and applications.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Encapsulation_ Review paper, used for researhc scholars
Network Security Unit 5.pdf for BCA BBA.
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Unlocking AI with Model Context Protocol (MCP)
cuic standard and advanced reporting.pdf
Programs and apps: productivity, graphics, security and other tools
Machine learning based COVID-19 study performance prediction
Digital-Transformation-Roadmap-for-Companies.pptx

Mongo db meetuppresentation-2014-v5-1

  • 1. Using MongoDB & Python for rapid application development at Dealertrack © 2014 DealerTrack, Inc. All rights reserved.
  • 2. Dealertrack Technologies SaaS overview ■ We offer a SaaS and data products for the retail automotive supply chain ■ Customers include: ■ - 18,500 Dealers (New & Used) ■ - 6,000 Lenders ■ - 38 Manufacturers ■ - 500 Part Mfgrs & Insurers ■ - 14 State Governments ■ Implemented with old & new tools: ■ - IIS / .NET / MSMQ / VB / C# ■ - Apache / Java / Python / Perl ■ - RPG2 / DDS / SQL ■ - Oracle / MS SQL Server / DB2 / MongoDB / MySQL / MUMPS © 2014 DealerTrack, Inc. All rights reserved.
  • 3. Core Solu)ons and Services Offered ■ Transac)on-­‐based © 2014 DealerTrack, Inc. All rights reserved. solu)ons for dealers and lenders l Largest Online Credit Applica)on Processing Network in the U.S. and Canada l Largest Outsourced Provider of Contract Processing in the U.S. and Canada l Contract and Vehicle Lien Processing for Lenders l Vehicle Registra)on and Titling Services for Dealers ■ Subscrip)on-­‐based solu)ons for dealers (SoGware-­‐as-­‐a-­‐Service) l #1 Web-­‐based Dealer Management System (DMS) l Industry Leading Sales And Finance Solu)ons l Desktop And Mobile Inventory Solu)ons l Interac)ve Solu)ons Including Web, Mobile, Search, Social And Chat l Unique Digital Retailing Solu)ons That No Other Industry Compe)tor Can Provide
  • 4. DealerTrack 2.0 Conceptual Architecture Architecture Goals and Challenges • Enable rapid growth in products and services • Doing away with point-to-point integration • “spaghetti code” • Managing merger and acquisition driven • growth • Enabling applications or content for multiple • front-ends, including mobile devices • Getting better operational visibility, management, and control of the integration / SOA infrastructure • Legacy system modernization © 2014 DealerTrack, Inc. All rights reserved.
  • 5. Dealertrack Platform Topology © 2014 DealerTrack, Inc. All rights reserved.
  • 6. Technology ■ Platform: RedHat Linux ■ Front-End: Python/Django/Apache WSGI ■ Services layer – Python/Django/TastyPie ■ Enterprise Service Bus – Mule ESB ■ Messaging Broker – RedHat MRG ■ Databases – Oracle, MongoDB, DB2, MySQL ■ Local Cache - Redis © 2014 DealerTrack, Inc. All rights reserved.
  • 7. Case #1 – Using Mongo as HTTP Session backend ■ Python ■ Django ■ Mongo DB © 2014 DealerTrack, Inc. All rights reserved.
  • 8. Why ? ■ The application presents related but separate vertical functionality under one umbrella ■ The shared features require their own schemas in the HTTP session but they all share same HTTP session ■ Data needed in the HTTP session can vary by the specific functionality of the shared feature ■ Performance is critical. We don't want to hold UI thread any more then we absolutely have to © 2014 DealerTrack, Inc. All rights reserved.
  • 9. This is what this web application UI looks like © 2014 DealerTrack, Inc. All rights reserved.
  • 10. Introducing Mongo DB as session storage © 2014 DealerTrack, Inc. All rights reserved.
  • 11. It is a question of responsibilities ■ Need to know basis ■ Front-End does NOT need to know where the session data is stored © 2014 DealerTrack, Inc. All rights reserved.
  • 12. What do we like about this? ■ Allows for the the shared features to use their own schemas in the HTTP session while sharing the HTTP session ■ Allows the data to vary by the specific functionality of the shared feature ■ Front End is completely oblivious of where the data actually stored ■ Using Mongo DB – obviously cool © 2014 DealerTrack, Inc. All rights reserved.
  • 13. Is this the optimal solution? ■ The session data is stored in a central datastore ■ There is some local area network overhead writing into remote centralized MongoDB ■ What do you think? Any ideas, suggestions? Lets share some thoughts © 2014 DealerTrack, Inc. All rights reserved.
  • 14. It beats our old solution, but can we make it even better? ■ We like a lot of this approach ■ We have one concern – remote centralized database calls for every session request ■ Why don't we optimize? □ Let’s introduce a local cache. □ It is still important for the front end not to know anything about it ■ What can we do? ■ Introduce local cache – we are using redis © 2014 DealerTrack, Inc. All rights reserved.
  • 15. Enter local cache ■ If the data is not present in the local cache – read it from Mongo and then cache it locally ■ If the data is not in Mongo – create new session and return © 2014 DealerTrack, Inc. All rights reserved.
  • 16. Redis local cache + MongoDB centralized session store ■ Sessions are sticky to the web servers ■ Session and reference data stored in local cache and mostly accessed from there ■ Data also stored in Mongo as a master cache backend ■ redis = Local Session Cache ■ MongoDB – Centralized Session Persistence ■ Custom Django session backend makes it all transparent to the front end web application ■ Custom redis session backend connects local redis with centralized Mongo © 2014 DealerTrack, Inc. All rights reserved.
  • 17. Case #2 – Using Mongo DB to cache relational data in Inventory+ ■ Inventory+ – another Dealertrack Technologies Solution for auto dealers Major Features ■ Vehicle Inventory Management – Marketing, Pricing, Aging, etc… ■ Pricing Analytics – Price your inventory based on real market data ■ Dealership Websites – Based on vehicle inventory and updated in real time ■ Chat – Host and manage chat services for dealership websites ■ Many more features for our dealer users © 2014 DealerTrack, Inc. All rights reserved.
  • 18. Case #2 – Using Mongo DB to cache vehicle data in Inventory+ ■ eCarList is using Mongo DB in to cache large amounts of relational data and make it searchable © 2014 DealerTrack, Inc. All rights reserved.
  • 19. UI View Vehicle Attributes cached and read from MongoDB • VIN • Year, Make, Model, etc… • Vehicle Photo URLs • Attributes • Odometer • Color • Transmission • Engine • Etc… • Optional Equipment • Standard Equipment • Pricing Info & Price History © 2014 DealerTrack, Inc. All rights reserved.
  • 20. General Use Case ■ The objects that eCarList manages are built around Perl’s strengths: arrays and hashes ■ Relational databases do not afford a one-for-one mapping of these data structures, so storing and retrieving them is a challenge ■ Mongo natively handles these structures, and therefore presents a cleaner interface for storing and retrieving Perl objects ■ If a Perl query is conforming to Mongo’s indexing, lookups are nearly O(1) ■ MongoDB is preloaded with search results, further extending the O(1) lookup time Advantages of Mongo over MySQL in Inventory+ © 2014 DealerTrack, Inc. All rights reserved.
  • 21. Vehicle MySQL Schema © 2014 DealerTrack, Inc. All rights reserved. vehicle_schema.txt 2013-02-13 mysql> desc vehicle; +----------------------------+---------------------+------+-----+---------+--- ---+ | Field | Type | Null | Key | Default | Extra | +----------------------------+---------------------+------+-----+---------+--- ---+ | eid | varchar(22) | NO | PRI | | | | year | year(4) | YES | | NULL | | | make_eid | varchar(22) | YES | | NULL | | | model | varchar(255) | YES | | NULL | | | vin | varchar(255) | YES | MUL | NULL | | | stock_number | varchar(255) | YES | | NULL | | | staff_eid | varchar(22) | YES | | NULL | | | attribute_set_eid | varchar(22) | YES | | NULL | | | dealer_eid | varchar(22) | YES | MUL | NULL | | | style_eid | varchar(22) | YES | MUL | NULL | | | style_interior_color_eid | varchar(22) | YES | MUL | NULL | | | style_exterior_color_eid | varchar(22) | YES | | NULL | | | style_engine_eid | varchar(22) | YES | | NULL | | | cost | varchar(255) | YES | | NULL | | | price_selling | float | YES | | NULL | | | price_starting | float | YES | | NULL | | | price_retail | float | YES | | NULL | | | active | tinyint(4) | YES | | NULL | | | model_code | varchar(255) | YES | | NULL | | comments text YES NULL description2 text description text write_in_options text mpg_highway int(11) mpg_city int(11) include_standard_equipment tinyint(4) market_on_google 255) market_on_autotrader tinyint(4) market_on_cars tinyint(4) other_make_name 255) engine_name 255) price_reserve float subtitle number_videos int(11) number_pictures int(11) interior_color varchar(255) exterior_color varchar(255) | - 1/4 - | mileage | int(11) | YES | | NULL | | | trim | varchar(255) | YES | | NULL | | | price_retail | float | YES | | NULL | | | active | tinyint(4) | YES | | NULL | interior_color varchar(255) exterior_color varchar(255) | | mileage | int(11) | YES | | NULL | | | trim | varchar(255) | YES | | NULL | vehicle_schema.txt 2013-02-13 | | model_code | varchar(255) | YES | | NULL | | | comments | text | YES | | NULL | | | description2 | text | YES | | NULL | | | description | text | YES | | NULL | | | write_in_options | text | YES | | NULL | | | mpg_highway | int(11) | YES | | NULL | | | mpg_city | int(11) | YES | | NULL | | | include_standard_equipment | tinyint(4) | YES | | NULL | | | market_on_google | varchar(255) | YES | | NULL | | | market_on_autotrader | tinyint(4) | YES | | NULL | | | market_on_cars | tinyint(4) | YES | | NULL | | | other_make_name | varchar(255) | YES | | NULL | | | engine_name | varchar(255) | YES | | NULL | | | price_reserve | float | YES | | NULL | | | subtitle | varchar(255) | YES | | NULL | | | number_videos | int(11) | YES | | NULL | | | number_pictures | int(11) | YES | | NULL | | | interior_color | varchar(255) | YES | | NULL | | | exterior_color | varchar(255) | YES | | NULL | | | mileage | int(11) | YES | | NULL | | | trim | varchar(255) | YES | | NULL | date_in_stock date date_sold date date_created datetime date_updated datetime date_craigs_list datetime date_pictures_updated datetime sworm_vehicle_id bigint(20) unsigned MUL sworm_dealer_id bigint(20) unsigned MUL sworm_owner_id bigint(20) unsigned vehicle_condition_eid 22) main_picture_file main_picture_media_eid varchar(22) main_video_media_eid 22) storable text pricing_report_setting_eid varchar(22) autotrader_id int(11) cars_id int(11) trade_eid varchar(22) MUL expenses float | - 2/4 - | carfax_status | int(11) | YES | | NULL | | | autocheck | int(11) | YES | | NULL | vehicle_schema.txt 2013-02-13 | | date_in_stock | date | YES | | NULL | | | date_sold | date | YES | | NULL | | | date_created | datetime | YES | | NULL | | | date_updated | datetime | YES | | NULL | | | date_craigs_list | datetime | YES | | NULL | | | date_pictures_updated | datetime | YES | | NULL | | | sworm_vehicle_id | bigint(20) unsigned | YES | MUL | NULL | | | sworm_dealer_id | bigint(20) unsigned | YES | MUL | NULL | | | sworm_owner_id | bigint(20) unsigned | YES | | NULL | | | vehicle_condition_eid | varchar(22) | YES | | NULL | | | main_picture_file | varchar(255) | YES | | NULL | | | main_picture_media_eid | varchar(22) | YES | | NULL | | | main_video_media_eid | varchar(22) | YES | | NULL | | | storable | text | YES | | NULL | | | pricing_report_setting_eid | varchar(22) | YES | | NULL | | | autotrader_id | int(11) | YES | | NULL | | | cars_id | int(11) | YES | | NULL | | | trade_eid | varchar(22) | YES | MUL | NULL | | | expenses | float | YES | | NULL | | | carfax_status | int(11) | YES | | NULL | | | autocheck | int(11) | YES | | NULL | - 3/4 - vehicle_schema.txt 2013-02-13 | | ebay_id | int(5) | YES | | NULL | | | category_eid | varchar(22) | YES | | NULL | | | feed_vehicle | tinyint(4) | YES | | NULL | | | other_price | float | YES | | NULL | | | sworm_window_sticker_id | int(11) | YES | | NULL | | | date_closed | date | YES | | NULL | | +----------------------------+---------------------+------+-----+---------+--- ---+ 66 rows in set (0.00 sec) - 4/4 - This table is linked to twenty-two additional tables. Caching assembled objects in MongoDB pays off
  • 22. Mongo Overview in Inventory+ ■ MongoDB used to cache Vehicle related data from associated tables ■ Single lookup by EID, or DEALER_EID allows for simple ways to get at Vehicle documents ■ Previous methods to access data required multiple table lookups, or complex JOIN SQL mongos> db.vehicle.find({'vehicle_eid':'59VpEPG8F2I6vUO4Uh1HCw'}).pretty() { "vin" : "SCFFDCCD2BGE12420", "year" : 2011, "make_eid" : "Cc0Jlpb5gi5lc1RFgbh+iw", "make" : "Aston Martin”, "model" : "DBS Volante", "selling_price" : 192888, "engine_name" : "5.9L DOHC 48-Valve V12 Engine", "vehicle_attributes" : { "transmission" : "Automatic", "drivetrain" : "Rear Wheel Drive", "body_type" : "Convertible" … "main_photo" : { "photos" : { "640" : "http://photos.ecarlist.com/jS/Qn/Rl/4k/8y/Nw/9w/WE/xP/2c/pA_640.jpg", "original" : "http://photos.ecarlist.com/jS/Qn/Rl/4k/8y/Nw/9w/WE/xP/2c/pA.jpg", ... © 2014 DealerTrack, Inc. All rights reserved.
  • 23. Relational Databases MongoDB ■ Hundreds of columns per row ■ SQL Native Format conversion to Perl associative array ■ No easy way to cluster servers ■ Inner join operations are I/O blocking, slowing down retrievals and forcing sequential access of large objects ■ Update efficiency for normalized data models ■ Referential integrity preserves data quality from central definitions © 2014 DealerTrack, Inc. All rights reserved. ■ Nested JSON arrays of arrays ■ JSON values returned by Mongo in ‘native’ Perl format ■ Server clustering built in ■ No inner joins required, retrievals are ‘atomic’ and very fast Comparison of Features
  • 24. General Use Case ■ Given a unique identifier, retrieve all information associated with a Vehicle in nested form ■ MySQL cannot do this in a single step, even with a large number of embedded inner join operations. ■ We have now moved the relational tables to a high-performance DB2 cluster ■ Whenever any of the attributes of a vehicle are updated (either in batch or by an interactive user) MongoDB is updated as the DB2 transaction commits ■ MongoDB returns (via JSON) a complete Perl object, including internal classes with instance values for any requested Vehicle ID © 2014 DealerTrack, Inc. All rights reserved.
  • 25. Batch Data Feed Management ■ Our customers and partners send us thousands of files (large and small) multiple times per day with a variety vehicle inventory information for analytical processing and for preparation for web listing (on dealer websites and portals) ■ We have a complex workflow to process the contents of these files and update the information in our databases, recalculate analytics, reformat information, and update our managed websites as well as send the data out to other systems ■ Decomposition of incoming jobs into file-by-file parallel executions requires complex scheduling and tracking of the state of processing to control scheduling of parallel execution ■ MongoDB provides the speed of a queuing system and the multi-index inquiry flexibility of a DBMS (this is a one-table/one-collection data model) for managing the flows. © 2014 DealerTrack, Inc. All rights reserved.
  • 26. Three MongoDB use/cases at Dealertrack: Distributed back-end for an optimistic local cache High-speed key:value datastore for complex objects Batch data feed management Next Up: Backing store for AMQP/QPID/MRG Discussion and Questions © 2014 DealerTrack, Inc. All rights reserved.
  • 27. © 2014 DealerTrack, Inc. All rights reserved.
  • 28. We are growing and hiring! www.dealertrack.com/portal/careers-home © 2014 DealerTrack, Inc. All rights reserved.