Upload
phil-windley
View
4.828
Download
1
Tags:
Embed Size (px)
DESCRIPTION
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.
Citation preview
Events, Picos, and MicroservicesPhillip J. Windley, PhD Enterprise Architecture, BYU CTO, Kynetx, Inc. @windley
This APIs in this talk aren’t RESTful
Internet of Things
The Internet of Things will lead to a computing experience that is immersive & pervasive.
Ambient Computing
vs
The Current #IoT Model Won’t Scale
Me
GE
Internet of
My Things
Me
GE
The Internet of My Things
The Internet of My Things leads to The API of Me
Events vs Requests
“this happened” vs “do this”
Event System Properties
Events are autonomous Event-driven system are more loosely coupled Downstream (receiver) driven flow control Near real-time propagation
picos
Picos are online computersIdentity—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
Owner Pico
Fleet Pico
Vehicle Pico
Vehicle Pico
Vehicle Pico
Web Application
Application Data
Browser
Web Application
Application Data
Browser
Vehicle's Pico
iCalendarWeb
Mobile
Rather than a model where a system presents an API for a collection of resources….
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
Phil's Pico
owner
Phil's Pico
owner
Lynne's Pico
owner
Phil's Pico Tom's Pico
owner
Lynne's Pico
owner
Phil's Pico Tom's Pico
owner
Lynne's Pico
owner
Phil's Pico Tom's Pico
owner
Lynne's Pico
owner
Phil's Pico Tom's Pico
owner
Lynne's Pico
owner borrower
Phil's Pico
Phil's Pico
Picos Support A Familiar Model
Kynetx Rules Engine
OtherData
Sources
WebServices
APIs
Rulesets PersistentData
APIs
container
Picos Support A Familiar Model
Kynetx Rules Engine
OtherData
Sources
WebServices
APIs
Rulesets PersistentData
APIs
container
Persistent Compute Object object
Picos Support A Familiar Model
Kynetx Rules Engine
OtherData
Sources
WebServices
APIs
Rulesets PersistentData
APIs
container
Persistent Compute Object object
CloudOS
Confi
gura
tion
Man
agem
ent
Clou
dOS
Serv
ice
Notifi
catio
nSe
rvice
Pers
onal
Dat
a Se
rvice
UI S
uppo
rt
File
Soci
al
Soci
al Fuse
Libr
ary
Gua
rd
Tour
Libr
ary
libraries
Picos Support A Familiar Model
Kynetx Rules Engine
OtherData
Sources
WebServices
APIs
Rulesets PersistentData
APIs
container
Persistent Compute Object object
Fore
vr.u
s(c
onta
ct)
Tim
elin
e(s
ocia
l)
To D
o &
Rem
inde
rs
Vehi
cle
Man
ange
men
t
Hom
e M
anag
emen
t
Inte
ntca
stin
g
Fuse
Gua
rd
Tour
applications
CloudOS
Confi
gura
tion
Man
agem
ent
Clou
dOS
Serv
ice
Notifi
catio
nSe
rvice
Pers
onal
Dat
a Se
rvice
UI S
uppo
rt
File
Soci
al
Soci
al Fuse
Libr
ary
Gua
rd
Tour
Libr
ary
libraries
Picos Are Decentralized & Networked
picopico
HostingSpace
PicoSpace
HostingCompany A
Hosting Company B
SelfHosted
pico
pico
pico
pico
picopico
pico
KRE KRE KRE PicoContainers
Built on open standards Built on open source
But it’s not just about manufactured things...
This can get complex…
Institution
TourIndex Location
Index
ReportIndex
Tour"LUFX"
Tour"KUFF"
Location"R7RK"
Report"1"
Location"G5YH"
Report"current"
Location"T67G"
Managers
Guards
Guard"Frank"
Subscriptions
permanent
temporary
Report"2"Report"2"Report"2"Reports
ToursToursToursTours
LocationsLocationsLocationsLocations
Picos Use an Event Query API
pico
functions
rules
persistentstorage
or CancelDone
User Interface
name
phone
query API
event API
user makes change in UIresulting in an event
UI updates presentation using query API
rules validate and process event, often updating model
functions return results based on persistent data
Programming ModelProgram in any language you like
OAuth access to pico
Pico provides
user data
processing
API and inter-pico communications
MicroservicesOrganized 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
carvoyant: numeric_data_key
vehicle event bus
carvoyant: numeric_data_key
vehicle event bus
fuel level low
carvoyant: numeric_data_key
fuse: update_fuel_level
vehicle event bus
fuel level low
carvoyant: numeric_data_key
fuse: update_fuel_level
vehicle event bus
fuel level low
create alert
fuse: new_alert
carvoyant: numeric_data_key
fuse: update_fuel_level
vehicle event bus
fuel level low
create alert
fuse: new_alert
send notification
notification: status
carvoyant: numeric_data_key
fuse: update_fuel_level
vehicle event bus
fuel level low
create alert
fuse: new_alert
record new fuel
send notification
notification: status
carvoyant: numeric_data_key
fuse: update_fuel_level
vehicle event bus
fuel level low
create alert
fuse: new_alert
record new fuel
IFTTT
send notification
notification: status
carvoyant: numeric_data_key
fuse: update_fuel_level
vehicle event bus
fuel level low
create alert
fuse: new_alert
record new fuel
save trip IFTTT
send notification
notification: status
Healing Subscriptionsrule 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;
}
}
Healing Subscriptionsrule 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;
}
}
Healing Subscriptionsrule 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;
}
}
Healing Subscriptionsrule 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;
}
}
Healing Subscriptionsrule 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;
}
}
KRLRules Runs in picos Built for microservices Complex event expressions Persistent variables Side-effects are quarantined
Developer Tools
Self Healing
f(f(x)) = f(x)Idempotent
Asynchrony
Accretive Systems
Why do this?Orthogonality and modularity are powerful: network effects! Loose coupling Simple services are easier to get right More private
My book on event programming
!
Contact info: Phil Windley
[email protected] www.windley.com
@windley
Events, Picos, and Microservices