Over the last 12 months at Auto Trader, we have been focusing our energy on moving our on premise workloads to Google Cloud Platform, and that includes our database architecture.
Join me as we explore how we have migrated from on premise MongoDB clusters to a microservice aligned database architecture on MongoDB Atlas using Infrastructure as Code, and how we are integrating MongoDB into the Auto Trader Delivery Platform.
Time Series Foundation Models - current state and future directions
MongoDB .local London 2019: Migrating a Monolith to MongoDB Atlas – Auto Trader’s Journey
1. 1
Moving a Monolith to
MongoDB Atlas
Mohsin Patel
Principal Database Engineer, Auto Trader UK
@dbamohsin dbamohsin.wordpress.com
2. Over the last 12 months at Auto Trader, we have been
focussing our energy on moving our
on premise workloads to Google Cloud Platform, and
that includes our database architecture
Explore how we have migrated from monolithic on
premise MongoDB clusters to a micro service aligned
database architecture on MongoDB Atlas using
Infrastructure as Code, and how we are integrating
MongoDB into the Auto Trader Delivery Platform
3. A bit about me
{ 11 years }
{ 9 years }{ 14 years } { 11 years }
Infrastructure Squad – Multi-disciplined
Database
Engineers
System
Engineers
Network
Engineers
Developers Tech Lead
4. Our Story: 40 years in the making
4
1977
1995
UK national coverage of
Auto Trader magazines
2007
Implements digital
transition strategy
Digital revenue = Print revenue
2010
Websites for Retailers
Launches apps
2013
Closure of print magazines
2013
100% digital business
in UK and Ireland
Magazine Business
1996
Start of online operations -Launch of
autotrader.co.uk
Diversification
Transition to Digital
Fully Digital Business
1994 2007 2013
6. The UK’s largest digital automotive marketplace…
6
£355.1m
Revenue
£5.5bn
Market Cap
831 Employees
FTSE 100
Company
HQ – Manchester
Offices in London
and Dublin
212 Developers
In
Multidisciplined
squads
monthly cross-
platform visits
50m 71%
of all time spent
on Auto classified
sites
is spent on
Auto Trader
94
searches
every second
9m
monthly
cross-
platform
unique users
7. Where we are…
2
physical
data
centers
269
apps deployed
in the public
cloud
3
public
clouds
455
Live
releases in
one day
15000
releases to
live in FY19
99.79%
release
success
rate
99.99%
availability of Auto
Trader search during
FY19 (Apr 18 – Apr 19)
441
apps in
total
15. Atlas at Auto Trader
• Atlas is a cloud agnostic Managed Database Service provided by MongoDB
• We use Atlas to provision database clusters within Google Cloud Platform
• Started proof of concept work in August 2018
Smaller and more manageable
clusters with closely knit application
databases
Upgraded architecture to a
minimum MongoDB version of 3.6
A highly scalable document store
infrastructure with increased
performance visibility
What does our platform look like?
16. Migration Methodology
Proof of
Concept
Latency Infra testing I/O Perf.App Complexity
Restoring
Data
Time boxed Data
Migration
Test Atlas
Features
Database
Analysis
Data
Dependencies
Data Purging
Database
Ownership
Logical
Grouping Sizing Estimate
Infrastructure
Analysis
DB Version
Backup
Policy
Networking
Cluster
Sizing Regions
Budget
Forecast
Application
Analysis
I/O Profile Busy PeriodsConnectivity
Connection
Pooling
Downtime
Driver
versions
Impact of App
Scaling
On a per app basis, as we migrate…
17. Migration Methodology: Migration Flow
Push App Changes PIT/QA
Purge Unneeded
Data
Pick an App
Candidate
Database Analysis
Infrastructure
Analysis
Monitor service
health metrics
Application Analysis
Update Driver >=
3.6
Convert
Connections to URI
Preprod Data
Migration
Export/Import
Live migrate
App to DB Auth
Prevent on Prem
Access
Arrange Prod
migration window
Prod Migration
Migrate!
18. Migration Methodology: Decom
Monitor mongo
logs
Remove User
Access
Database Analysis
Infrastructure
Analysis
Application Analysis
Monitor Kibana
Logs for app
Wait ~7 daysWait ~7 Days
Drop database
from preprod Migrate!
Drop database
from Prod
Reclaim Space – if
needed
Decom Cluster
nodes if last DB
Decom
30. MongoDB Integration into the platform
• All of our platform capabilities are exposed via simple configuration values
• A couple of values drive our mongodb integration
• Every time an application is committed, configuration is validated and deployed to our Delivery Platform
(Kubernetes)
• These values are then realized into true infrastructure
• If mongodb enabled is true then give this app mongo metrics
Or
• If mongodb is enabled and a cluster hasn’t been provided, then fail this deployment
37. Platform alert forwarder
• Skippr is an inhouse alert forwarder
• Used extensively for our Delivery Platform
• Now working on integrating MongoDB via an
Atlas webhook alert service
• See ownership of alerts in squad channels
• Quickly see if the database behind an
application is having issues
38. Infrastructure as Code
• Create repeatable code
• Ensure all clusters follow same
standards
• DB infrastructure sits in same
repository as rest of delivery
platform
• Helps prevent manual changes via
the GUI
39. Key Takeaways
Quick to get up and running on Atlas
Platform integrations make it easier for our
developers to consume MongoDB
Spend more time on proactive business value