Paraimpu: a social tool for the Web of Things @ WoT2011
1. The anatomy of a large scale Social
Web for Internet enabled Object
Antonio Pintus Davide Carboni Andrea Piras
CRS4
WoT 2011 - June 2011 - San Francisco, CA, USA
Antonio Pintus - pintux@crs4.it Davide Carboni - dcarboni@crs4.it Andrea Piras - piras@crs4.it 1
2. Who, where...
ā¢ Antonio Pintus and Davide Carboni and Andrea Piras
ā¢ ICT - LBS Group @ CRS4, an interdisciplinary applied research center based
in Pula (Cagliari), SARDINIA, Italy
2
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
3. The Web of Things
ā¢ In the Web of Things (WoT) vision, things are connected to a pervasive
wireless/wired network and can communicate with other objects and
services using HTTP-based protocols
ā¢ Everyday surrounding objects (phones, domestic appliances,
advertisement billboards, musical instruments,... ) become nodes of the
WoT
ā¢ Web-enabled objects are available on the market just now!
3
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
4. part #1
Our Vision
Ph. http://www.flickr.com/photos/salendron/
4
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
5. Vision: a Social Web of Things /1
#1: connecting Things to the Web must be
simple
- simple to āplugā
- simple to con gure
- simple to manage
- Web-based UX
Ph. Nigel Marshall, http://www.flickr.com/photos/nige_mar/
5
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
6. Vision: a Social Web of Things /2
ā¢ #2: not only āphysicalā Things but also āvirtualā
ones
āsocial networks, Web sites, feeds, APIs, ...
6
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
7. Vision: a Social Web of Things /3
#3: interconnecting Things in the Web
must be simple
- including āphysicalā and āvirtualā
Things
- data adapting / transformation
Ph. John Thurm, http://www.flickr.com/photos/thurm
7
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
8. Vision: a Social Web of Things /4
#4: Social /1: existing social networks become
connectable Things
- Authentication facilities, friends/contacts import
Ph. Nigel Marshall, http://www.flickr.com/photos/nige_mar/
8
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
9. Vision: a Social Web of Things /5
Ph. Ryan Roberts http://www.ļ¬ickr.com/photos/ryanr
#5: Social /2: Share your Things with friends!
9
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
10. Things Sharing
ā Things sharing:
ā¢ it should be possible to share a Thing with friends and let
them use it in their connections (according to a de ned
policy: public, open, moderated)
ā¢ sharing objects goes toward a ācollaborative consumptionā
as shaped by the authors of the book Whatās mine is yours*
* What's Mine Is Yours: The Rise of Collaborative Consumption, Rachel Botsman and Roo Rogers . Harperbusiness,
http://www.collaborativeconsumption.com/
10
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
11. The Model: 4 basic abstractions
- Services:
- Sensors
- Actuators
- Connections
Ph. Windell Oskay http://www.ļ¬ickr.com/photos/oskay/265899865/
11
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
12. Services: Sensors
- every Thing capable to produce
data
- using HTTP
- anemometers, Arduino boards,
but also Foursquare, Pachube,
other services in the Web...
Ph. Windell Oskay http://www.ļ¬ickr.com/photos/oskay/
12
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
13. Services: Actuators
- every Thing capable to receive/
consume data and to perfom an
action
- using HTTP
- lighting systems, Arduino,
Chumby, Karotz, but also Twitter,
Facebook, other applications...
Ph. Dieter Drescher http://www.ļ¬ickr.com/photos/cosmosfan
13
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
14. Connections
- between two Services:
- a Sensor as the source
- an Actuator as the destination
- they are con gurable:
- data ltering
- data mapping
Ph. supermaryan http://www.ļ¬ickr.com/photos/33975256@N06/
14
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
15. problems: architecture & scalability
ā¢ Scalability
ā What happens when the number of users grows?
ā What happens when thousands of things are added?
ā What happens when thousands of near real-time data
have to be managed?
ā System MUST be scalable by design!
15
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
16. problems: architecture & scalability
Web-based Architecture
WS-* or REST
Web server
Load balancing
Horizontal Scalability
C10K problem
Database
?
New Sensors/Actuators
Ph. MrFaber, http://www.ļ¬ickr.com/photos/mrfaber
16
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
17. part #2
Architectural &
Design Choices
Ph. Jaime Silva, http://www.flickr.com/photos/20792787@N00/
17
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
18. WS-* or REST?
ā¢ in many cases adopting a WS-* stack is too complex:
WSDL, SOAP over HTTP, ...
ā¢ often, weāre talking about (limited) physical digital Things
ā¢ weāve chosen REST as architectural style:
Ā» Things, connections, data, users, ..., are REST
resources
Ā» simpler, exible, āmashableā, APIs
18
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
19. Data persistence: SQL or NoSQL?
ā¢ Considering:
ā high data heterogeneity: DB schema exibility required
ā database scalability across distributed systems
ā data partitioning & data replication
ā¢ Weāve chosen a NoSQL DB:
Ā» no xed schemas, no tables, no relations
Ā» high concurrent read-write, scalability, auto-
sharding
Ā» JSON native format
19
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
20. Web server, Web front-end
ā¢ Full Web-based system
ā¢ C10K problem: 10,000 simultaneous open standing HTTP
connections (clients)
ā¢ Horizontal scalability: add new server instances when
required
ā¢ Load balancing/reverse proxy
20
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
21. Things Connections
ā¢ data transfers between DB-based queues
ā¢ data adaptation performed by system processes
ā¢ data adaptation rules de ned by users for each owned
connection
21
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
22. Data adaptation: lters
ā¢ a Filter is a boolean expression evaluated
against data coming from a Sensor
āusing Javascript as expression language
Ā» sensor > 12
Ā» sensor. eld == āmylabelā
Ā» sensor.data >20 && sensor.type == ātempā
Ā» ...
22
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
23. Data adaptation: mappings
ā¢ Mappings are couple of expressions: (cond, repl)
ā¢ cond : a boolean expression evaluated against
Sensor data (same as for lters)
ā¢ repl : an expression producing a data value to be
forwarded to the Actuator when cond is true
23
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
24. Mappings, examples
ā Javascript as expression language
Sensor data CONDITION REPLACE Actuator data
type type
numeric sensor > 30 <% sensor * 3.14 / 100 %> numeric
Summer is coming, temperature is:
numeric sensor > 25 text
<% sensor %> Ā°C
Data is <% sensor.data %>
JSON sensor.data > 30 text
and type is <% sensor.type %>
<?xml version="1.0" encoding="UTF-8"?>
sensor.A0 > 30 && <value>
JSON XML
sensor.A5 <= 10 <% sensor.A0 * 100 %>
</value>
24
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
25. Paraimpu
ā¢ is a Web-based social tool
ā¢ allows people to:
ā connect, use, share and compose Things, services and
devices to create personalized WoT applications
25
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
26. General Architecture
Load balancing
Web front-end
scalability
System processes (back-
end) scalability
DB scalability
26
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
27. Paraimpu: the workspace
27
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
28. Current version
ā¢ ~ 50 active alpha users
ā¢ Palette:
ā¢ 5 ready-to-use Sensors + 1 generic Sensor
ā¢ 7 ready-to-use Actuators + 1 generic Actuator
ā¢ Sharing policy: (private), public, open, moderated
ā¢ Noti cation system between users for Things sharing
28
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
29. Technologies
ā¢ Architecture mainly written in Python
ā¢ Web stack based on Tornado Web server
ā¢ NoSQL DBMS (MongoDB)
ā¢ HTML+jQuery
29
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
30. Conclusion
ā¢ We believe that a social Web of Things can help in its diļ¬usion...
ā¢ Results are encouraging: alpha users are helping us in testing
and improving the system
ā¢ More and better test beds are under de nition to prove system
scalability in each of its critical aspects
ā¢ Weāre working hard to add new features and new ready-to-use,
easy-con guration, components and Things
30
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
31. The prototype
http://paraimpu.crs4.it
twitter: @paraimpu
31
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
32. Contacts
ā¢ Antonio Pintus, pintux@crs4.it, twitter: @apintux
ā¢ Davide Carboni, dcarboni@crs4.it
ā¢ Andrea Piras, piras@crs4.it
ā¢ LBS group @ CRS4: http://geoweb.crs4.it/
ā¢ CRS4 Home Page: http://www.crs4.it
32
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA
33. Q&A
Thank you for your attention
33
Antonio Pintus, Davide Carboni, Andrea Piras WoT2011 - June 2011- San Francisco, CA, USA