SlideShare a Scribd company logo
Connected Car
the tech behind
Dr. Patrick Bartsch
Head of Technology Specialists & Future Tech in Connected Car
September 2019
● 18+ years experience in #automotive
○ 5 yrs IAV
○ 10 yrs Volkswagen
○ 2 yrs Audi
○ > 1 yr Jaguar Land Rover
● Passionate swimmer and runner, coder and car
nut
● How to contact me
○ https://github.com/wzr1337
○ https://twitter/wzr1337
○ https://linkedin.com/in/patrickbartsch
Who am I?
● 2 UK heritage brands
○ Jaguar
○ Land Rover
● shipping ~600.000 cars a year
● serving customers world wide
● won 3 car of the year awards in 2019
○ best car Europe
○ best car World
○ best Green car
● building connected cars since 2014
Who is Jaguar Land Rover?
● 1.7M active cars
● launched in 2014
● Offering:
○ InControl
○ Live
● Team distributed over 5
different Geos
Jaguar Land Rovers connected car
● Infotainment HTML5 Apps
● Always fresh as downloaded on demand
● Uses real estate in
○ main screen
○ side panel
○ blade screen
● Offers
○ online streaming media
○ weather
○ news
○ flight tracker
○ air quality (China)
Live Apps
● Jaguar and Land Rover versions available
● remote control
● vehicle health information
● vehicle health alerts
● journey logs
● general vehicle information
● electric vehicle interactions
● …
InControl V2
● car is offline often
○ goes to sleep after sitting idle for a certain time
○ needs to be woken up
● the quality of connectivity is usually weak
● cars go at high speeds
● the available bandwidth is small compared to land
lines – today (5G promises to deliver better)
● different legislation in different markets, but car are
mobile
○ China
○ Russia
○ Turkey
Why is the car a different IoT device?
● C3 – Client-Cloud-Car setup
● APIs connect millions to millions
● Cloud is either on-prem, hybrid or public cloud
● Additional components connected
○ factories
○ OEM systems
● Supported client categories
○ customer applications and assistants
○ 3rd party service providers (e.g. RSA)
○ call centers (e.g. concierge services)
○ web portal for dealers and customers
○ home automation
○ etc.
Connectivity Cloud – A general Architecture
● VSS
○ implemented in production
○ used for in vehicle infotainment
○ to become a standard soon
● RSI
○ for web APIs mainly
○ not yet standardized
○ debate about integration with VSS onboing
Engagement in the W3C
● stands for RESTful Service Interface (aka viwi)
● It is REST+N,
allows subscriptions
● The 5 core principals that must never be violated
● Full spec: https://www.w3.org/Submission/viwi-protocol/
What is RSI?
● Multiple clients subscribe
● Any client or service can (policy based)
○ Create
○ Read
○ Update
○ Delete
○ Subscribe
● If subscribed, clients get notified in parallel
● at any given time clients can come and go
● no distributed state à single source of truth
12
Workflow example
Client 1 Client 2Service
TLS established
valid access_token(s) available
subscribe to event
subscribe acknowledge
initial state
subscribe acknowledge
initial state
subscribe to event
POST change
acknowledge a change
update stateupdate state
verify permission
● 3rd party service interested in vehicles entering geo-fence
● geofenceObject is created and subscribed by the 3rd party
● geofenceObject is updated in the when vehicles enter and
leave server side
● 3rd party receives notification on enter and leave
● 3rd party can access additional information for as long a
vehicle is within geofence
Use case – Send notifications based on geo-fence
● automatically buy Insurance coverage when
leaving/entering a country
● pay for congestion charges for the time a car
was in a particular zone
● paying tolls on bridges
● notify the vehicle owner of a car entering or
leaving a fence
● integrate with home automation to switch on
heating or lights when entering the vicinity
Use Cases for geofences
quote: https://azure.microsoft.com/en-us/overview/what-is-serverless-computing/
“Serverless computing enables developers to build applications faster by eliminating the need for them to
manage infrastructure. With serverless applications, the cloud service provider automatically provisions,
scales and manages the infrastructure required to run the code.“
● shutdown after a certain time automatically, thus need to be run stateless
● Function-as-a-Service (FaaS)
Of course servers are still running the code ;)
What is serverless ?
image source: https://www.botmetric.com/blog/what-is-serverless-computing/
● serverless charges in units of execution time (100ms)
● triggering many functions with short runtime turns out costly
● pay for less units when combining calls
● combine POSTs back to API Gateway in a single call close
to al low multiple of 100ms of runtime – not minutes
○ downside: parallelization of message delivery is limited
○ need to find sweet spot between cost and latency
○ serverless functions are designed to be short lived, do not run
tasks “forever”
Lessons learned using serverless
billed 5 units
billed 2 units
based on https://serverless.com/blog/api-gateway-websockets-example/
● API Gateway holds connections to millions
● serverless function invoke upon connection, handle stored
● ‘events’ capable database invokes functions on change
● serverless function POSTs back on connection handle
● clients receive messages
● system sleeps when idle
Implementing RSI on top of serverless
● geospatial capabilities
● big documents
● terra-bytes of journey logs - already today
● peta-bytes of vehicle data in future
● events for real-time
make MongoDB the heart
● 2 hosting options
○ host yourself (cloud agnostic)
○ utilize Atlas
è ONE solution supports all use cases
An actual subscription message and its response
{
"type": "subscribe",
"event": "/notificationmanager/notifications/",
"Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6I
kpXVCJ9.eyJtZXNzYWdlIjoieW91IGRpZCBub3QgcmVhbGx5I
GV4cGVjdGVkIGEgdG9rZW4sIGRpZCB5b3U_In0.iCGo2OwyV-
H4FElp6VGuWIfs4ee3damtgFUy6IWj_VI"
}
{
"status": "ok",
"type": "subscribe",
"event": "/notificationmanager/notifications/"
}
{
"type": "data",
"status": "ok",
"data": [{
"content": “low on washer fluid",
"id": "3bebf144-856e-413f-8cb6-ffdbc9e56d59",
"name": "Maintenance",
"title": "Maintenance needed!",
"uri": "/notificationmanager/notifications/
3bebf144-856e-413f-8cb6-ffdbc9e56d59"
}],
"event": "/notificationmanager/notifications/"
}
ws:// Subscription including Authorization ws:// Acknowledgement and initial data 2-Frames
● model resembles the RSI subscribe message
● adds wsConnectionId for POST backs
● adds lastUpdatedFields for quicker diffs
○ compare wsConnectionId against filters
Data model for storing subscriptions
import { Schema } from "mongoose";
export const subscriptionSchema = new Schema({
wsConnectionId: {
type: String,
required: true
},
event: {
type: String,
required: true,
validate: /^/w+/w+/(:?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-
F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$/
},
filters: [{
field: {
type: String,
required: true
},
criteria: {
type: String,
required: true
}
}],
lastUpdatedFields: [
{
type: String,
required: true
}
],
updateLimit: Number,
interval: Number
}, {
autoIndex: false
});
● index on wsConnectionId to quickly fetch all events for a
particular subscriber
○ used when revoking all subscriptions for a given
wsConnectionId
○ used when reauthorizing all subscriptions for a given
wsConnectionId
● index on event to quickly fetch all subscribers for a
particular RSI event
○ used to notify all subscribers on a particular event
● filtering is done in the lambda as of today..
optimization possible
○ notify only those subscriber who are interested in the fields
modified last
Using indexes
wsConnectionId _id
event _id
_id event wsConnectionId …
index #1
index #2
subscriptions
● actual content in different collection
○ might be integrated later to avoid separate query
● subscriptions on resource level
○ one emits every hour independent of change
using proprietary scheduler
● subscriptions on element level
○ d65… was modified after subscription
● none of the subscription filtered
well spotted "__v", we are using mongoose 😜"
Example Notifications Collection
[
{
"lastUpdatedFields": ["body“, "lastmodified"],
"_id": "5d7a89c45e049808ece777d6",
"wsConnectionId": "bXU72eVToAMCFow=",
"event": "/notificationmanager/notifications/d65a1847-528d-4cb7-9795-b19f32dbc76f",
"filters": [],
"__v": 1
},
{
"lastUpdatedFields": [],
"_id": "5d7a89c45e049808ece777d7",
"wsConnectionId": "bXU72eVToAMCFow=",
"event": "/notificationmanager/notifications/36054d10-e5f1-4a2a-8e62-e72cc9d71e7c",
"filters": [],
"__v": 0
},
{
"lastUpdatedFields": [],
"_id": "5d7a89c45e049808ece777d8",
"wsConnectionId": "bXU72eVToAMCFow=",
"event": "/notificationmanager/notifications/",
"filters": [],
"interval": 3600000,
"__v": 0
},
{
"lastUpdatedFields": [],
"_id": "5d7a89c45e049808ece777d9",
"wsConnectionId": "f6liYf5WIAMCFLg=",
"event": "/notificationmanager/notifications/41503229-d2ce-4aa7-ac43-1b62f4e06cb0",
"filters": [],
"__v": 0
},
{
"lastUpdatedFields": ["body“, "lastmodified"],
"_id": "5d7a89c45e049808ece777da",
"wsConnectionId": "f6liYf5WIAMCFLg=",
"event": "/notificationmanager/notifications/d65a1847-528d-4cb7-9795-b19f32dbc76f",
"filters": [],
"__v": 1
},
{
"lastUpdatedFields": [],
"_id": "5d7a89c45e049808ece777dc",
"wsConnectionId": "f6liYf5WIAMCFLg=",
"event": "/notificationmanager/notifications/",
"filters": [],
"__v": 0
}
]
How did we arrive at this setup?
● we were using non-standard protocols
○ missing design guidelines led to fragmentation
○ APIs were hard to consume for clients
● our servers had to hold the WebSocket connections
themselves
○ hard to scale
○ expensive in idle mode
● we had different databases solutions for different
purposes
○ hard to scale
○ secure the platform
○ had to take care of partitioning
to the rescue
Demo
Most Impressive: all the way through the system in milliseconds !!!
● nice connected cars:
○ Jaguar https://www.jaguar.com/
○ Land Rover https://www.jaguar.com/
● good to reads
○ Mongo Change Events https://docs.mongodb.com/manual/reference/change-events/
○ API Gateway https://serverless.com/blog/api-gateway-websockets-example/
○ RSI specification: https://www.w3.org/Submission/viwi-protocol/
○ serverless: https://www.botmetric.com/blog/what-is-serverless-computing
● Open Source
○ https://github.com/wzr1337
If you want to learn more…

More Related Content

PDF
MongoDB .local London 2019: Nationwide Building Society: Building Mobile Appl...
PDF
MongoDB .local London 2019: Migrating a Monolith to MongoDB Atlas – Auto Trad...
PDF
MongoDB .local London 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...
PDF
Bringing Streaming Data To The Masses: Lowering The “Cost Of Admission” For Y...
PDF
Stream Processing with Kafka and KSQL in Jupiter | Namit Mahuvakar, Jupiter
PDF
How to mutate your immutable log | Andrey Falko, Stripe
PDF
Kafka and Kafka Streams in the Global Schibsted Data Platform
PDF
How Much Can You Connect? | Bhavesh Raheja, Disney + Hotstar
MongoDB .local London 2019: Nationwide Building Society: Building Mobile Appl...
MongoDB .local London 2019: Migrating a Monolith to MongoDB Atlas – Auto Trad...
MongoDB .local London 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...
Bringing Streaming Data To The Masses: Lowering The “Cost Of Admission” For Y...
Stream Processing with Kafka and KSQL in Jupiter | Namit Mahuvakar, Jupiter
How to mutate your immutable log | Andrey Falko, Stripe
Kafka and Kafka Streams in the Global Schibsted Data Platform
How Much Can You Connect? | Bhavesh Raheja, Disney + Hotstar

What's hot (20)

PDF
Flink Forward Berlin 2017: Gyula Fora - Building and operating large-scale st...
PDF
Achieving end-to-end visibility into complex event-sourcing transactions usin...
PDF
[WSO2Con USA 2018] Up-leveling Brownfield Integration
PDF
Digital transformation: Highly resilient streaming architecture and strategie...
PDF
Creating an Elastic Platform Using Kafka and Microservices in OpenShift
PDF
Disaster Recovery for Multi-Region Apache Kafka Ecosystems at Uber
PDF
Digital Transformation in Healthcare with Kafka—Building a Low Latency Data P...
PDF
Kafka Streams
PPTX
Building a Codeless Log Pipeline w/ Confluent Sink Connector | Pollyanna Vale...
PPTX
MongoDB and the Future of Workspaces
PDF
[WSO2Con EU 2018] Up-Leveling Brownfield Integration
PDF
Kafka in the Enterprise—A Two-Year Journey to Build a Data Streaming Platform...
PPTX
Designing a Service Mesh with Kafka and Sagas | David Navalho, Marionete and ...
PDF
Launching the Expedia Conversations Platform: From Zero to Production in Four...
PPTX
How Zillow Unlocked Kafka to 50 Teams in 8 months | Shahar Cizer Kobrinsky, Z...
PDF
Building Streaming Data Pipelines with Google Cloud Dataflow and Confluent Cl...
PDF
Schemas Beyond The Edge
PPTX
Introduction to ksqlDB and stream processing (Vish Srinivasan - Confluent)
PDF
MongoDB World 2019: IAG: Single View of Everything - Making the World a Safer...
PDF
How a Data Mesh is Driving our Platform | Trey Hicks, Gloo
Flink Forward Berlin 2017: Gyula Fora - Building and operating large-scale st...
Achieving end-to-end visibility into complex event-sourcing transactions usin...
[WSO2Con USA 2018] Up-leveling Brownfield Integration
Digital transformation: Highly resilient streaming architecture and strategie...
Creating an Elastic Platform Using Kafka and Microservices in OpenShift
Disaster Recovery for Multi-Region Apache Kafka Ecosystems at Uber
Digital Transformation in Healthcare with Kafka—Building a Low Latency Data P...
Kafka Streams
Building a Codeless Log Pipeline w/ Confluent Sink Connector | Pollyanna Vale...
MongoDB and the Future of Workspaces
[WSO2Con EU 2018] Up-Leveling Brownfield Integration
Kafka in the Enterprise—A Two-Year Journey to Build a Data Streaming Platform...
Designing a Service Mesh with Kafka and Sagas | David Navalho, Marionete and ...
Launching the Expedia Conversations Platform: From Zero to Production in Four...
How Zillow Unlocked Kafka to 50 Teams in 8 months | Shahar Cizer Kobrinsky, Z...
Building Streaming Data Pipelines with Google Cloud Dataflow and Confluent Cl...
Schemas Beyond The Edge
Introduction to ksqlDB and stream processing (Vish Srinivasan - Confluent)
MongoDB World 2019: IAG: Single View of Everything - Making the World a Safer...
How a Data Mesh is Driving our Platform | Trey Hicks, Gloo
Ad

Similar to MongoDB .local London 2019: The Tech Behind Connected Car (20)

PDF
What can you do with lambda in 2020
PPTX
IOT Success depends on Integration
PDF
IoT from edge to cloud: bringing order to the chaos
PDF
IoT Overview
PDF
SIGFOX Makers Tour - Lisboa
PDF
What can you do with lambda in 2020
PDF
From the Internet of Things to Intelligent Systems A Developer's Primer - Gar...
PDF
IOT - Presentation to PEP @ Progress
PPTX
Successful Industrial IoT patterns
PDF
What can you do with lambda in 2020
PDF
2022 Presentation | Serverless Innovation with AWS
PPTX
MODULE 1-1.4 LOGICAL DESIGN OF IOT.pptx FUNDAMENTALS AND DESIGN METHODOLOGY O...
PDF
An Intro to AWS IoT
PDF
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
PPTX
Serverless IoT with AWS Lambda
PDF
Understanding the IoT Connectivity Landscape – A Contemporary M2M Radio Techn...
PDF
5G Enablers and Use Cases, an European Pespective
PPTX
Can a browser become an IoT Gateway?
PPTX
IoT Mashup - webinos iot and m2m - Allott
PPT
Connecting devices to the internet of things
What can you do with lambda in 2020
IOT Success depends on Integration
IoT from edge to cloud: bringing order to the chaos
IoT Overview
SIGFOX Makers Tour - Lisboa
What can you do with lambda in 2020
From the Internet of Things to Intelligent Systems A Developer's Primer - Gar...
IOT - Presentation to PEP @ Progress
Successful Industrial IoT patterns
What can you do with lambda in 2020
2022 Presentation | Serverless Innovation with AWS
MODULE 1-1.4 LOGICAL DESIGN OF IOT.pptx FUNDAMENTALS AND DESIGN METHODOLOGY O...
An Intro to AWS IoT
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
Serverless IoT with AWS Lambda
Understanding the IoT Connectivity Landscape – A Contemporary M2M Radio Techn...
5G Enablers and Use Cases, an European Pespective
Can a browser become an IoT Gateway?
IoT Mashup - webinos iot and m2m - Allott
Connecting devices to the internet of things
Ad

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced Soft Computing BINUS July 2025.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
MYSQL Presentation for SQL database connectivity
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Review of recent advances in non-invasive hemoglobin estimation
Chapter 3 Spatial Domain Image Processing.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Unlocking AI with Model Context Protocol (MCP)
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The AUB Centre for AI in Media Proposal.docx
Advanced Soft Computing BINUS July 2025.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Diabetes mellitus diagnosis method based random forest with bat algorithm
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...

MongoDB .local London 2019: The Tech Behind Connected Car

  • 1. Connected Car the tech behind Dr. Patrick Bartsch Head of Technology Specialists & Future Tech in Connected Car September 2019
  • 2. ● 18+ years experience in #automotive ○ 5 yrs IAV ○ 10 yrs Volkswagen ○ 2 yrs Audi ○ > 1 yr Jaguar Land Rover ● Passionate swimmer and runner, coder and car nut ● How to contact me ○ https://github.com/wzr1337 ○ https://twitter/wzr1337 ○ https://linkedin.com/in/patrickbartsch Who am I?
  • 3. ● 2 UK heritage brands ○ Jaguar ○ Land Rover ● shipping ~600.000 cars a year ● serving customers world wide ● won 3 car of the year awards in 2019 ○ best car Europe ○ best car World ○ best Green car ● building connected cars since 2014 Who is Jaguar Land Rover?
  • 4. ● 1.7M active cars ● launched in 2014 ● Offering: ○ InControl ○ Live ● Team distributed over 5 different Geos Jaguar Land Rovers connected car
  • 5. ● Infotainment HTML5 Apps ● Always fresh as downloaded on demand ● Uses real estate in ○ main screen ○ side panel ○ blade screen ● Offers ○ online streaming media ○ weather ○ news ○ flight tracker ○ air quality (China) Live Apps
  • 6. ● Jaguar and Land Rover versions available ● remote control ● vehicle health information ● vehicle health alerts ● journey logs ● general vehicle information ● electric vehicle interactions ● … InControl V2
  • 7. ● car is offline often ○ goes to sleep after sitting idle for a certain time ○ needs to be woken up ● the quality of connectivity is usually weak ● cars go at high speeds ● the available bandwidth is small compared to land lines – today (5G promises to deliver better) ● different legislation in different markets, but car are mobile ○ China ○ Russia ○ Turkey Why is the car a different IoT device?
  • 8. ● C3 – Client-Cloud-Car setup ● APIs connect millions to millions ● Cloud is either on-prem, hybrid or public cloud ● Additional components connected ○ factories ○ OEM systems ● Supported client categories ○ customer applications and assistants ○ 3rd party service providers (e.g. RSA) ○ call centers (e.g. concierge services) ○ web portal for dealers and customers ○ home automation ○ etc. Connectivity Cloud – A general Architecture
  • 9. ● VSS ○ implemented in production ○ used for in vehicle infotainment ○ to become a standard soon ● RSI ○ for web APIs mainly ○ not yet standardized ○ debate about integration with VSS onboing Engagement in the W3C
  • 10. ● stands for RESTful Service Interface (aka viwi) ● It is REST+N, allows subscriptions ● The 5 core principals that must never be violated ● Full spec: https://www.w3.org/Submission/viwi-protocol/ What is RSI?
  • 11. ● Multiple clients subscribe ● Any client or service can (policy based) ○ Create ○ Read ○ Update ○ Delete ○ Subscribe ● If subscribed, clients get notified in parallel ● at any given time clients can come and go ● no distributed state à single source of truth 12 Workflow example Client 1 Client 2Service TLS established valid access_token(s) available subscribe to event subscribe acknowledge initial state subscribe acknowledge initial state subscribe to event POST change acknowledge a change update stateupdate state verify permission
  • 12. ● 3rd party service interested in vehicles entering geo-fence ● geofenceObject is created and subscribed by the 3rd party ● geofenceObject is updated in the when vehicles enter and leave server side ● 3rd party receives notification on enter and leave ● 3rd party can access additional information for as long a vehicle is within geofence Use case – Send notifications based on geo-fence
  • 13. ● automatically buy Insurance coverage when leaving/entering a country ● pay for congestion charges for the time a car was in a particular zone ● paying tolls on bridges ● notify the vehicle owner of a car entering or leaving a fence ● integrate with home automation to switch on heating or lights when entering the vicinity Use Cases for geofences
  • 14. quote: https://azure.microsoft.com/en-us/overview/what-is-serverless-computing/ “Serverless computing enables developers to build applications faster by eliminating the need for them to manage infrastructure. With serverless applications, the cloud service provider automatically provisions, scales and manages the infrastructure required to run the code.“ ● shutdown after a certain time automatically, thus need to be run stateless ● Function-as-a-Service (FaaS) Of course servers are still running the code ;) What is serverless ? image source: https://www.botmetric.com/blog/what-is-serverless-computing/
  • 15. ● serverless charges in units of execution time (100ms) ● triggering many functions with short runtime turns out costly ● pay for less units when combining calls ● combine POSTs back to API Gateway in a single call close to al low multiple of 100ms of runtime – not minutes ○ downside: parallelization of message delivery is limited ○ need to find sweet spot between cost and latency ○ serverless functions are designed to be short lived, do not run tasks “forever” Lessons learned using serverless billed 5 units billed 2 units
  • 16. based on https://serverless.com/blog/api-gateway-websockets-example/ ● API Gateway holds connections to millions ● serverless function invoke upon connection, handle stored ● ‘events’ capable database invokes functions on change ● serverless function POSTs back on connection handle ● clients receive messages ● system sleeps when idle Implementing RSI on top of serverless
  • 17. ● geospatial capabilities ● big documents ● terra-bytes of journey logs - already today ● peta-bytes of vehicle data in future ● events for real-time make MongoDB the heart ● 2 hosting options ○ host yourself (cloud agnostic) ○ utilize Atlas è ONE solution supports all use cases
  • 18. An actual subscription message and its response { "type": "subscribe", "event": "/notificationmanager/notifications/", "Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6I kpXVCJ9.eyJtZXNzYWdlIjoieW91IGRpZCBub3QgcmVhbGx5I GV4cGVjdGVkIGEgdG9rZW4sIGRpZCB5b3U_In0.iCGo2OwyV- H4FElp6VGuWIfs4ee3damtgFUy6IWj_VI" } { "status": "ok", "type": "subscribe", "event": "/notificationmanager/notifications/" } { "type": "data", "status": "ok", "data": [{ "content": “low on washer fluid", "id": "3bebf144-856e-413f-8cb6-ffdbc9e56d59", "name": "Maintenance", "title": "Maintenance needed!", "uri": "/notificationmanager/notifications/ 3bebf144-856e-413f-8cb6-ffdbc9e56d59" }], "event": "/notificationmanager/notifications/" } ws:// Subscription including Authorization ws:// Acknowledgement and initial data 2-Frames
  • 19. ● model resembles the RSI subscribe message ● adds wsConnectionId for POST backs ● adds lastUpdatedFields for quicker diffs ○ compare wsConnectionId against filters Data model for storing subscriptions import { Schema } from "mongoose"; export const subscriptionSchema = new Schema({ wsConnectionId: { type: String, required: true }, event: { type: String, required: true, validate: /^/w+/w+/(:?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA- F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$/ }, filters: [{ field: { type: String, required: true }, criteria: { type: String, required: true } }], lastUpdatedFields: [ { type: String, required: true } ], updateLimit: Number, interval: Number }, { autoIndex: false });
  • 20. ● index on wsConnectionId to quickly fetch all events for a particular subscriber ○ used when revoking all subscriptions for a given wsConnectionId ○ used when reauthorizing all subscriptions for a given wsConnectionId ● index on event to quickly fetch all subscribers for a particular RSI event ○ used to notify all subscribers on a particular event ● filtering is done in the lambda as of today.. optimization possible ○ notify only those subscriber who are interested in the fields modified last Using indexes wsConnectionId _id event _id _id event wsConnectionId … index #1 index #2 subscriptions
  • 21. ● actual content in different collection ○ might be integrated later to avoid separate query ● subscriptions on resource level ○ one emits every hour independent of change using proprietary scheduler ● subscriptions on element level ○ d65… was modified after subscription ● none of the subscription filtered well spotted "__v", we are using mongoose 😜" Example Notifications Collection [ { "lastUpdatedFields": ["body“, "lastmodified"], "_id": "5d7a89c45e049808ece777d6", "wsConnectionId": "bXU72eVToAMCFow=", "event": "/notificationmanager/notifications/d65a1847-528d-4cb7-9795-b19f32dbc76f", "filters": [], "__v": 1 }, { "lastUpdatedFields": [], "_id": "5d7a89c45e049808ece777d7", "wsConnectionId": "bXU72eVToAMCFow=", "event": "/notificationmanager/notifications/36054d10-e5f1-4a2a-8e62-e72cc9d71e7c", "filters": [], "__v": 0 }, { "lastUpdatedFields": [], "_id": "5d7a89c45e049808ece777d8", "wsConnectionId": "bXU72eVToAMCFow=", "event": "/notificationmanager/notifications/", "filters": [], "interval": 3600000, "__v": 0 }, { "lastUpdatedFields": [], "_id": "5d7a89c45e049808ece777d9", "wsConnectionId": "f6liYf5WIAMCFLg=", "event": "/notificationmanager/notifications/41503229-d2ce-4aa7-ac43-1b62f4e06cb0", "filters": [], "__v": 0 }, { "lastUpdatedFields": ["body“, "lastmodified"], "_id": "5d7a89c45e049808ece777da", "wsConnectionId": "f6liYf5WIAMCFLg=", "event": "/notificationmanager/notifications/d65a1847-528d-4cb7-9795-b19f32dbc76f", "filters": [], "__v": 1 }, { "lastUpdatedFields": [], "_id": "5d7a89c45e049808ece777dc", "wsConnectionId": "f6liYf5WIAMCFLg=", "event": "/notificationmanager/notifications/", "filters": [], "__v": 0 } ]
  • 22. How did we arrive at this setup? ● we were using non-standard protocols ○ missing design guidelines led to fragmentation ○ APIs were hard to consume for clients ● our servers had to hold the WebSocket connections themselves ○ hard to scale ○ expensive in idle mode ● we had different databases solutions for different purposes ○ hard to scale ○ secure the platform ○ had to take care of partitioning to the rescue
  • 23. Demo Most Impressive: all the way through the system in milliseconds !!!
  • 24. ● nice connected cars: ○ Jaguar https://www.jaguar.com/ ○ Land Rover https://www.jaguar.com/ ● good to reads ○ Mongo Change Events https://docs.mongodb.com/manual/reference/change-events/ ○ API Gateway https://serverless.com/blog/api-gateway-websockets-example/ ○ RSI specification: https://www.w3.org/Submission/viwi-protocol/ ○ serverless: https://www.botmetric.com/blog/what-is-serverless-computing ● Open Source ○ https://github.com/wzr1337 If you want to learn more…