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.

Events, Picos, and Microservices

6,249 views

Published on

A discussion of the Internet of Things and how I explored the use of an event-based API and microservices inside a unique architecture based on persistent compute objects, or picos, in the connected car platform called Fuse.

Published in: Technology

Events, Picos, and Microservices

  1. 1. Events, Picos, and Microservices Phillip J. Windley, PhD Enterprise Architecture, BYU CTO, Kynetx, Inc. @windley
  2. 2. This APIs in this talk aren’t RESTful
  3. 3. Internet of Things
  4. 4. The Internet of Things will lead to a computing experience that is immersive & pervasive.
  5. 5. Ambient Computing
  6. 6. vs
  7. 7. The Current #IoT Model Won’t Scale
  8. 8. Me
  9. 9. GE
  10. 10. Internet of My Things Me GE
  11. 11. The Internet of My Things
  12. 12. The Internet of My Things leads to The API of Me
  13. 13. Events vs Requests
  14. 14. “this happened” vs “do this”
  15. 15. Event System Properties Events are autonomous Event-driven system are more loosely coupled Downstream (receiver) driven flow control Near real-time propagation
  16. 16. Fuse is Three Things http://joinfuse.com
  17. 17. picos
  18. 18. Picos are online computers Identity—they represent a specific entity Storage—they persistently encapsulate both structured and unstructured data Open event network—they respond to events Processing—they run applications autonomously Event Channels—they have connections to other picos Services—The provide a consistent set of services APIs—they provide access to and access other online services
  19. 19. Owner Pico Fleet Pico Vehicle Pico Vehicle Pico Vehicle Pico
  20. 20. Web Application Application Data Browser
  21. 21. Web Application Browser Application Data
  22. 22. Vehicle's Pico iCalendar Mobile Web
  23. 23. Rather than a model where a system presents an API for a collection of resources….
  24. 24. Rather than a model where a system presents an API for a collection of resources…. Picos present a model wherein each pico presents it’s own, customizable API
  25. 25. Phil's Pico owner
  26. 26. Phil's Pico owner Lynne's Pico owner
  27. 27. Phil's Pico Tom's Pico owner Lynne's Pico owner
  28. 28. Phil's Pico Tom's Pico owner Lynne's Pico owner
  29. 29. Phil's Pico Tom's Pico owner Lynne's Pico owner
  30. 30. Phil's Pico Tom's Pico owner Lynne's Pico owner borrower
  31. 31. Phil's Pico
  32. 32. Phil's Pico
  33. 33. Picos Support A Familiar Model Kynetx Rules Engine Other Data Sources APIs Web Services Rulesets Persistent Data APIs container
  34. 34. Picos Support A Familiar Model Persistent Compute Object object Kynetx Rules Engine Other Data Sources APIs Web Services Rulesets Persistent Data APIs container
  35. 35. Picos Support A Familiar Model Persistent Compute Object object Kynetx Rules Engine Other Data Sources APIs Web Services Rulesets Persistent Data APIs container CloudOS Configuration Management CloudOS Service Notification Service Personal Data Service UI Support File Social Social Fuse Library Guard Tour Library libraries
  36. 36. Picos Support A Familiar Model Kynetx Rules Engine Other Data Sources Web Services APIs Rulesets Persistent Data APIs container Persistent Compute Object object Forevr.us (contact) Timeline (social) Vehicle Manangement To Do & Reminders Intentcasting Home Management Fuse Guard Tour applications CloudOS Personal Data Service Configuration Management CloudOS Service Notification Service UI Support File Social Social Fuse Library Guard Tour Library libraries
  37. 37. Picos Are Decentralized & Networked pico pico Pico Space Hosting Space Hosting Company A Hosting Company B Self Hosted pico pico pico pico pico pico pico KRE KRE KRE Pico Containers
  38. 38. Built on open standards Built on open source
  39. 39. But it’s not just about manufactured things...
  40. 40. Institution Managers Tour Index Report "1" Location Index Report Index Guard "Frank" Tour "LUFX" Tour "KUFF" Location "R7RK" Location "G5YH" Report "current" Location "T67G" Guards Subscriptions permanent temporary This can get complex… Report R"2e"port R"2e"port R"2e"ports Tours Tours Tours Tours Locations Locations Locations Locations
  41. 41. Picos Use an Event Query API functions return results based on persistent data pico functions rules persistent storage User Interface name email phone UI updates presentation Done or Cancel using query API query API event API user makes change in UI resulting in an event rules validate and process event, often updating model
  42. 42. Programming Model Program in any language you like OAuth access to pico Pico provides user data processing API and inter-pico communications
  43. 43. Microservices Organized around a single business capability Small, generally less than 1000 lines and code and usually much smaller Event-based and asynchronous Run in their own process Independently deployable Decentralized data storage
  44. 44. carvoyant: numeric_data_key vehicle event bus
  45. 45. carvoyant: numeric_data_key vehicle event bus fuel level low
  46. 46. carvoyant: numeric_data_key fuse: update_fuel_level vehicle event bus fuel level low
  47. 47. carvoyant: numeric_data_key fuse: update_fuel_level vehicle event bus fuel level low fuse: new_alert create alert
  48. 48. carvoyant: numeric_data_key fuse: update_fuel_level vehicle event bus fuel level low fuse: new_alert create alert notification: status send notification
  49. 49. carvoyant: numeric_data_key fuse: update_fuel_level vehicle event bus fuel level low fuse: new_alert create alert record new fuel notification: status send notification
  50. 50. carvoyant: numeric_data_key fuse: update_fuel_level vehicle event bus fuel level low fuse: new_alert create alert IFTTT record new fuel notification: status send notification
  51. 51. carvoyant: numeric_data_key fuse: update_fuel_level save trip IFTTT vehicle event bus fuel level low fuse: new_alert create alert record new fuel notification: status send notification
  52. 52. Healing Subscriptions rule check_subscriptions { select when pds profile_updated pre { vid = carvoyant:vehicle_id(); my_subs = carvoyant:getSubscription(vid); should_have = required_subscription_list.length(); } if(my_subs.length() < should_have) then send_directive("not enough subscriptions") fired { log ">>>> vehicle #{vid} needs subscription check"; raise fuse event need_initial_carvoyant_subscriptions; } }
  53. 53. Healing Subscriptions rule check_subscriptions { select when pds profile_updated pre { vid = carvoyant:vehicle_id(); my_subs = carvoyant:getSubscription(vid); should_have = required_subscription_list.length(); } if(my_subs.length() < should_have) then send_directive("not enough subscriptions") fired { log ">>>> vehicle #{vid} needs subscription check"; raise fuse event need_initial_carvoyant_subscriptions; } }
  54. 54. Healing Subscriptions rule check_subscriptions { select when pds profile_updated pre { vid = carvoyant:vehicle_id(); my_subs = carvoyant:getSubscription(vid); should_have = required_subscription_list.length(); } if(my_subs.length() < should_have) then send_directive("not enough subscriptions") fired { log ">>>> vehicle #{vid} needs subscription check"; raise fuse event need_initial_carvoyant_subscriptions; } }
  55. 55. Healing Subscriptions rule check_subscriptions { select when pds profile_updated pre { vid = carvoyant:vehicle_id(); my_subs = carvoyant:getSubscription(vid); should_have = required_subscription_list.length(); } if(my_subs.length() < should_have) then send_directive("not enough subscriptions") fired { log ">>>> vehicle #{vid} needs subscription check"; raise fuse event need_initial_carvoyant_subscriptions; } }
  56. 56. Healing Subscriptions rule check_subscriptions { select when pds profile_updated pre { vid = carvoyant:vehicle_id(); my_subs = carvoyant:getSubscription(vid); should_have = required_subscription_list.length(); } if(my_subs.length() < should_have) then send_directive("not enough subscriptions") fired { log ">>>> vehicle #{vid} needs subscription check"; raise fuse event need_initial_carvoyant_subscriptions; } }
  57. 57. KRL Rules Runs in picos Built for microservices Complex event expressions Persistent variables Side-effects are quarantined
  58. 58. Developer Tools
  59. 59. Self Healing
  60. 60. f(f(x)) = f(x) Idempotent
  61. 61. Asynchrony
  62. 62. Accretive Systems
  63. 63. Why do this? Orthogonality and modularity are powerful: network effects! Loose coupling Simple services are easier to get right More private
  64. 64. My book on event programming
  65. 65. http://joinfuse.com Internet Identity Workshop
  66. 66. Events, Picos, and Microservices ! Contact info: Phil Windley pjw@kynetx.com www.windley.com @windley

×