SlideShare a Scribd company logo
1 of 19
Developing Distributed Web Applications, Where does REST fit in? Dr. Srinath Perera Senior Software Architect, WSO2 Inc. Visiting Faculty, University of Moratuwa
What is a Distributed Web Application? Users access a one server (or he thinks he does) while really the app is composed of many machines.  Why “Distributed”?  for scaling. Single machine can not handle the load High availability  photo by arvindgrover on Flickr, http://www.fotopedia.com/items/flickr-3154212659
Google as a Distributed Web Application Google crawls the Web and stores all  (well most of ) the Web It builds indexes for included words and incoming links for each document When a user sends a query, it applies the Page Rank Algorithm and returns the most relevant results.   It is a distributed application that built using few 100k servers
Programming Distributed Web Applications Essentially (Web) applications  deal with state (data) and operations (executions or processing units) Users talk to applications and either retrieve data or make changes to the current state.  There are two primary architectural models SOA (Service Oriented Architectures) : based on processing units (verbs) ROA (Resource Oriented Architecture): based on data(nouns) photo by QolePejorian on Flickr, http://www.fotopedia.com/items/flickr-184160623
SOA (Service Oriented Architecture) There are many stateless processing units (often grouped as services) Users provide data to processing units, and they either return data after processing or change the system wide state (e.g. stored in the database). A SOA based architecture includes  a main storage (e.g. database) and many stateless processing units, and an application combines and composes those processing units together.  E.g. Google has its indexes etc., and one main operation “search” that accepts a search query as a input and returns matching documents.  Also implementation has many internal services  photo by L. Marie on Flickr, http://www.flickr.com/photos/lenore-m/312319615/
ROA (Resource Oriented Architecture) There is a resource structure Each resource supports four operations, PUT, GET, POST, DELETE Users retrieve information through GET and change system state through POST, DELETE, and PUT The architecture is based on resources (nouns) and processing is represented through four verbs on the resource.  photo by Svadilfari on Flickr, http://www.flickr.com/photos/22280677@N07/2435832518/ (CC)
ROA vs. SOA There are lots of fights, which I am not going to discuss in detail.  Argument is Web uses ROA, and it works.  SOA is much closer to the programing models we used to with languages like C or Java. So that is natural to us.  I would say, they are two useful styles, and we have to know both and use them where it naturally fits.  I will focus more on ROA for this discussion.  photo by hans s on Flickr, http://www.flickr.com/photos/archeon/2359334908/
REST (Representational State Transfer) ROA is realized with REST services or HTTP services (Good intro to REST, http://www.infoq.com/articles/rest-introduction) Main principles of REST Give everything an ID (URI) Things (resources) refer to each other  All interactions are done through four verbs (PUT, GET, DELETE, POST) on resources Photo by paraflyer on Flickr, http://www.fotopedia.com/items/flickr-386529128 Resources can return multiple formats (choosed based on content negotiation)  All communication are stateless (each request has all the information need to serve the request)
Example: Web App to Manage a Network Assume we want to build a Web app to manage networks. Users can view, query, and change the network configurations through this Web App.  Lets see how this would look with both SOA and REST Photo by  sylviaduckworth on Flickr, http://www.geograph.org.uk/photo/956353
With SOA Architecture will include a database to hold network data and services supporting following operations ListNetworks() NetworkDataGetNetworkData() ApplyNetworkData(NetworkDataquearyParams) SearchNetworks(String queryParams) Notice Each operation is a Verb, users combine those verbs to do what he needs Message formats are defined through a WSDL and each service supports one message format.
With REST Give everything a ID (URI) http://uom.lk/Networks http://uom.lk/Networks/ENT http://uom.lk/Networks/Civil Things (resources) refer to each other  Retrieving a network will return something like  <Networks> <cse ref=“http://uom.lk/Networks/CSE”/> 	…. </Networks> All interactions are done through four verbs (PUT, GET, DELETE, POST) on resources GET on http://uom.lk/Networks/CSE : Getting network data  POST on http://uom.lk/Networks/CSE: update the network config. DELETE on http://uom.lk/Networks/CSE can delete the network etc.
With REST (Contd.) Resources can return multiple formats Results can return multiple formats, XML, Jason, Binary or several XML formats etc.  Clients send the header Accept: text/json, text/xml+foo defining supported formats, and the server returns result in a format client supports. This means a resource can support multiple formats at the same time. Also we can use this to support new formats later.  All communication is stateless – this is same for SOA and ROA System can use HTTP style caching
Implementing REST Services Define the resources structure  Define many URLs for different types of resources Use a REST engine to attach code to each URL patterns, they support four verbs (e.g. see http://www.sinatrarb.com/intro) Code segment is for URL, verb, content type Example http://…/Networks: On GET text/xml do …. end Photo by Kevin Dooley on Flickr, http://www.flickr.com/photos/pagedooley/2201791390/
REST Anti-patterns Verbs in URLs http://uom.lk/SearchNetworks?pattern=foo This is doing SOA using HTTP, not REST Ignoring status codes on responses  Not including references in responses  <Networks> 	<cse> 	<nodeCount>..</nodeCount> 	<subnetmask> ..</subnetmask> <cse> </Networks> Use references whenever that makes sense, do not copy data in to response. Remember the underline linked resource structure.
REST, is it the Architecture to solve them all? Does the REST a silver bullet for all problems This is the source for most fights, the answer looks “No”. Some examples. It does not have a contract (Lack a WSDL)  Messaging – does not talk about eventing/ messaging aspects. May be need a SUBSCRIBE verb added.  Asynchronous invocations and reliability What about composition and transactions etc. mostly things come from WS-*  Does error messages are enough?  Photo by  Playaduraon Flickr, http://www.flickr.com/photos/playadura/1401756881
So when to use it? Use when REST is the natural choice  It is very good at representing resources  Not that good with processes/ executions  Same for SOA Is it OK to mix it?  I would say yes, but not too much WSO2 use REST for registry API, while SOA for many other places.  Photo by  QUEEN YUNA on Flickr, http://www.flickr.com/photos/queenyuna/5710802864/ (CC)
Conclusion What is a Distributed Application?  SOA and ROA as solutions  Detailed looked at ROA with a Example It is the architecture that solves everything? “Look like we need both”
For more information Stefan Tilkov: A Brief Introduction to REST, http://www.infoq.com/articles/rest-introduction Stefan Tilkov: REST Anti-Patterns, http://www.infoq.com/articles/rest-anti-patterns More articles here http://en.wikipedia.org/wiki/Representational_State_Transfer SanjivaWeerawarana: WS-* vs. REST: Mashing up the Truth from Facts, Myths and Lies, http://wso2.org/library/2818
Questions?

More Related Content

What's hot

CloudConnect 2011 - Building Highly Scalable Java Applications on Windows Azure
CloudConnect 2011 - Building Highly Scalable Java Applications on Windows AzureCloudConnect 2011 - Building Highly Scalable Java Applications on Windows Azure
CloudConnect 2011 - Building Highly Scalable Java Applications on Windows AzureDavid Chou
 
IRJET - Confidential Image De-Duplication in Cloud Storage
IRJET - Confidential Image De-Duplication in Cloud StorageIRJET - Confidential Image De-Duplication in Cloud Storage
IRJET - Confidential Image De-Duplication in Cloud StorageIRJET Journal
 
Databus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture PipelineDatabus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture PipelineSunil Nagaraj
 
Distributed Virtual Transaction Directory Server
Distributed Virtual Transaction Directory ServerDistributed Virtual Transaction Directory Server
Distributed Virtual Transaction Directory ServerLDAPCon
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMAashish Jain
 
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...LinkedIn
 
Data Infrastructure at LinkedIn
Data Infrastructure at LinkedInData Infrastructure at LinkedIn
Data Infrastructure at LinkedInAmy W. Tang
 
Combining Private and Public Clouds into Meaningful Hybrids
Combining Private and Public Clouds into Meaningful HybridsCombining Private and Public Clouds into Meaningful Hybrids
Combining Private and Public Clouds into Meaningful HybridsDavid Chou
 
Library Web Services for Discovery and Delivery of Scientific Information
Library Web Services for Discovery and Delivery of Scientific InformationLibrary Web Services for Discovery and Delivery of Scientific Information
Library Web Services for Discovery and Delivery of Scientific InformationRichard Akerman
 
CouchBase The Complete NoSql Solution for Big Data
CouchBase The Complete NoSql Solution for Big DataCouchBase The Complete NoSql Solution for Big Data
CouchBase The Complete NoSql Solution for Big DataDebajani Mohanty
 
Big Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computingBig Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computingAnimesh Chaturvedi
 
Microsoft Data Access Technologies
Microsoft Data Access TechnologiesMicrosoft Data Access Technologies
Microsoft Data Access TechnologiesDavid Chou
 
Java on Windows Azure
Java on Windows AzureJava on Windows Azure
Java on Windows AzureDavid Chou
 
Data Lake and the rise of the microservices
Data Lake and the rise of the microservicesData Lake and the rise of the microservices
Data Lake and the rise of the microservicesBigstep
 
Impact of Restful Web Architecture on Performance and Scalability
Impact of Restful Web Architecture on Performance and ScalabilityImpact of Restful Web Architecture on Performance and Scalability
Impact of Restful Web Architecture on Performance and ScalabilitySanchit Gera
 
Monitoring MySQL at scale
Monitoring MySQL at scaleMonitoring MySQL at scale
Monitoring MySQL at scaleOvais Tariq
 
Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Reactive Fast Data & the Data Lake with Akka, Kafka, SparkReactive Fast Data & the Data Lake with Akka, Kafka, Spark
Reactive Fast Data & the Data Lake with Akka, Kafka, SparkTodd Fritz
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web ApplicationsDavid Mitzenmacher
 

What's hot (20)

CloudConnect 2011 - Building Highly Scalable Java Applications on Windows Azure
CloudConnect 2011 - Building Highly Scalable Java Applications on Windows AzureCloudConnect 2011 - Building Highly Scalable Java Applications on Windows Azure
CloudConnect 2011 - Building Highly Scalable Java Applications on Windows Azure
 
IRJET - Confidential Image De-Duplication in Cloud Storage
IRJET - Confidential Image De-Duplication in Cloud StorageIRJET - Confidential Image De-Duplication in Cloud Storage
IRJET - Confidential Image De-Duplication in Cloud Storage
 
Databus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture PipelineDatabus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture Pipeline
 
Distributed Virtual Transaction Directory Server
Distributed Virtual Transaction Directory ServerDistributed Virtual Transaction Directory Server
Distributed Virtual Transaction Directory Server
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOM
 
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
 
Data Infrastructure at LinkedIn
Data Infrastructure at LinkedInData Infrastructure at LinkedIn
Data Infrastructure at LinkedIn
 
Combining Private and Public Clouds into Meaningful Hybrids
Combining Private and Public Clouds into Meaningful HybridsCombining Private and Public Clouds into Meaningful Hybrids
Combining Private and Public Clouds into Meaningful Hybrids
 
Java script framework
Java script frameworkJava script framework
Java script framework
 
Library Web Services for Discovery and Delivery of Scientific Information
Library Web Services for Discovery and Delivery of Scientific InformationLibrary Web Services for Discovery and Delivery of Scientific Information
Library Web Services for Discovery and Delivery of Scientific Information
 
CouchBase The Complete NoSql Solution for Big Data
CouchBase The Complete NoSql Solution for Big DataCouchBase The Complete NoSql Solution for Big Data
CouchBase The Complete NoSql Solution for Big Data
 
Big Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computingBig Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computing
 
Microsoft Data Access Technologies
Microsoft Data Access TechnologiesMicrosoft Data Access Technologies
Microsoft Data Access Technologies
 
Java on Windows Azure
Java on Windows AzureJava on Windows Azure
Java on Windows Azure
 
Data Lake and the rise of the microservices
Data Lake and the rise of the microservicesData Lake and the rise of the microservices
Data Lake and the rise of the microservices
 
contentDM
contentDMcontentDM
contentDM
 
Impact of Restful Web Architecture on Performance and Scalability
Impact of Restful Web Architecture on Performance and ScalabilityImpact of Restful Web Architecture on Performance and Scalability
Impact of Restful Web Architecture on Performance and Scalability
 
Monitoring MySQL at scale
Monitoring MySQL at scaleMonitoring MySQL at scale
Monitoring MySQL at scale
 
Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Reactive Fast Data & the Data Lake with Akka, Kafka, SparkReactive Fast Data & the Data Lake with Akka, Kafka, Spark
Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications
 

Viewers also liked

Siddhi: A Second Look at Complex Event Processing Implementations
Siddhi: A Second Look at Complex Event Processing ImplementationsSiddhi: A Second Look at Complex Event Processing Implementations
Siddhi: A Second Look at Complex Event Processing ImplementationsSrinath Perera
 
Distributed web based systems
Distributed web based systemsDistributed web based systems
Distributed web based systemsReza Gh
 
Complex Event Processing (CEP) for Next-Generation Security Event Management,...
Complex Event Processing (CEP) for Next-Generation Security Event Management,...Complex Event Processing (CEP) for Next-Generation Security Event Management,...
Complex Event Processing (CEP) for Next-Generation Security Event Management,...Tim Bass
 
Complex Event Processing: What?, Why?, How?
Complex Event Processing: What?, Why?, How?Complex Event Processing: What?, Why?, How?
Complex Event Processing: What?, Why?, How?Alexandre Vasseur
 
Complex Event Processing - A brief overview
Complex Event Processing - A brief overviewComplex Event Processing - A brief overview
Complex Event Processing - A brief overviewIstván Dávid
 
Design Strategies for a Distributed Web
Design Strategies for a Distributed WebDesign Strategies for a Distributed Web
Design Strategies for a Distributed WebGareth Rushgrove
 
Data to Insight in a Flash: Introduction to Real-Time Analytics with WSO2 Com...
Data to Insight in a Flash: Introduction to Real-Time Analytics with WSO2 Com...Data to Insight in a Flash: Introduction to Real-Time Analytics with WSO2 Com...
Data to Insight in a Flash: Introduction to Real-Time Analytics with WSO2 Com...WSO2
 
Resource-Oriented Architecture (ROA) and REST
Resource-Oriented Architecture (ROA) and RESTResource-Oriented Architecture (ROA) and REST
Resource-Oriented Architecture (ROA) and RESTIASA
 
C*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
C*ollege Credit: CEP Distribtued Processing on Cassandra with StormC*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
C*ollege Credit: CEP Distribtued Processing on Cassandra with StormDataStax
 
Introducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event ProcessorIntroducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event ProcessorWSO2
 
Eagle from eBay at China Hadoop Summit 2015
Eagle from eBay at China Hadoop Summit 2015Eagle from eBay at China Hadoop Summit 2015
Eagle from eBay at China Hadoop Summit 2015Hao Chen
 
The Future of Real-Time in Spark
The Future of Real-Time in SparkThe Future of Real-Time in Spark
The Future of Real-Time in SparkDatabricks
 
Analyzing a Soccer Game with WSO2 CEP
Analyzing a Soccer Game with WSO2 CEPAnalyzing a Soccer Game with WSO2 CEP
Analyzing a Soccer Game with WSO2 CEPSrinath Perera
 
Spark Summit San Francisco 2016 - Ali Ghodsi Keynote
Spark Summit San Francisco 2016 - Ali Ghodsi KeynoteSpark Summit San Francisco 2016 - Ali Ghodsi Keynote
Spark Summit San Francisco 2016 - Ali Ghodsi KeynoteDatabricks
 
Introduction to Big Data Analytics: Batch, Real-Time, and the Best of Both Wo...
Introduction to Big Data Analytics: Batch, Real-Time, and the Best of Both Wo...Introduction to Big Data Analytics: Batch, Real-Time, and the Best of Both Wo...
Introduction to Big Data Analytics: Batch, Real-Time, and the Best of Both Wo...WSO2
 
Extending Spark Streaming to Support Complex Event Processing
Extending Spark Streaming to Support Complex Event ProcessingExtending Spark Streaming to Support Complex Event Processing
Extending Spark Streaming to Support Complex Event ProcessingOh Chan Kwon
 
Rob peglar introduction_analytics _big data_hadoop
Rob peglar introduction_analytics _big data_hadoopRob peglar introduction_analytics _big data_hadoop
Rob peglar introduction_analytics _big data_hadoopGhassan Al-Yafie
 
Slide openMAINT English
Slide openMAINT EnglishSlide openMAINT English
Slide openMAINT Englishopenmaint
 
Big Data Analytics and its Application in E-Commerce
Big Data Analytics and its Application in E-CommerceBig Data Analytics and its Application in E-Commerce
Big Data Analytics and its Application in E-CommerceUyoyo Edosio
 
Hadoop Eagle - Real Time Monitoring Framework for eBay Hadoop
Hadoop Eagle - Real Time Monitoring Framework for eBay HadoopHadoop Eagle - Real Time Monitoring Framework for eBay Hadoop
Hadoop Eagle - Real Time Monitoring Framework for eBay HadoopDataWorks Summit
 

Viewers also liked (20)

Siddhi: A Second Look at Complex Event Processing Implementations
Siddhi: A Second Look at Complex Event Processing ImplementationsSiddhi: A Second Look at Complex Event Processing Implementations
Siddhi: A Second Look at Complex Event Processing Implementations
 
Distributed web based systems
Distributed web based systemsDistributed web based systems
Distributed web based systems
 
Complex Event Processing (CEP) for Next-Generation Security Event Management,...
Complex Event Processing (CEP) for Next-Generation Security Event Management,...Complex Event Processing (CEP) for Next-Generation Security Event Management,...
Complex Event Processing (CEP) for Next-Generation Security Event Management,...
 
Complex Event Processing: What?, Why?, How?
Complex Event Processing: What?, Why?, How?Complex Event Processing: What?, Why?, How?
Complex Event Processing: What?, Why?, How?
 
Complex Event Processing - A brief overview
Complex Event Processing - A brief overviewComplex Event Processing - A brief overview
Complex Event Processing - A brief overview
 
Design Strategies for a Distributed Web
Design Strategies for a Distributed WebDesign Strategies for a Distributed Web
Design Strategies for a Distributed Web
 
Data to Insight in a Flash: Introduction to Real-Time Analytics with WSO2 Com...
Data to Insight in a Flash: Introduction to Real-Time Analytics with WSO2 Com...Data to Insight in a Flash: Introduction to Real-Time Analytics with WSO2 Com...
Data to Insight in a Flash: Introduction to Real-Time Analytics with WSO2 Com...
 
Resource-Oriented Architecture (ROA) and REST
Resource-Oriented Architecture (ROA) and RESTResource-Oriented Architecture (ROA) and REST
Resource-Oriented Architecture (ROA) and REST
 
C*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
C*ollege Credit: CEP Distribtued Processing on Cassandra with StormC*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
C*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
 
Introducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event ProcessorIntroducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event Processor
 
Eagle from eBay at China Hadoop Summit 2015
Eagle from eBay at China Hadoop Summit 2015Eagle from eBay at China Hadoop Summit 2015
Eagle from eBay at China Hadoop Summit 2015
 
The Future of Real-Time in Spark
The Future of Real-Time in SparkThe Future of Real-Time in Spark
The Future of Real-Time in Spark
 
Analyzing a Soccer Game with WSO2 CEP
Analyzing a Soccer Game with WSO2 CEPAnalyzing a Soccer Game with WSO2 CEP
Analyzing a Soccer Game with WSO2 CEP
 
Spark Summit San Francisco 2016 - Ali Ghodsi Keynote
Spark Summit San Francisco 2016 - Ali Ghodsi KeynoteSpark Summit San Francisco 2016 - Ali Ghodsi Keynote
Spark Summit San Francisco 2016 - Ali Ghodsi Keynote
 
Introduction to Big Data Analytics: Batch, Real-Time, and the Best of Both Wo...
Introduction to Big Data Analytics: Batch, Real-Time, and the Best of Both Wo...Introduction to Big Data Analytics: Batch, Real-Time, and the Best of Both Wo...
Introduction to Big Data Analytics: Batch, Real-Time, and the Best of Both Wo...
 
Extending Spark Streaming to Support Complex Event Processing
Extending Spark Streaming to Support Complex Event ProcessingExtending Spark Streaming to Support Complex Event Processing
Extending Spark Streaming to Support Complex Event Processing
 
Rob peglar introduction_analytics _big data_hadoop
Rob peglar introduction_analytics _big data_hadoopRob peglar introduction_analytics _big data_hadoop
Rob peglar introduction_analytics _big data_hadoop
 
Slide openMAINT English
Slide openMAINT EnglishSlide openMAINT English
Slide openMAINT English
 
Big Data Analytics and its Application in E-Commerce
Big Data Analytics and its Application in E-CommerceBig Data Analytics and its Application in E-Commerce
Big Data Analytics and its Application in E-Commerce
 
Hadoop Eagle - Real Time Monitoring Framework for eBay Hadoop
Hadoop Eagle - Real Time Monitoring Framework for eBay HadoopHadoop Eagle - Real Time Monitoring Framework for eBay Hadoop
Hadoop Eagle - Real Time Monitoring Framework for eBay Hadoop
 

Similar to Developing Distributed Web Applications, Where does REST fit in?

Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web DevelopmentRobert J. Stein
 
The RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleEmiliano Pecis
 
REST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and LiesREST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and LiesPaul Fremantle
 
Building RESTful Applications with OData
Building RESTful Applications with ODataBuilding RESTful Applications with OData
Building RESTful Applications with ODataTodd Anglin
 
Creating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew TurlandCreating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew TurlandMatthew Turland
 
iPhone Web Development and Ruby On Rails
iPhone Web Development and Ruby On RailsiPhone Web Development and Ruby On Rails
iPhone Web Development and Ruby On RailsJose de Leon
 
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Pete Morano
 
Innovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsInnovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsSteve Speicher
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arpGary Pedretti
 
The Evolving Security Environment For Web Services
The Evolving Security Environment For Web ServicesThe Evolving Security Environment For Web Services
The Evolving Security Environment For Web ServicesQanita Ahmad
 
Approaches to mobile site development
Approaches to mobile site developmentApproaches to mobile site development
Approaches to mobile site developmentErik Mitchell
 

Similar to Developing Distributed Web Applications, Where does REST fit in? (20)

Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web Development
 
The RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with Oracle
 
Rest ful security
Rest ful securityRest ful security
Rest ful security
 
Unit 2
Unit 2Unit 2
Unit 2
 
Modified REST Presentation
Modified REST PresentationModified REST Presentation
Modified REST Presentation
 
REST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and LiesREST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and Lies
 
Building RESTful Applications with OData
Building RESTful Applications with ODataBuilding RESTful Applications with OData
Building RESTful Applications with OData
 
REST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnapREST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnap
 
WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
 
Unerstanding and Using RESTful APIs
Unerstanding and Using RESTful APIsUnerstanding and Using RESTful APIs
Unerstanding and Using RESTful APIs
 
Creating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew TurlandCreating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew Turland
 
iPhone Web Development and Ruby On Rails
iPhone Web Development and Ruby On RailsiPhone Web Development and Ruby On Rails
iPhone Web Development and Ruby On Rails
 
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
 
Innovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsInnovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC Integrations
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arp
 
The Evolving Security Environment For Web Services
The Evolving Security Environment For Web ServicesThe Evolving Security Environment For Web Services
The Evolving Security Environment For Web Services
 
Introduction To REST
Introduction To RESTIntroduction To REST
Introduction To REST
 
The Social Data Web
The Social Data WebThe Social Data Web
The Social Data Web
 
Gt ea2009
Gt ea2009Gt ea2009
Gt ea2009
 
Approaches to mobile site development
Approaches to mobile site developmentApproaches to mobile site development
Approaches to mobile site development
 

More from Srinath Perera

Book: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingBook: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingSrinath Perera
 
Data science Applications in the Enterprise
Data science Applications in the EnterpriseData science Applications in the Enterprise
Data science Applications in the EnterpriseSrinath Perera
 
An Introduction to APIs
An Introduction to APIs An Introduction to APIs
An Introduction to APIs Srinath Perera
 
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 ProfessionalsSrinath Perera
 
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?Srinath Perera
 
Healthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesHealthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesSrinath Perera
 
How would AI shape Future Integrations?
How would AI shape Future Integrations?How would AI shape Future Integrations?
How would AI shape Future Integrations?Srinath Perera
 
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 IntegrationsSrinath Perera
 
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? Srinath Perera
 
Few thoughts about Future of Blockchain
Few thoughts about Future of BlockchainFew thoughts about Future of Blockchain
Few thoughts about Future of BlockchainSrinath Perera
 
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 TechnologiesSrinath Perera
 
Privacy in Bigdata Era
Privacy in Bigdata  EraPrivacy in Bigdata  Era
Privacy in Bigdata EraSrinath Perera
 
Blockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksBlockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksSrinath Perera
 
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 LandscapeSrinath Perera
 
An Emerging Technologies Timeline
An Emerging Technologies TimelineAn Emerging Technologies Timeline
An Emerging Technologies TimelineSrinath Perera
 
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 ApplicationsSrinath Perera
 
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 UglySrinath Perera
 
Transforming a Business Through Analytics
Transforming a Business Through AnalyticsTransforming a Business Through Analytics
Transforming a Business Through AnalyticsSrinath Perera
 
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 TechnologySrinath 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
 

Recently uploaded

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

Developing Distributed Web Applications, Where does REST fit in?

  • 1. Developing Distributed Web Applications, Where does REST fit in? Dr. Srinath Perera Senior Software Architect, WSO2 Inc. Visiting Faculty, University of Moratuwa
  • 2. What is a Distributed Web Application? Users access a one server (or he thinks he does) while really the app is composed of many machines. Why “Distributed”? for scaling. Single machine can not handle the load High availability photo by arvindgrover on Flickr, http://www.fotopedia.com/items/flickr-3154212659
  • 3. Google as a Distributed Web Application Google crawls the Web and stores all (well most of ) the Web It builds indexes for included words and incoming links for each document When a user sends a query, it applies the Page Rank Algorithm and returns the most relevant results. It is a distributed application that built using few 100k servers
  • 4. Programming Distributed Web Applications Essentially (Web) applications deal with state (data) and operations (executions or processing units) Users talk to applications and either retrieve data or make changes to the current state. There are two primary architectural models SOA (Service Oriented Architectures) : based on processing units (verbs) ROA (Resource Oriented Architecture): based on data(nouns) photo by QolePejorian on Flickr, http://www.fotopedia.com/items/flickr-184160623
  • 5. SOA (Service Oriented Architecture) There are many stateless processing units (often grouped as services) Users provide data to processing units, and they either return data after processing or change the system wide state (e.g. stored in the database). A SOA based architecture includes a main storage (e.g. database) and many stateless processing units, and an application combines and composes those processing units together. E.g. Google has its indexes etc., and one main operation “search” that accepts a search query as a input and returns matching documents. Also implementation has many internal services photo by L. Marie on Flickr, http://www.flickr.com/photos/lenore-m/312319615/
  • 6. ROA (Resource Oriented Architecture) There is a resource structure Each resource supports four operations, PUT, GET, POST, DELETE Users retrieve information through GET and change system state through POST, DELETE, and PUT The architecture is based on resources (nouns) and processing is represented through four verbs on the resource. photo by Svadilfari on Flickr, http://www.flickr.com/photos/22280677@N07/2435832518/ (CC)
  • 7. ROA vs. SOA There are lots of fights, which I am not going to discuss in detail. Argument is Web uses ROA, and it works. SOA is much closer to the programing models we used to with languages like C or Java. So that is natural to us. I would say, they are two useful styles, and we have to know both and use them where it naturally fits. I will focus more on ROA for this discussion. photo by hans s on Flickr, http://www.flickr.com/photos/archeon/2359334908/
  • 8. REST (Representational State Transfer) ROA is realized with REST services or HTTP services (Good intro to REST, http://www.infoq.com/articles/rest-introduction) Main principles of REST Give everything an ID (URI) Things (resources) refer to each other All interactions are done through four verbs (PUT, GET, DELETE, POST) on resources Photo by paraflyer on Flickr, http://www.fotopedia.com/items/flickr-386529128 Resources can return multiple formats (choosed based on content negotiation) All communication are stateless (each request has all the information need to serve the request)
  • 9. Example: Web App to Manage a Network Assume we want to build a Web app to manage networks. Users can view, query, and change the network configurations through this Web App. Lets see how this would look with both SOA and REST Photo by sylviaduckworth on Flickr, http://www.geograph.org.uk/photo/956353
  • 10. With SOA Architecture will include a database to hold network data and services supporting following operations ListNetworks() NetworkDataGetNetworkData() ApplyNetworkData(NetworkDataquearyParams) SearchNetworks(String queryParams) Notice Each operation is a Verb, users combine those verbs to do what he needs Message formats are defined through a WSDL and each service supports one message format.
  • 11. With REST Give everything a ID (URI) http://uom.lk/Networks http://uom.lk/Networks/ENT http://uom.lk/Networks/Civil Things (resources) refer to each other Retrieving a network will return something like <Networks> <cse ref=“http://uom.lk/Networks/CSE”/> …. </Networks> All interactions are done through four verbs (PUT, GET, DELETE, POST) on resources GET on http://uom.lk/Networks/CSE : Getting network data POST on http://uom.lk/Networks/CSE: update the network config. DELETE on http://uom.lk/Networks/CSE can delete the network etc.
  • 12. With REST (Contd.) Resources can return multiple formats Results can return multiple formats, XML, Jason, Binary or several XML formats etc. Clients send the header Accept: text/json, text/xml+foo defining supported formats, and the server returns result in a format client supports. This means a resource can support multiple formats at the same time. Also we can use this to support new formats later. All communication is stateless – this is same for SOA and ROA System can use HTTP style caching
  • 13. Implementing REST Services Define the resources structure Define many URLs for different types of resources Use a REST engine to attach code to each URL patterns, they support four verbs (e.g. see http://www.sinatrarb.com/intro) Code segment is for URL, verb, content type Example http://…/Networks: On GET text/xml do …. end Photo by Kevin Dooley on Flickr, http://www.flickr.com/photos/pagedooley/2201791390/
  • 14. REST Anti-patterns Verbs in URLs http://uom.lk/SearchNetworks?pattern=foo This is doing SOA using HTTP, not REST Ignoring status codes on responses Not including references in responses <Networks> <cse> <nodeCount>..</nodeCount> <subnetmask> ..</subnetmask> <cse> </Networks> Use references whenever that makes sense, do not copy data in to response. Remember the underline linked resource structure.
  • 15. REST, is it the Architecture to solve them all? Does the REST a silver bullet for all problems This is the source for most fights, the answer looks “No”. Some examples. It does not have a contract (Lack a WSDL) Messaging – does not talk about eventing/ messaging aspects. May be need a SUBSCRIBE verb added. Asynchronous invocations and reliability What about composition and transactions etc. mostly things come from WS-* Does error messages are enough? Photo by Playaduraon Flickr, http://www.flickr.com/photos/playadura/1401756881
  • 16. So when to use it? Use when REST is the natural choice It is very good at representing resources Not that good with processes/ executions Same for SOA Is it OK to mix it? I would say yes, but not too much WSO2 use REST for registry API, while SOA for many other places. Photo by QUEEN YUNA on Flickr, http://www.flickr.com/photos/queenyuna/5710802864/ (CC)
  • 17. Conclusion What is a Distributed Application? SOA and ROA as solutions Detailed looked at ROA with a Example It is the architecture that solves everything? “Look like we need both”
  • 18. For more information Stefan Tilkov: A Brief Introduction to REST, http://www.infoq.com/articles/rest-introduction Stefan Tilkov: REST Anti-Patterns, http://www.infoq.com/articles/rest-anti-patterns More articles here http://en.wikipedia.org/wiki/Representational_State_Transfer SanjivaWeerawarana: WS-* vs. REST: Mashing up the Truth from Facts, Myths and Lies, http://wso2.org/library/2818