Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Using Couchbase Mobile to collect and route data across drivers – Connect Silicon Valley 2017


Published on

Speakers: Thomas Lier and David Audrain, Coyote

Coyote is a freemium community-based service focusing on road safety and traffic optimization launched in 2006. Every month, 1 million active users drive 2 billion kilometers in Western Europe and escalate 50 million road events such as road condition hazards, road work, stationary vehicles, traffic jams, and accidents. Coyote’s service is available on a wide range of products: mobile applications, in-house devices, and embedded in cars. In order to offer a seamless mobility experience for our customers, Coyote keeps creating innovative connected services. Coyote relies on Couchbase Mobile to bring these new services to its customers. In this session, Thomas and David will take you through two use cases – Social driving: driver statistics and Predictive vigilance: reinforcing driver safety.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Using Couchbase Mobile to collect and route data across drivers – Connect Silicon Valley 2017

  1. 1. Using CouchBase Mobile to get and route data across drivers
  2. 2. COYOTE SYSTEM The European leader of real-time road information 1
  3. 3. COYOTE SYSTEM Who are we ? A leading provider of community-based driving assistant systems Founded in 2005 with 350 employees Revenue in 2016 : 110 M€ 1M daily users on a payed subscription model 2 billion kilometers traveled every month (1,24 billion miles) 50M members declaration analyzed every month Specific know-how in big data and automotive market protected by 13 patents
  4. 4. COYOTE SYSTEM How does it work ?
  5. 5. COYOTE SYSTEM How does it work ? A community-based alert system focused on road safety & traffic optimization “ The right information at the right time ” › Fixed speed-cam › Mobile speed-cam › Speed limitations › Road Traffic › Traffic hazards › Drowsiness 1 2 3
  6. 6. COYOTE SYSTEM How to be part of the community ? Available on a range of Products and Apps, … but also with embedded car solutions COYOTE mini COYOTE S COYOTE NAV+ Smartphone APPs
  7. 7. COYOTE SYSTEM Where does it work ? … almost everywhere in Europe ! › France › Belgium › Netherlands › Luxembourg › Italy › Spain › Germany › Poland › Portugal
  8. 8. First Use Case « Driver Statistics » service 2
  9. 9. « Driver Statistics » service “A full analysis of your driving …“ Usage statistics Alerts statistics
  10. 10. « Driver Statistics » service “… compared to our Community“ Community statistics Also available on WebSite
  11. 11. « Driver Statistics » service How does it work with CouchBase ?
  12. 12. USER-1 USER- 2{ "_id": "STATS_SESSION_USER-1_timestamp", "_rev": "9-0e6bedc…, "channels": [ "stats_global", "stats_FR", "stats_USER-1" ], … DATA … } Backend COYOTE Backend Mobile Raw doc Raw docs Aggregated docs { "_id": "STATS_SESSION_USER-2_timestamp", "_rev": "5-2ec4155…", "channels": [ "stats_global", "stats_FR", "stats_USER-2" ], … DATA … } SyncGateway CouchBase Server Raw doc USER-1 USER-2
  13. 13. USER-1 Backend COYOTE Backend Mobile GET Aggregated docs SyncGateway CouchBase Server USER-1 USER-2 User 1 wants to see his statistics
  14. 14. « Driver Statistics » service What is the limitation of our first implementation ? Raw statistics documents are pushed from mobile to backend Aggregated statistics documents are computed on backend Restitution using those aggregated documents is full ONLINE using a WebView
  15. 15. « Driver Statistics » service What is the limitation of our first implementation ? Bring DATA back in the device, close to the driver But ONLY aggregated documents !
  16. 16. « Driver Statistics » service Using « channels » to manage PULLs synchronization Use SyncGateway Sync Function for each RAW Document mutation › Check access()  if USER-1 if pushing a document for himself (OK) or someone else (KO) › Remove specific USER-1 channel from RAW Document  Allow USER-1 not to re-pull again Raw Document › Store document on CB Server Cluster Raw Doc User 1 SyncGateway CouchBase Server Aggregated doc User 1 Raw Doc User 1 USER-1
  17. 17. « Driver Statistics » service Result of second implementation Restitution is now available ONLINE on WebSite and OFFLINE using a native restitution More ENGAGEMENT, more COMMUNITY, better SERVICE !
  18. 18. « Driver Statistics » service Statistics sharing within a group How CouchBase Mobile can help us to share data across a group of drivers ?
  19. 19. « Driver Statistics » service Statistics sharing within a group How CouchBase Mobile can help us to share data across a group of drivers ? USER-1 USER- 2 USER-1 USER-1 USER-2 USER-2USER-1 USER-1 USER-2 USER-2
  20. 20. « Driver Statistics » service Statistics sharing within a group By using « channels » for data routing USER-1 USER- 2 USER-1 USER-1 USER-2 USER-2USER-1 USER-1 USER-2 USER-2 Channel stat_user_1 Channel stat_user_2 Channel stat_user_1 USER-1 USER-1 USER-2 USER-2 Channel stat_user_2
  21. 21. « Driver Statistics » service Statistics sharing within a group How to edit once user « channel » ? SyncGateway CouchBase Server USER- 1 Channel stat_user_1 Backend COYOTE stat_user_2 CouchBase sync JOB: Add USER-2 in the GROUP GROUP Document // Specific Group Processing if ("GROUP" doc) { GetAccount2Edit() <- "USER-1" GetChannel2Add() <- "stat_user_2" // Add access access(USER-1, "stat_user_2"); } JavaScript Sync function
  22. 22. « Driver Statistics » service Results of group management Statistics are now sharable within a Group, … and automatically Synchronized directly on all Mobile devices. Again, More ENGAGEMENT, more COMMUNITY, better SERVICE !
  23. 23. Second Use Case Reinforcing road safety 3
  24. 24. Reinforcing road safety Agenda Context Challenge Solution Implementation with Couchbase Mobile Conclusions
  25. 25. Reinforcing road safety Overview Our objective: Reduce the risk of accident New service: Contextualize alerting services Enable our users to › Anticipate sharp bends › Adapt their driving behaviour according to the environment
  26. 26. Reinforcing road safety How does it work? Sharp bends Floating car data Road geometry Datascientists Driving rules Sharp bend algorithm Warn user Backend Mobile
  27. 27. Reinforcing road safety What is the challenge? Service available when no network 100k sharp bends for France Big chunk of data Download Relevant updates Disk space on device Approach doesn’t scale
  28. 28. Reinforcing road safety Which solution? Solution › Split sharp bends into cells › App has to fetch cells around user Small chunk of data Faster download Relevant updates
  29. 29. Reinforcing road safety Why doing a POC with Couchbase Mobile? Use case fits in Couchbase Mobile model: › Sharp bend => Document › Cell => Channel Couchbase Mobile › provide synchronization › already on our products No exisiting in-house solution
  30. 30. Reinforcing road safety Setup data using Sync Gateway Sharp bend { channels:[“48.78900_2.10000”], …data… } Sharp bend { channels:[“48.78900_2.10000”, “48.78900_2.27500”], …data… } Sharp bend bucket Sync Gateway User { name:“johndoe”, admin_channels:[“*”], …data… } Create docs Create users
  31. 31. Reinforcing road safety How to pull cells around user? db.setMaxRevTreeDepth(1); rep = db.createPullReplication(url); rep.setContinuous(false); cellIDs = new String [] {"48.90600_2.10000", "48.55500_2.27500", …}; rep.setChannels(cellIDs); rep.start();
  32. 32. Reinforcing road safety Processing cells around user View view = database.getView(“channels/alert"); view.setMap(new Mapper() { @Override public void map(Map<String, Object> document, Emitter emitter) { List<String> cells = (List<String>) document.get("channels"); Object docId = document.get("_id"); for (String cell: cells) { emitter.emit(cell, docId); } }}, "1.0"); Query query = view.createQuery(); query.setMapOnly(true); 1-Get view mapping docs to cells 2-Create the query from the view QueryEnumerator queryEnumerator =; for (QueryRow row : queryEnumerator) { Document sharpBend = database.getDocument(row.getDocumentId()); ...process sharp bend... } 4-Run query and process sharp bends query.setPostFilter(new Predicate<QueryRow>() { @Override public boolean apply(QueryRow row) { String cell = (String) row.getKey(); return activeCells.contains(cell); }}); 3-Set query post filter to keep active cells
  33. 33. Reinforcing road safety POC conclusions Easy to get a POC working prototype › Tons of channels › One user may pull different sets of channels while driving Network efficient when local data is up-to- date Controlling disk space used by Couchbase Mobile › WIP with Couchbase support
  34. 34. Thank You