The document discusses various web application architecture techniques, including:
- Popular frameworks like Sinatra that use REST APIs and MVC patterns on the client-side.
- Reactive frameworks like Shiny that use websockets for real-time updates between the client and server.
- Challenges in building reactive applications, as infrastructure is still maturing to support callbacks without blocking.
- Other approaches to reactivity on the server including actors, channels, and reactive extensions.
- The document concludes that there is no single ideal architecture, as techniques are continually invented and re-invented over time.
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
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
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
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!
21. Reactivity: server
Reactivity on server - more about C10K !
• http://www.reactivemanifesto.org/!
• http://en.wikipedia.org/wiki/C10k_problem
No blocking ….!
event oriented …
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!
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 ;)!