SlideShare a Scribd company logo
1 of 35
Download to read offline
Web application architecure:
overview of techniques
Ruslan Shevchenko. <ruslan@shevchenko.kiev.ua>!
GoSave, Inc: http://www.gosave.com!
Themes
❖ What are current architecture patterns, which !
❖ can be used!
❖ can be reused ( in other languages or frameworks
other than origin)!
!
❖ Client/Service interaction. !
❖ Reactivity
What is in mainstream now ?
❖ Sinatra-like frameworks!
❖ Server:!
❖ REST !
❖ Client: MVC!
❖ yesterday: backbone!
❖ today: angular!
❖ tomorrow: react.js + something
shiny
• http://shiny.rstudio.com/!
• live example: http://shiny.rstudio.com/gallery/telephones-by-region.html!
• R language!
• X LOC : server!
• Y LOC: UI
shiny
• http://shiny.rstudio.com/!
• live example: http://shiny.rstudio.com/gallery/telephones-by-region.html!
• R language!
• 8 LOC : server!
• 12 LOC: UI
shiny: UI.R
library(shiny)
library(datasets)
!
shinyUI(
fluidPage(
titlePanel("Telephones by region"),
sidebarLayout(
sidebarPanel(
selectInput("region", "Region:",
choices=colnames(WorldPhones)),
hr(),
helpText("Data from AT&T (1961) The World's Telephones.")
),
mainPanel(
plotOutput("phonePlot")
)
)
))
shiny: Server.R
library(shiny)
!
# Rely on the 'WorldPhones' dataset in the datasets
# package (which generally comes preloaded).
library(datasets)
!
shinyServer(function(input, output) {
output$phonePlot <- renderPlot({
barplot(WorldPhones[,input$region]*1000,
main=input$region,
ylab="Number of Telephones",
xlab="Year")
})
})
Shiny: notes
❖ DSL for HTML!
❖ Reactive!
❖ Websocket transport instead request/reply (?)
Shiny: notes
❖ DSL for HTML!
❖ Reactive!
❖ Websocket transport instead request/reply
❖ Predefined UI skin (twitter bootstrap)!
❖ Narrow applicability
Conway law
Organizations which design systems ... are constrained to produce designs which
are copies of the communication structures of these organizations ……!
(Conway, 1968)!
Organization communication !
structure
Software structure
Shiny <=> existence of data analysis department
max. enterprise: Java
❖ dropwizard: https://dropwizard.github.io/dropwizard/!
❖ spring: http://www.spring.io!
❖ J2EE %-)
(Server-centric)!
max. enterprise: java
Relative good and applicable:
@Path(“/users”)	
@GET	
@Produces({MediaType.APPLICATION_JSON})	
@ApiOperation(nickname = "getUsers", 	
value = "get list of users", 	
httpMethod = "GET", 	
response = UsersSortDTO.class, 	
responseContainer = “List")	
public List<UserDTO> list(@ApiParam SelectorDTO selector) {	
CriteriaQuery<UserDTO> = …	
……….	
return q.getResultList();	
}
max. enterprise: java
Relative good and applicable:
❖ Jersey: https://jersey.java.net/!
❖ request bind to method.!
❖ routing is set via annotations.!
❖ Jackson: https://github.com/FasterXML/jackson!
❖ annotation-based json serializer with good defaults!
❖ Swagger: https://helloreverb.com/developers/swagger
Client/Server API issues.
REST - is not fit for all
What we do with operations, other than CRUD over resources ?
❖ RPC on some language on top of javascript [?]!
❖ adopt IDL protocol [?]!
❖ fix REST [?]
Ideal solution yet not exists….
Client/Server API: One Language
• Javascript (node.js) !
• ClojureScript/ Clojure: http://clojure.org/!
• Kotlin: http://kotlin-web-site.jetbrains.org/ !
• Scala (!
• scala.js [http://www.scala-js.org/], !
• jscala [ https://github.com/nau/jscala ] !
• R !
• etc …
Many implementations
❖ Conway law, !
❖ Not one ‘ideal’ language for all
Client/Server API: IDL
IDL == Interface Definition Language
struct ProfileInfo!
{!
1: required string uid;!
2: optional string firstName;!
3: optional string middleName;!
4: optional string lastName;!
5: optional string email;!
6: optional string phone;!
7: optional string addrPostal;!
}!
!
service SelfCare!
{!
ProfileInfo getProfileInfo(required string authToken)!
throws(OperationException)!
…………
Implementations:!
thrift: http://thrift.apache.org/!
RSDL, WADL (xml-based)
Client/Server: Fix REST
REST without PUT
RPC call = create event (i.e. POST /event )!
seqence of events instead PUT
CQRS = Command Query Responsibility
Events State
Query
rdonly
Client/Server: Streaming
Example: sparkle. https://github.com/mighdoll/sparkle
Visualization of data stream, !
coming from server via websocket transport
Server (scala)
Client (javascript)
Server -> Client : Data Stream, !
(reply to control messages)!
!
Client -> Server: Control messages!
(subscribe/unsubscribe/transform)
Reactivity: client.
Shiny: one circuit with client and server.
More common: client-only reactive interactions, !
REST/RPC with server
❖ Angular.js [2/way binding]!
❖ React.js [1/way binding] !
❖ (model => view)!
❖ OM: https://github.com/swannodette/om!
❖ RFP!
❖ backon.js [ http://baconjs.github.io/], RxJs!
❖ ELM (language) http://elm-lang.org!
Reactivity: client: Om
https://github.com/swannodette/om
Clojure!
!
!
Application state = Tree, bound to clojure atom!
!
UI component state = path inside application state!
!
Use React.js for updating UI from change in application state!
Reactivity: server
Reactivity on server - more about C10K !
• http://www.reactivemanifesto.org/!
• http://en.wikipedia.org/wiki/C10k_problem
No blocking ….!
event oriented …
Unreactive pseudocode: 1
def listUsers(r: Request): RequestResult =
listForm.bind(request){
!
success(form) => Ok (ToJson(
users.filter(_.name contains form.q).
page(form.offset,form.limit)
) ),
!
failure(f,message, ex) => Error(403, message)
!
}
Unreactive pseudocode: 1
def listUsers(r: Request): RequestResult =
listForm.bind(request){
!
success(form) => Ok (ToJson(
users.filter(_.name contains form.q).
page(form.offset,form.limit)
) ),
!
failure(f,message, ex) => Error(403, message)
!
}
SQL
Nonreactive: 1
Application ServerClient Database
Nonreactive: 1 / overload
Application ServerClient Database
Reactive code: 2
def listUsers = Action { request =>
listForm.bind(request){
!
success(form) => Ok (ToJson(
users.filter(_.name contains form.q).
page(form.offset,form.limit)
) ),
!
failure(f,message, ex) => Error(403, message)
!
}
latest Play:
Reactive code: 2
def listUsers = Action { request =>
listForm.bind(request){
!
success(form) => Ok (ToJson(
users.filter(_.name contains form.q).
page(form.offset,form.limit)
) ),
!
failure(f,message, ex) => Error(403, message)
!
}
callback
latest Play:
Non-reactive: 1 / overload
Application ServerClient Database
Reactive: 2 / overload
Application ServerClient Database
Reactive pseudocode: 3
def listUsers = Action { request =>
listForm.bind(request){
!
success(form) => Ok (
db.query(
users.filter(_.name contains form.q).
page(form.offset,form.limit)
) map ( x => ToJson(x) )
),
!
failure(f,message, ex) => Error(403, message)
!
}
Imagine, we have reactive db driver:
callback
callback
Reactive: 3 / overload
Application ServerClient Database
Server: reactivity
• 2 callbacks instead sequential code!
• (welcome to callback hell ?)!
• functional programming is really needed!
• Infrastructure is not mature yet.!
• reactive-mongo, reactive-postgres,!
• but we have no reactivity suport in jdbc!
Server: reactivity
Other computation models:!
• Actors [Erlang, Scala Akka]!
• Channels [Go, Closure core.async]!
• Language reactive extensions!
• [RxNet, RxJava, RxScala]
Web architecture: overview of techniques
❖ Can’t say that we have some ‘Canonical ideal architecture’.!
❖ Non-ideal techniques are still interesting.!
❖ Invention/Reinvention cycle => !
❖ Hope we will see something new!
❖ Take care
Web architecture: overview of techniques
Thanks for attention.!
!
Ruslan Shevchenko, <ruslan@shevchenko.kiev.ua>!
https://github.com/rssh!
@rssh1!
//this talk was bought to you by GoSave: http://www.gosave.com ;)!

More Related Content

What's hot

Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web ServicesAngelin R
 
internet programming and java notes 5th sem mca
internet programming and java notes 5th sem mcainternet programming and java notes 5th sem mca
internet programming and java notes 5th sem mcaRenu Thakur
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTPradeep Kumar
 
Introductiontowebarchitecture 090922221506-phpapp01
Introductiontowebarchitecture 090922221506-phpapp01Introductiontowebarchitecture 090922221506-phpapp01
Introductiontowebarchitecture 090922221506-phpapp01Maisha Price
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service DesignLorna Mitchell
 
The Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTThe Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTBruno Kessler Foundation
 
Dynamic content generation
Dynamic content generationDynamic content generation
Dynamic content generationEleonora Ciceri
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
Web forms and server side scripting
Web forms and server side scriptingWeb forms and server side scripting
Web forms and server side scriptingsawsan slii
 
The road to professional web development
The road to professional web developmentThe road to professional web development
The road to professional web developmentChristian Heilmann
 
Rest presentation
Rest  presentationRest  presentation
Rest presentationsrividhyau
 
World wide web architecture presentation
World wide web architecture presentationWorld wide web architecture presentation
World wide web architecture presentationImMe Khan
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsIdo Flatow
 
How the Web Works Using HTML
How the Web Works Using HTMLHow the Web Works Using HTML
How the Web Works Using HTMLMarlon Jamera
 

What's hot (20)

Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
HTML5 - An introduction
HTML5 - An introductionHTML5 - An introduction
HTML5 - An introduction
 
AJAX - An introduction
AJAX - An introductionAJAX - An introduction
AJAX - An introduction
 
internet programming and java notes 5th sem mca
internet programming and java notes 5th sem mcainternet programming and java notes 5th sem mca
internet programming and java notes 5th sem mca
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
 
Intro to Dynamic Web Pages
Intro to Dynamic Web PagesIntro to Dynamic Web Pages
Intro to Dynamic Web Pages
 
Introductiontowebarchitecture 090922221506-phpapp01
Introductiontowebarchitecture 090922221506-phpapp01Introductiontowebarchitecture 090922221506-phpapp01
Introductiontowebarchitecture 090922221506-phpapp01
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service Design
 
The Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTThe Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReST
 
Dynamic content generation
Dynamic content generationDynamic content generation
Dynamic content generation
 
Web browsers and web document
Web browsers and web documentWeb browsers and web document
Web browsers and web document
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Web forms and server side scripting
Web forms and server side scriptingWeb forms and server side scripting
Web forms and server side scripting
 
The road to professional web development
The road to professional web developmentThe road to professional web development
The road to professional web development
 
Rest presentation
Rest  presentationRest  presentation
Rest presentation
 
World wide web architecture presentation
World wide web architecture presentationWorld wide web architecture presentation
World wide web architecture presentation
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
 
Static web documents
Static web documents Static web documents
Static web documents
 
How the Web Works Using HTML
How the Web Works Using HTMLHow the Web Works Using HTML
How the Web Works Using HTML
 

Viewers also liked

Snakes on the Web; Developing web applications in python
Snakes on the Web; Developing web applications in pythonSnakes on the Web; Developing web applications in python
Snakes on the Web; Developing web applications in pythonNaail AbdulRahman
 
Inpac Dev Co V011809 V2
Inpac Dev Co V011809 V2Inpac Dev Co V011809 V2
Inpac Dev Co V011809 V2Paul Allen
 
1-01: Introduction To Web Development
1-01: Introduction To  Web  Development1-01: Introduction To  Web  Development
1-01: Introduction To Web Developmentapnwebdev
 
HRMPS 13 (MIDTERM)Chapter 5 Managed services
HRMPS 13 (MIDTERM)Chapter 5   Managed servicesHRMPS 13 (MIDTERM)Chapter 5   Managed services
HRMPS 13 (MIDTERM)Chapter 5 Managed servicesBean Malicse
 
Web Application Introduction
Web Application  IntroductionWeb Application  Introduction
Web Application Introductionshaojung
 
Shiny r, live shared and explored
Shiny   r, live shared and exploredShiny   r, live shared and explored
Shiny r, live shared and exploredAlex Brown
 
01 04 - android set up and creating an android project
01  04 - android set up and creating an android project01  04 - android set up and creating an android project
01 04 - android set up and creating an android projectSiva Kumar reddy Vasipally
 
Introduction to Basic Concepts in Web
Introduction to Basic Concepts in WebIntroduction to Basic Concepts in Web
Introduction to Basic Concepts in WebJussi Pohjolainen
 
Web Application Introduction
Web Application  IntroductionWeb Application  Introduction
Web Application Introductionshaojung
 
Spring 4.x Web Application 살펴보기
Spring 4.x Web Application  살펴보기Spring 4.x Web Application  살펴보기
Spring 4.x Web Application 살펴보기Ji Heon Kim
 
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSEWEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSEAjith Kp
 
Introduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting StartedIntroduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting StartedAhsanul Karim
 
Web 2.0 At Work - Simple And Social Collaboration Between Coworkers
Web 2.0 At Work - Simple And Social Collaboration Between CoworkersWeb 2.0 At Work - Simple And Social Collaboration Between Coworkers
Web 2.0 At Work - Simple And Social Collaboration Between CoworkersAcando Consulting
 
Web Development Ppt
Web Development PptWeb Development Ppt
Web Development PptBruce Tucker
 
Web Application Development Fundamentals
Web Application Development FundamentalsWeb Application Development Fundamentals
Web Application Development FundamentalsMohammed Makhlouf
 

Viewers also liked (20)

Ttay8 Ppt 01
Ttay8 Ppt 01Ttay8 Ppt 01
Ttay8 Ppt 01
 
Snakes on the Web; Developing web applications in python
Snakes on the Web; Developing web applications in pythonSnakes on the Web; Developing web applications in python
Snakes on the Web; Developing web applications in python
 
Web Standards
Web StandardsWeb Standards
Web Standards
 
Overview Of Web 2.0
Overview Of Web 2.0Overview Of Web 2.0
Overview Of Web 2.0
 
W3 c validation
W3 c validationW3 c validation
W3 c validation
 
Inpac Dev Co V011809 V2
Inpac Dev Co V011809 V2Inpac Dev Co V011809 V2
Inpac Dev Co V011809 V2
 
1-01: Introduction To Web Development
1-01: Introduction To  Web  Development1-01: Introduction To  Web  Development
1-01: Introduction To Web Development
 
HRMPS 13 (MIDTERM)Chapter 5 Managed services
HRMPS 13 (MIDTERM)Chapter 5   Managed servicesHRMPS 13 (MIDTERM)Chapter 5   Managed services
HRMPS 13 (MIDTERM)Chapter 5 Managed services
 
Web App Infrastructure
Web App InfrastructureWeb App Infrastructure
Web App Infrastructure
 
Web Application Introduction
Web Application  IntroductionWeb Application  Introduction
Web Application Introduction
 
Shiny r, live shared and explored
Shiny   r, live shared and exploredShiny   r, live shared and explored
Shiny r, live shared and explored
 
01 04 - android set up and creating an android project
01  04 - android set up and creating an android project01  04 - android set up and creating an android project
01 04 - android set up and creating an android project
 
Introduction to Basic Concepts in Web
Introduction to Basic Concepts in WebIntroduction to Basic Concepts in Web
Introduction to Basic Concepts in Web
 
Web Application Introduction
Web Application  IntroductionWeb Application  Introduction
Web Application Introduction
 
Spring 4.x Web Application 살펴보기
Spring 4.x Web Application  살펴보기Spring 4.x Web Application  살펴보기
Spring 4.x Web Application 살펴보기
 
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSEWEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
 
Introduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting StartedIntroduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting Started
 
Web 2.0 At Work - Simple And Social Collaboration Between Coworkers
Web 2.0 At Work - Simple And Social Collaboration Between CoworkersWeb 2.0 At Work - Simple And Social Collaboration Between Coworkers
Web 2.0 At Work - Simple And Social Collaboration Between Coworkers
 
Web Development Ppt
Web Development PptWeb Development Ppt
Web Development Ppt
 
Web Application Development Fundamentals
Web Application Development FundamentalsWeb Application Development Fundamentals
Web Application Development Fundamentals
 

Similar to Web architecture - overview of techniques.

WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...
WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...
WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...GeeksLab Odessa
 
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav TulachJDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav TulachPROIDEA
 
Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)Ran Mizrahi
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Ran Mizrahi
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scalascalaconfjp
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Pierre Joye
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaKazuhiro Sera
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfAlfresco Software
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfAlfresco Software
 
Web Frameworks of the Future
Web Frameworks of the FutureWeb Frameworks of the Future
Web Frameworks of the Futureelliando dias
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfAlfresco Software
 
How and When to Use FalcorJS
How and When to Use FalcorJSHow and When to Use FalcorJS
How and When to Use FalcorJSWiredcraft
 
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...chbornet
 
PHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLitePHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLiteJEAN-GUILLAUME DUJARDIN
 

Similar to Web architecture - overview of techniques. (20)

WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...
WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...
WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...
 
About Clack
About ClackAbout Clack
About Clack
 
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav TulachJDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
 
Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scala
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in Scala
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
 
Web Frameworks of the Future
Web Frameworks of the FutureWeb Frameworks of the Future
Web Frameworks of the Future
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring Surf
 
Avatar 2.0
Avatar 2.0Avatar 2.0
Avatar 2.0
 
How and When to Use FalcorJS
How and When to Use FalcorJSHow and When to Use FalcorJS
How and When to Use FalcorJS
 
Andrei shakirin rest_cxf
Andrei shakirin rest_cxfAndrei shakirin rest_cxf
Andrei shakirin rest_cxf
 
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
 
UCLA HACKU'11
UCLA HACKU'11UCLA HACKU'11
UCLA HACKU'11
 
Rhodes
RhodesRhodes
Rhodes
 
Frontend as a first class citizen
Frontend as a first class citizenFrontend as a first class citizen
Frontend as a first class citizen
 
PHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLitePHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLite
 

More from Ruslan Shevchenko

Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]Ruslan Shevchenko
 
Papers We Love / Kyiv : PAXOS (and little about other consensuses )
Papers We Love / Kyiv :  PAXOS (and little about other consensuses )Papers We Love / Kyiv :  PAXOS (and little about other consensuses )
Papers We Love / Kyiv : PAXOS (and little about other consensuses )Ruslan Shevchenko
 
Scala / Technology evolution
Scala  / Technology evolutionScala  / Technology evolution
Scala / Technology evolutionRuslan Shevchenko
 
{co/contr} variance from LSP
{co/contr} variance  from LSP{co/contr} variance  from LSP
{co/contr} variance from LSPRuslan Shevchenko
 
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.Ruslan Shevchenko
 
SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.Ruslan Shevchenko
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scalaRuslan Shevchenko
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisRuslan Shevchenko
 
Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applicationsRuslan Shevchenko
 
Jslab rssh: JS as language platform
Jslab rssh:  JS as language platformJslab rssh:  JS as language platform
Jslab rssh: JS as language platformRuslan Shevchenko
 
Behind OOD: domain modelling in post-OO world.
Behind OOD:  domain modelling in post-OO world.Behind OOD:  domain modelling in post-OO world.
Behind OOD: domain modelling in post-OO world.Ruslan Shevchenko
 
scala-gopher: async implementation of CSP for scala
scala-gopher:  async implementation of CSP  for  scalascala-gopher:  async implementation of CSP  for  scala
scala-gopher: async implementation of CSP for scalaRuslan Shevchenko
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N yearsRuslan Shevchenko
 

More from Ruslan Shevchenko (20)

Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]
 
Svitla talks 2021_03_25
Svitla talks 2021_03_25Svitla talks 2021_03_25
Svitla talks 2021_03_25
 
Akka / Lts behavior
Akka / Lts behaviorAkka / Lts behavior
Akka / Lts behavior
 
Papers We Love / Kyiv : PAXOS (and little about other consensuses )
Papers We Love / Kyiv :  PAXOS (and little about other consensuses )Papers We Love / Kyiv :  PAXOS (and little about other consensuses )
Papers We Love / Kyiv : PAXOS (and little about other consensuses )
 
Scala / Technology evolution
Scala  / Technology evolutionScala  / Technology evolution
Scala / Technology evolution
 
{co/contr} variance from LSP
{co/contr} variance  from LSP{co/contr} variance  from LSP
{co/contr} variance from LSP
 
N flavors of streaming
N flavors of streamingN flavors of streaming
N flavors of streaming
 
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
 
SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scala
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
 
Scala jargon cheatsheet
Scala jargon cheatsheetScala jargon cheatsheet
Scala jargon cheatsheet
 
Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applications
 
Csp scala wixmeetup2016
Csp scala wixmeetup2016Csp scala wixmeetup2016
Csp scala wixmeetup2016
 
IDLs
IDLsIDLs
IDLs
 
R ext world/ useR! Kiev
R ext world/ useR!  KievR ext world/ useR!  Kiev
R ext world/ useR! Kiev
 
Jslab rssh: JS as language platform
Jslab rssh:  JS as language platformJslab rssh:  JS as language platform
Jslab rssh: JS as language platform
 
Behind OOD: domain modelling in post-OO world.
Behind OOD:  domain modelling in post-OO world.Behind OOD:  domain modelling in post-OO world.
Behind OOD: domain modelling in post-OO world.
 
scala-gopher: async implementation of CSP for scala
scala-gopher:  async implementation of CSP  for  scalascala-gopher:  async implementation of CSP  for  scala
scala-gopher: async implementation of CSP for scala
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
 

Recently uploaded

Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 
Kubernetes go-live checklist for your microservices.pptx
Kubernetes go-live checklist for your microservices.pptxKubernetes go-live checklist for your microservices.pptx
Kubernetes go-live checklist for your microservices.pptxPrakarsh -
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyRaymond Okyere-Forson
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorShane Coughlan
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionsNirav Modi
 
Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!Neo4j
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxAutus Cyber Tech
 
Mastering Kubernetes - Basics and Advanced Concepts using Example Project
Mastering Kubernetes - Basics and Advanced Concepts using Example ProjectMastering Kubernetes - Basics and Advanced Concepts using Example Project
Mastering Kubernetes - Basics and Advanced Concepts using Example Projectwajrcs
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?AmeliaSmith90
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024Mind IT Systems
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmonyelliciumsolutionspun
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...OnePlan Solutions
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesShyamsundar Das
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
About .NET 8 and a first glimpse into .NET9
About .NET 8 and a first glimpse into .NET9About .NET 8 and a first glimpse into .NET9
About .NET 8 and a first glimpse into .NET9Jürgen Gutsch
 

Recently uploaded (20)

Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 
Kubernetes go-live checklist for your microservices.pptx
Kubernetes go-live checklist for your microservices.pptxKubernetes go-live checklist for your microservices.pptx
Kubernetes go-live checklist for your microservices.pptx
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human Beauty
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS Calculator
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspections
 
Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptx
 
Mastering Kubernetes - Basics and Advanced Concepts using Example Project
Mastering Kubernetes - Basics and Advanced Concepts using Example ProjectMastering Kubernetes - Basics and Advanced Concepts using Example Project
Mastering Kubernetes - Basics and Advanced Concepts using Example Project
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security Challenges
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
About .NET 8 and a first glimpse into .NET9
About .NET 8 and a first glimpse into .NET9About .NET 8 and a first glimpse into .NET9
About .NET 8 and a first glimpse into .NET9
 

Web architecture - overview of techniques.

  • 1. Web application architecure: overview of techniques Ruslan Shevchenko. <ruslan@shevchenko.kiev.ua>! GoSave, Inc: http://www.gosave.com!
  • 2. Themes ❖ What are current architecture patterns, which ! ❖ can be used! ❖ can be reused ( in other languages or frameworks other than origin)! ! ❖ Client/Service interaction. ! ❖ Reactivity
  • 3. What is in mainstream now ? ❖ Sinatra-like frameworks! ❖ Server:! ❖ REST ! ❖ Client: MVC! ❖ yesterday: backbone! ❖ today: angular! ❖ tomorrow: react.js + something
  • 4. shiny • http://shiny.rstudio.com/! • live example: http://shiny.rstudio.com/gallery/telephones-by-region.html! • R language! • X LOC : server! • Y LOC: UI
  • 5. shiny • http://shiny.rstudio.com/! • live example: http://shiny.rstudio.com/gallery/telephones-by-region.html! • R language! • 8 LOC : server! • 12 LOC: UI
  • 6. shiny: UI.R library(shiny) library(datasets) ! shinyUI( fluidPage( titlePanel("Telephones by region"), sidebarLayout( sidebarPanel( selectInput("region", "Region:", choices=colnames(WorldPhones)), hr(), helpText("Data from AT&T (1961) The World's Telephones.") ), mainPanel( plotOutput("phonePlot") ) ) ))
  • 7. shiny: Server.R library(shiny) ! # Rely on the 'WorldPhones' dataset in the datasets # package (which generally comes preloaded). library(datasets) ! shinyServer(function(input, output) { output$phonePlot <- renderPlot({ barplot(WorldPhones[,input$region]*1000, main=input$region, ylab="Number of Telephones", xlab="Year") }) })
  • 8. Shiny: notes ❖ DSL for HTML! ❖ Reactive! ❖ Websocket transport instead request/reply (?)
  • 9. Shiny: notes ❖ DSL for HTML! ❖ Reactive! ❖ Websocket transport instead request/reply ❖ Predefined UI skin (twitter bootstrap)! ❖ Narrow applicability
  • 10. Conway law Organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations ……! (Conway, 1968)! Organization communication ! structure Software structure Shiny <=> existence of data analysis department
  • 11. max. enterprise: Java ❖ dropwizard: https://dropwizard.github.io/dropwizard/! ❖ spring: http://www.spring.io! ❖ J2EE %-) (Server-centric)!
  • 12. max. enterprise: java Relative good and applicable: @Path(“/users”) @GET @Produces({MediaType.APPLICATION_JSON}) @ApiOperation(nickname = "getUsers", value = "get list of users", httpMethod = "GET", response = UsersSortDTO.class, responseContainer = “List") public List<UserDTO> list(@ApiParam SelectorDTO selector) { CriteriaQuery<UserDTO> = … ………. return q.getResultList(); }
  • 13. max. enterprise: java Relative good and applicable: ❖ Jersey: https://jersey.java.net/! ❖ request bind to method.! ❖ routing is set via annotations.! ❖ Jackson: https://github.com/FasterXML/jackson! ❖ annotation-based json serializer with good defaults! ❖ Swagger: https://helloreverb.com/developers/swagger
  • 14. Client/Server API issues. REST - is not fit for all What we do with operations, other than CRUD over resources ? ❖ RPC on some language on top of javascript [?]! ❖ adopt IDL protocol [?]! ❖ fix REST [?] Ideal solution yet not exists….
  • 15. Client/Server API: One Language • Javascript (node.js) ! • ClojureScript/ Clojure: http://clojure.org/! • Kotlin: http://kotlin-web-site.jetbrains.org/ ! • Scala (! • scala.js [http://www.scala-js.org/], ! • jscala [ https://github.com/nau/jscala ] ! • R ! • etc … Many implementations ❖ Conway law, ! ❖ Not one ‘ideal’ language for all
  • 16. Client/Server API: IDL IDL == Interface Definition Language struct ProfileInfo! {! 1: required string uid;! 2: optional string firstName;! 3: optional string middleName;! 4: optional string lastName;! 5: optional string email;! 6: optional string phone;! 7: optional string addrPostal;! }! ! service SelfCare! {! ProfileInfo getProfileInfo(required string authToken)! throws(OperationException)! ………… Implementations:! thrift: http://thrift.apache.org/! RSDL, WADL (xml-based)
  • 17. Client/Server: Fix REST REST without PUT RPC call = create event (i.e. POST /event )! seqence of events instead PUT CQRS = Command Query Responsibility Events State Query rdonly
  • 18. Client/Server: Streaming Example: sparkle. https://github.com/mighdoll/sparkle Visualization of data stream, ! coming from server via websocket transport Server (scala) Client (javascript) Server -> Client : Data Stream, ! (reply to control messages)! ! Client -> Server: Control messages! (subscribe/unsubscribe/transform)
  • 19. Reactivity: client. Shiny: one circuit with client and server. More common: client-only reactive interactions, ! REST/RPC with server ❖ Angular.js [2/way binding]! ❖ React.js [1/way binding] ! ❖ (model => view)! ❖ OM: https://github.com/swannodette/om! ❖ RFP! ❖ backon.js [ http://baconjs.github.io/], RxJs! ❖ ELM (language) http://elm-lang.org!
  • 20. Reactivity: client: Om https://github.com/swannodette/om Clojure! ! ! Application state = Tree, bound to clojure atom! ! UI component state = path inside application state! ! Use React.js for updating UI from change in application state!
  • 21. Reactivity: server Reactivity on server - more about C10K ! • http://www.reactivemanifesto.org/! • http://en.wikipedia.org/wiki/C10k_problem No blocking ….! event oriented …
  • 22. Unreactive pseudocode: 1 def listUsers(r: Request): RequestResult = listForm.bind(request){ ! success(form) => Ok (ToJson( users.filter(_.name contains form.q). page(form.offset,form.limit) ) ), ! failure(f,message, ex) => Error(403, message) ! }
  • 23. Unreactive pseudocode: 1 def listUsers(r: Request): RequestResult = listForm.bind(request){ ! success(form) => Ok (ToJson( users.filter(_.name contains form.q). page(form.offset,form.limit) ) ), ! failure(f,message, ex) => Error(403, message) ! } SQL
  • 25. Nonreactive: 1 / overload Application ServerClient Database
  • 26. Reactive code: 2 def listUsers = Action { request => listForm.bind(request){ ! success(form) => Ok (ToJson( users.filter(_.name contains form.q). page(form.offset,form.limit) ) ), ! failure(f,message, ex) => Error(403, message) ! } latest Play:
  • 27. Reactive code: 2 def listUsers = Action { request => listForm.bind(request){ ! success(form) => Ok (ToJson( users.filter(_.name contains form.q). page(form.offset,form.limit) ) ), ! failure(f,message, ex) => Error(403, message) ! } callback latest Play:
  • 28. Non-reactive: 1 / overload Application ServerClient Database
  • 29. Reactive: 2 / overload Application ServerClient Database
  • 30. Reactive pseudocode: 3 def listUsers = Action { request => listForm.bind(request){ ! success(form) => Ok ( db.query( users.filter(_.name contains form.q). page(form.offset,form.limit) ) map ( x => ToJson(x) ) ), ! failure(f,message, ex) => Error(403, message) ! } Imagine, we have reactive db driver: callback callback
  • 31. Reactive: 3 / overload Application ServerClient Database
  • 32. Server: reactivity • 2 callbacks instead sequential code! • (welcome to callback hell ?)! • functional programming is really needed! • Infrastructure is not mature yet.! • reactive-mongo, reactive-postgres,! • but we have no reactivity suport in jdbc!
  • 33. Server: reactivity Other computation models:! • Actors [Erlang, Scala Akka]! • Channels [Go, Closure core.async]! • Language reactive extensions! • [RxNet, RxJava, RxScala]
  • 34. Web architecture: overview of techniques ❖ Can’t say that we have some ‘Canonical ideal architecture’.! ❖ Non-ideal techniques are still interesting.! ❖ Invention/Reinvention cycle => ! ❖ Hope we will see something new! ❖ Take care
  • 35. Web architecture: overview of techniques Thanks for attention.! ! Ruslan Shevchenko, <ruslan@shevchenko.kiev.ua>! https://github.com/rssh! @rssh1! //this talk was bought to you by GoSave: http://www.gosave.com ;)!