SlideShare a Scribd company logo
1 of 26
Download to read offline
BISSA: Empowering Web gadget
Communication with Tuple Spaces
Udayanga Wickramasinghe, Charith Wickramarachchi,
Pradeep Fernando, Dulanjanie Sumanasena, Sanjiva
Weerawarana, Srinath Perera
Lanka Software Foundation, WSO2 Inc., University of
Moratuwa
Outline
● Web 2.0, Gadgets, and Gadgets
Communication
● Tuples and Gadgets
● Proposed Solution: In browser vs. Global
tuple space
● Architecture
● Evaluation
● Usecases
● User generated or user
extended content and
collective intelligence are
the key
● Need to be simple, sensible,
and scalable
● Users add value, often as a
side effect
● Data is your competitive
advantage
● Mahups/ Remix
Web Gadgets
● Common way to generate Web 2.0 Content
● Almost its own page, which is rendered in its own iframe.
● It is described through gadget.xml
● Rendered by a gadget container (e.g. iGoogle and Shindig)
● Let users customize their view (profile) by adding removing
features they like to see.
Next generation Gadgets/ Apps?
● Enable truly client side applications (break the need to put code
to backend) – e.g. Online games, social network apps
● Inter Gadget communications?
● To store settings, client side communication, communication between
many instances of the same gadget or different gadgets.
● How to do that?
● Pub/Sub – pubsubhubbub
● RPC – call services in the backend
● By navigating documents - if you know
about the other Gadget, you can access it
though the DOM
● Google Gears (Only local)
Tuple Spaces
● Back to school: all of us know what a Tuple is; <Nimal, 23,
central college, >
● Tuple space is a blackboard, shared place to
● Put tuples
● Search and read tuples
● Search and retrieve (and remove tuples)
● Loosely coupled
● An implementation of the
associative memory paradigm
for parallel/distributed
computing.
● A repository of Tuples that can
be accessed concurrently by
one or more processors.
Tuple Spaces for Gadget
Communication and Data Storage
● Loose Coupling between entities
● Decoupling in time – do not need both side to be online
● Decouple in space – do not need direct addressing
● Decouple in synchronization - Async matches java script
model
● Stable storage (replicated, scalable, and reliable)
● Support for search through wild cards
● Both Push and Pull models to get data.
Proposed Solution
Two parts
● We proposed to use a
Scalable Tuple space to
share state and to
communicate across Web
applications
● We have built a in
browser tuple space and
an external Global tuple
space, and link them
together
Part1: Global Tuple Space
● BISSA implements a distributed tuple space based on peer to peer
paradigm (On top of Pastry)
● Highly scalable and reliable
Global Space: Challenge
● Idea is to store tuples in DHT using DHT
replication mechanisms
● DHT let us distribute the data across nodes,
thus scales very well.
● Challenge is to support search based on
templates (e.g. <hello,????>) for “read”,
“take”, and “subscribe” operations.
Big Idea: Generate templates for each value
and build an index. (e.g. for each <a,b>
create <a,*> and <*,b> templates and build a
index for each).
Two main phases
1) Write tuple as a
DHT element with
an associated hash
calculated for it.
2) Update the
Indexes that are
distributed in the
system.
Architecture: Supporting Write
Search is done through Indexes associated with
tuple templates. Ex : tuple <hello,world> can have
<???,world> or <hello,???>, and there is a index for
each template.
Architecture: Supporting Read
● Hash the search pattern and lookup the index for that pattern
using DHT. Then lookup entries for that pattern using index.
Three main phases
1) Get the tuple
locations that matches
the pattern using index
2) Delete the actual
tuple(s)
3) Update the indexes
to not have the
tuples
Architecture: Supporting Take
Only support sync manner
How?
1) Store the
subscriptions with
indexes.
2)When index is being
updated, notify the
subscribers.
Architecture: Supporting Subscriptions
Subscriptions are also done using patterns
Consistency Model
● In the take operation, updating indexes and updating
entries are not atomic. So values are inconsistent while
take is happening.
● We first delete the entries then delete the index
● What if two takes or take and read happened at the
same type?
● If replicas in active passive mode, we can try to detect and
handle this at the API level. (e.g. If tuples are removed while
retrieving them after a search, that suggest take is going on.
● Otherwise we have eventual consistency - OK for some
Apps like distributed Computation, Gaming Apps
In-Browser Tuple Space
BISSABISSA
Browser SpaceBrowser Space
BISSABISSA
P2P SpaceP2P Space
BISSA Util
Component
BISSA Tuple
Component
P2P
Integration
Component
BISSA Tuple Space
ManagerTuple Storage
HandlerCallback Handler
Tuple Templates
Handler● In memory browser tuple
space
● Local APIs and Global APIs
Operation
● insert Tuples → put()
● query Tuple → query()
● remove Tuples →
take()
BISSA Inter Gadget Communication
Framework
Gadget Engine
Gadget
side
library
Container
side
library
RPC Feature
Gadget Features core
BISSA Feature
<Module><Module>
<Req Feature =<Req Feature =
“BISSA”/>“BISSA”/>
……………………
………………
<Module/><Module/>
A Gadget xmlA Gadget xml
● Develop a Tuple space in java
scripts
● JavaScript Library for gadget level
Access for BISSA
● Included this as a Gadget Feature
through Shinding: Can get access to
Bissa libraries by adding <Req
feature=”Bissa” />
● Can talk to local API or global API
● Access to global API happens
through RPC bridge.
● We sync the local and global tuple
spaces periodically. WS for
communication
How does it make a difference?
●
Enable truly client side applications: break the
need to put code to backend, and now it is
possible to develop Apps that communicates with
each other and have storage support without any
backend code.
●
Key to make authoring easier
●
Provide coordination between application in a
loosely coupled unlike other server based
solutions
●
Highly scalable due to underline DHT
●
Reliability through replication
●
Storage - Remove the need to have and maintain
a database
●
Provides Pub/sub with support for data
persistence as well.
Few Use Cases
●
Co-ordination among gadget based applications
●
e.g. Shared data dashboard: One App can publish current
weather forcasts which is used by other Apps.
●
Games: Two players play chess by coordinating through Bissa
●
Social Apps : find out what happen with friends through Bissa
(e.g. Implement open social with Bissa)
●
Highly scalable & available data storage for web
applications
●
Remember user preferences
●
Distributed Address book
●
As a Pub Sub framework for web Application
●
CPU scavenging using web browsers
●
bringing processing power of browsers in to the community
grid
●
Distributed Cache for Web Applications
Testing Global Space:
Scalability Test
A scale test was conducted using 35 computers in a
controlled lab environment
Used “embarrassingly parallel” Monte-Carlo simulation as
the testing mechanism
Testing Global Space:
Latency Test
Measured the operation latency for constant number of
data in space while system is scaling up
Kato and Kamia [14] shows that the
messaging latency of Pastry is quite good up to 800 nodes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
Read-Latency
Write-Latency
Number of Nodes
Latency(ms)
Testing Browser Space
● Value is much higher than accessing from P2P ring
● We believe it is caused by async nature of http request from
browser and cost for WS call
● Plan to explore this more.
Operation Latency
read --> 30ms 30ms
write 35ms
Take 210ms
Future Work
● Testing Scalability
● Further understanding in to consistency
model
● Security model for Bissa
● Further refine it for distributed cache
● Avoid polling from local to global state
through Web Sockets
Summary
● Web Gadgets And Apps
● Next Generation Gadgets/ Apps with
storage and communications
● Global space, how it work?
● Local space How it works?
● Usecases and Impact
● Performance measurements
Q&A
Thank You!!!
Project web site (http://bissa.sourceforge.net/) is hosted at
sourceforge.net, & has every resources for developers
including blogs/samples/manuals & screen-casts.
The BISSA code is licensed under Apache 2.0 license apart
from Freepastry license : BSD license making it a 100%
open source project.

More Related Content

What's hot

Analytics for the Real-Time Web
Analytics for the Real-Time WebAnalytics for the Real-Time Web
Analytics for the Real-Time Web
maria.grineva
 
Cassandra background-and-architecture
Cassandra background-and-architectureCassandra background-and-architecture
Cassandra background-and-architecture
Markus Klems
 

What's hot (8)

Distributed Shared Memory on Ericsson Labs
Distributed Shared Memory on Ericsson LabsDistributed Shared Memory on Ericsson Labs
Distributed Shared Memory on Ericsson Labs
 
Coding For Cores - C# Way
Coding For Cores - C# WayCoding For Cores - C# Way
Coding For Cores - C# Way
 
Spark Workshop
Spark WorkshopSpark Workshop
Spark Workshop
 
Introduction to Apache Cassandra
Introduction to Apache Cassandra Introduction to Apache Cassandra
Introduction to Apache Cassandra
 
The Cassandra Distributed Database
The Cassandra Distributed DatabaseThe Cassandra Distributed Database
The Cassandra Distributed Database
 
Analytics for the Real-Time Web
Analytics for the Real-Time WebAnalytics for the Real-Time Web
Analytics for the Real-Time Web
 
How to Choose a Deep Learning Framework
How to Choose a Deep Learning FrameworkHow to Choose a Deep Learning Framework
How to Choose a Deep Learning Framework
 
Cassandra background-and-architecture
Cassandra background-and-architectureCassandra background-and-architecture
Cassandra background-and-architecture
 

Similar to BISSA: Empowering Web gadget Communication with Tuple Spaces

Similar to BISSA: Empowering Web gadget Communication with Tuple Spaces (20)

Summer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpointSummer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpoint
 
Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015
 
Megastore by Google
Megastore by GoogleMegastore by Google
Megastore by Google
 
Devoxx Belgium 2017 - easy microservices with JHipster
Devoxx Belgium 2017 - easy microservices with JHipsterDevoxx Belgium 2017 - easy microservices with JHipster
Devoxx Belgium 2017 - easy microservices with JHipster
 
Easy Microservices with JHipster - Devoxx BE 2017
Easy Microservices with JHipster - Devoxx BE 2017Easy Microservices with JHipster - Devoxx BE 2017
Easy Microservices with JHipster - Devoxx BE 2017
 
Deep Learning at Scale
Deep Learning at ScaleDeep Learning at Scale
Deep Learning at Scale
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
Event driven architectures with Kinesis
Event driven architectures with KinesisEvent driven architectures with Kinesis
Event driven architectures with Kinesis
 
Netflix Architecture and Open Source
Netflix Architecture and Open SourceNetflix Architecture and Open Source
Netflix Architecture and Open Source
 
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
 
IoT meets Big Data
IoT meets Big DataIoT meets Big Data
IoT meets Big Data
 
C. Sotiriou, Vodafone Greece: Adopting Quarkus for the digital experience layer
C. Sotiriou, Vodafone Greece: Adopting Quarkus for the digital experience layerC. Sotiriou, Vodafone Greece: Adopting Quarkus for the digital experience layer
C. Sotiriou, Vodafone Greece: Adopting Quarkus for the digital experience layer
 
Big Data Streams Architectures. Why? What? How?
Big Data Streams Architectures. Why? What? How?Big Data Streams Architectures. Why? What? How?
Big Data Streams Architectures. Why? What? How?
 
Apache ignite v1.3
Apache ignite v1.3Apache ignite v1.3
Apache ignite v1.3
 
NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1
 
Node.js Course 2 of 2 - Advanced techniques
Node.js Course 2 of 2 - Advanced techniquesNode.js Course 2 of 2 - Advanced techniques
Node.js Course 2 of 2 - Advanced techniques
 
Apache Spark 101 - Demi Ben-Ari
Apache Spark 101 - Demi Ben-AriApache Spark 101 - Demi Ben-Ari
Apache Spark 101 - Demi Ben-Ari
 
Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!
 
HPC and cloud distributed computing, as a journey
HPC and cloud distributed computing, as a journeyHPC and cloud distributed computing, as a journey
HPC and cloud distributed computing, as a journey
 
Hpc lunch and learn
Hpc lunch and learnHpc lunch and learn
Hpc lunch and learn
 

More from Srinath Perera

More from Srinath Perera (20)

Book: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingBook: Software Architecture and Decision-Making
Book: Software Architecture and Decision-Making
 
Data science Applications in the Enterprise
Data science Applications in the EnterpriseData science Applications in the Enterprise
Data science Applications in the Enterprise
 
An Introduction to APIs
An Introduction to APIs An Introduction to APIs
An Introduction to APIs
 
An Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance ProfessionalsAn Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance Professionals
 
AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?
 
Healthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesHealthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & Challenges
 
How would AI shape Future Integrations?
How would AI shape Future Integrations?How would AI shape Future Integrations?
How would AI shape Future Integrations?
 
The Role of Blockchain in Future Integrations
The Role of Blockchain in Future IntegrationsThe Role of Blockchain in Future Integrations
The Role of Blockchain in Future Integrations
 
Future of Serverless
Future of ServerlessFuture of Serverless
Future of Serverless
 
Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going? Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going?
 
Few thoughts about Future of Blockchain
Few thoughts about Future of BlockchainFew thoughts about Future of Blockchain
Few thoughts about Future of Blockchain
 
A Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New TechnologiesA Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New Technologies
 
Privacy in Bigdata Era
Privacy in Bigdata  EraPrivacy in Bigdata  Era
Privacy in Bigdata Era
 
Blockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksBlockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and Risks
 
Today's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology LandscapeToday's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology Landscape
 
An Emerging Technologies Timeline
An Emerging Technologies TimelineAn Emerging Technologies Timeline
An Emerging Technologies Timeline
 
The Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming ApplicationsThe Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming Applications
 
Analytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the UglyAnalytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the Ugly
 
Transforming a Business Through Analytics
Transforming a Business Through AnalyticsTransforming a Business Through Analytics
Transforming a Business Through Analytics
 
SoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration TechnologySoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration Technology
 

BISSA: Empowering Web gadget Communication with Tuple Spaces

  • 1. BISSA: Empowering Web gadget Communication with Tuple Spaces Udayanga Wickramasinghe, Charith Wickramarachchi, Pradeep Fernando, Dulanjanie Sumanasena, Sanjiva Weerawarana, Srinath Perera Lanka Software Foundation, WSO2 Inc., University of Moratuwa
  • 2. Outline ● Web 2.0, Gadgets, and Gadgets Communication ● Tuples and Gadgets ● Proposed Solution: In browser vs. Global tuple space ● Architecture ● Evaluation ● Usecases
  • 3. ● User generated or user extended content and collective intelligence are the key ● Need to be simple, sensible, and scalable ● Users add value, often as a side effect ● Data is your competitive advantage ● Mahups/ Remix
  • 4. Web Gadgets ● Common way to generate Web 2.0 Content ● Almost its own page, which is rendered in its own iframe. ● It is described through gadget.xml ● Rendered by a gadget container (e.g. iGoogle and Shindig) ● Let users customize their view (profile) by adding removing features they like to see.
  • 5. Next generation Gadgets/ Apps? ● Enable truly client side applications (break the need to put code to backend) – e.g. Online games, social network apps ● Inter Gadget communications? ● To store settings, client side communication, communication between many instances of the same gadget or different gadgets. ● How to do that? ● Pub/Sub – pubsubhubbub ● RPC – call services in the backend ● By navigating documents - if you know about the other Gadget, you can access it though the DOM ● Google Gears (Only local)
  • 6. Tuple Spaces ● Back to school: all of us know what a Tuple is; <Nimal, 23, central college, > ● Tuple space is a blackboard, shared place to ● Put tuples ● Search and read tuples ● Search and retrieve (and remove tuples) ● Loosely coupled ● An implementation of the associative memory paradigm for parallel/distributed computing. ● A repository of Tuples that can be accessed concurrently by one or more processors.
  • 7. Tuple Spaces for Gadget Communication and Data Storage ● Loose Coupling between entities ● Decoupling in time – do not need both side to be online ● Decouple in space – do not need direct addressing ● Decouple in synchronization - Async matches java script model ● Stable storage (replicated, scalable, and reliable) ● Support for search through wild cards ● Both Push and Pull models to get data.
  • 8. Proposed Solution Two parts ● We proposed to use a Scalable Tuple space to share state and to communicate across Web applications ● We have built a in browser tuple space and an external Global tuple space, and link them together
  • 9. Part1: Global Tuple Space ● BISSA implements a distributed tuple space based on peer to peer paradigm (On top of Pastry) ● Highly scalable and reliable
  • 10. Global Space: Challenge ● Idea is to store tuples in DHT using DHT replication mechanisms ● DHT let us distribute the data across nodes, thus scales very well. ● Challenge is to support search based on templates (e.g. <hello,????>) for “read”, “take”, and “subscribe” operations. Big Idea: Generate templates for each value and build an index. (e.g. for each <a,b> create <a,*> and <*,b> templates and build a index for each).
  • 11. Two main phases 1) Write tuple as a DHT element with an associated hash calculated for it. 2) Update the Indexes that are distributed in the system. Architecture: Supporting Write Search is done through Indexes associated with tuple templates. Ex : tuple <hello,world> can have <???,world> or <hello,???>, and there is a index for each template.
  • 12. Architecture: Supporting Read ● Hash the search pattern and lookup the index for that pattern using DHT. Then lookup entries for that pattern using index.
  • 13. Three main phases 1) Get the tuple locations that matches the pattern using index 2) Delete the actual tuple(s) 3) Update the indexes to not have the tuples Architecture: Supporting Take Only support sync manner
  • 14. How? 1) Store the subscriptions with indexes. 2)When index is being updated, notify the subscribers. Architecture: Supporting Subscriptions Subscriptions are also done using patterns
  • 15. Consistency Model ● In the take operation, updating indexes and updating entries are not atomic. So values are inconsistent while take is happening. ● We first delete the entries then delete the index ● What if two takes or take and read happened at the same type? ● If replicas in active passive mode, we can try to detect and handle this at the API level. (e.g. If tuples are removed while retrieving them after a search, that suggest take is going on. ● Otherwise we have eventual consistency - OK for some Apps like distributed Computation, Gaming Apps
  • 16. In-Browser Tuple Space BISSABISSA Browser SpaceBrowser Space BISSABISSA P2P SpaceP2P Space BISSA Util Component BISSA Tuple Component P2P Integration Component BISSA Tuple Space ManagerTuple Storage HandlerCallback Handler Tuple Templates Handler● In memory browser tuple space ● Local APIs and Global APIs Operation ● insert Tuples → put() ● query Tuple → query() ● remove Tuples → take()
  • 17. BISSA Inter Gadget Communication Framework Gadget Engine Gadget side library Container side library RPC Feature Gadget Features core BISSA Feature <Module><Module> <Req Feature =<Req Feature = “BISSA”/>“BISSA”/> …………………… ……………… <Module/><Module/> A Gadget xmlA Gadget xml ● Develop a Tuple space in java scripts ● JavaScript Library for gadget level Access for BISSA ● Included this as a Gadget Feature through Shinding: Can get access to Bissa libraries by adding <Req feature=”Bissa” /> ● Can talk to local API or global API ● Access to global API happens through RPC bridge. ● We sync the local and global tuple spaces periodically. WS for communication
  • 18. How does it make a difference? ● Enable truly client side applications: break the need to put code to backend, and now it is possible to develop Apps that communicates with each other and have storage support without any backend code. ● Key to make authoring easier ● Provide coordination between application in a loosely coupled unlike other server based solutions ● Highly scalable due to underline DHT ● Reliability through replication ● Storage - Remove the need to have and maintain a database ● Provides Pub/sub with support for data persistence as well.
  • 19. Few Use Cases ● Co-ordination among gadget based applications ● e.g. Shared data dashboard: One App can publish current weather forcasts which is used by other Apps. ● Games: Two players play chess by coordinating through Bissa ● Social Apps : find out what happen with friends through Bissa (e.g. Implement open social with Bissa) ● Highly scalable & available data storage for web applications ● Remember user preferences ● Distributed Address book ● As a Pub Sub framework for web Application ● CPU scavenging using web browsers ● bringing processing power of browsers in to the community grid ● Distributed Cache for Web Applications
  • 20. Testing Global Space: Scalability Test A scale test was conducted using 35 computers in a controlled lab environment Used “embarrassingly parallel” Monte-Carlo simulation as the testing mechanism
  • 21. Testing Global Space: Latency Test Measured the operation latency for constant number of data in space while system is scaling up Kato and Kamia [14] shows that the messaging latency of Pastry is quite good up to 800 nodes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Read-Latency Write-Latency Number of Nodes Latency(ms)
  • 22. Testing Browser Space ● Value is much higher than accessing from P2P ring ● We believe it is caused by async nature of http request from browser and cost for WS call ● Plan to explore this more. Operation Latency read --> 30ms 30ms write 35ms Take 210ms
  • 23. Future Work ● Testing Scalability ● Further understanding in to consistency model ● Security model for Bissa ● Further refine it for distributed cache ● Avoid polling from local to global state through Web Sockets
  • 24. Summary ● Web Gadgets And Apps ● Next Generation Gadgets/ Apps with storage and communications ● Global space, how it work? ● Local space How it works? ● Usecases and Impact ● Performance measurements
  • 25. Q&A
  • 26. Thank You!!! Project web site (http://bissa.sourceforge.net/) is hosted at sourceforge.net, & has every resources for developers including blogs/samples/manuals & screen-casts. The BISSA code is licensed under Apache 2.0 license apart from Freepastry license : BSD license making it a 100% open source project.