Software
System
Architecture
for Node.js
Timur Shemsedinov
Research Institute of System Technologies
Local applications and console utilities
• Task runers and build systems
• Scripting, CLI, testing, documentation generation
Servers
• API and backends for SPA (AJAX/JSON, RPC, REST)
• Event delivery (for chats, games & interactive apps)
• Covering gaps in other applications
Clients
• Crawlers, data mining, testing scripts
• GUI applications (nw.js, node-webkit)
Hardware
• Control systems and production automation
#1 Classification of Node.js use
#2 Where Architecture begins?
Complexity
• The system doesn't fit in the head
• Long development
• Large teams
• Reuse abstract code
Reliability
• Confidence for owners
• Load scalability
• Team scalability
Variability
• Live systems are changes constantly
#3 Node.js and Architecture
JavaScript
node.js
io.js
Frontend developers hordes encroach invades server-side
S
B
Architectors
Conceptualists Corporate
Bullshit
JavaScript
node.js
io.js
Choosing the right allies
S
B
Architectors
Conceptualists Corporate
Bullshit
#3 Node.js and Architecture
#4 Node.js Architectural Problems
Old-style thinking inherited from:
• Languages and servers of short process life
• Frontend (web and window GUI)
• Heavy legacy of OOP
Abstraction Problems
• The applied and system code is mixed
• Abstract layers principle ис not satisfied
(from lower to higher layer)
• Inconsistency (different levels of abstraction are
mixed in a single layer)
• Attempts to separate logic and data
(impossible in Von Neumann architecture)
#5 Misconceptions about Node.js
Common architectural principles
A common architectural practices for Node.js
has not formed yet but (the worst) it is believed that
they have already formed
It seems that all out of the box...
...but pure node.js is very low-level tool
A set of incompatible:
technologies, ideas, principles and concepts
in one application
NIH (not invented here)
Good and bad aspects of NIH
#6 What is not Architecture?
• Middleware
• Routers
• Single entry point...
• Facade, singleton
• Mixin, closure
• Factory, decorator
• Class and object
• Prototype, DI etc.
• MVC, MVP, MVVM
• ORM, CRUD, Key-value
• Pull/Push, Pub/Sub
• REST, RPC и т. д.
• Clouds, SaaS, PaaS...
Code structure patterns}
OOP patterns
}GUI and DB patterns
}Communication patterns
}Deployment patterns}
#7 What is Architecture?
• Division
• naming
• and binding
#8 What is Architecture?
Architectural task
• Divide and give names, build connections
• Combine subsystems to system
Concepts and Tools Selection
• Paradigms, standards, models
• Technologies, frameworks, patterns
• Module interaction types
• Topology
• Protocols and data formats
System Integration
• Planning internal interfaces before development
• Define external interfaces and links
Asynchrony
• Lazy operations
• Maximizing memory usage
• No I/O is faster even then asyncronous I/O
State (statefull vs stateless)
• Long-living processes can afford this...
• Stateless gives nothing nowadays
• Application can't contain just pure functions
• Interactivity or large state requires stateful
Scalability
• IP and cookie sticky
• Interprocess communication
#9 Node.js Features
#10 Minimal client-server A.
Client
Server
DBMS
interface
process
request
response
Client
Server
DBMS
browser
#11 Separation and Binding
Client
Server
DBMS
browser
Client
Server
DBMS
browser
stubs and marshalling
binding
e.g. ORM
e.g. RPC
#12 Introspection and Binding
Dynamic binding
#13 Wrong Layer Separation
Client
Server
DBMS
Interface
Logic
Data
Logic
Data
Interface
#14 Right Layer Separation
Client
Server
DBMS
Interface
DataLogic
Interface
DataLogic
Interface
DataLogic
You can't opose them:
«The system distributed better
is the better centralized one»
Monolithic is not bad, bad is when we have strong coupling
between modules and loose coupling inside module.
General rules, restrictions, agreements and standards
make microservices one monolithic but the lack of
consistency leads to the fact that the system is not a
system at all, it falls into parts, it is not stable, not
operating acording to one goal as an organisms should do.
#15 Microservices vs Monolithic
Software System
Architecture
for Node.js
Timur Shemsedinov
Research Institute of System Technologies
Thank you
Your questions please

Node.js architecture (EN)

  • 1.
  • 2.
    Local applications andconsole utilities • Task runers and build systems • Scripting, CLI, testing, documentation generation Servers • API and backends for SPA (AJAX/JSON, RPC, REST) • Event delivery (for chats, games & interactive apps) • Covering gaps in other applications Clients • Crawlers, data mining, testing scripts • GUI applications (nw.js, node-webkit) Hardware • Control systems and production automation #1 Classification of Node.js use
  • 3.
    #2 Where Architecturebegins? Complexity • The system doesn't fit in the head • Long development • Large teams • Reuse abstract code Reliability • Confidence for owners • Load scalability • Team scalability Variability • Live systems are changes constantly
  • 4.
    #3 Node.js andArchitecture JavaScript node.js io.js Frontend developers hordes encroach invades server-side S B Architectors Conceptualists Corporate Bullshit
  • 5.
    JavaScript node.js io.js Choosing the rightallies S B Architectors Conceptualists Corporate Bullshit #3 Node.js and Architecture
  • 6.
    #4 Node.js ArchitecturalProblems Old-style thinking inherited from: • Languages and servers of short process life • Frontend (web and window GUI) • Heavy legacy of OOP Abstraction Problems • The applied and system code is mixed • Abstract layers principle ис not satisfied (from lower to higher layer) • Inconsistency (different levels of abstraction are mixed in a single layer) • Attempts to separate logic and data (impossible in Von Neumann architecture)
  • 7.
    #5 Misconceptions aboutNode.js Common architectural principles A common architectural practices for Node.js has not formed yet but (the worst) it is believed that they have already formed It seems that all out of the box... ...but pure node.js is very low-level tool A set of incompatible: technologies, ideas, principles and concepts in one application NIH (not invented here) Good and bad aspects of NIH
  • 8.
    #6 What isnot Architecture? • Middleware • Routers • Single entry point... • Facade, singleton • Mixin, closure • Factory, decorator • Class and object • Prototype, DI etc. • MVC, MVP, MVVM • ORM, CRUD, Key-value • Pull/Push, Pub/Sub • REST, RPC и т. д. • Clouds, SaaS, PaaS... Code structure patterns} OOP patterns }GUI and DB patterns }Communication patterns }Deployment patterns}
  • 9.
    #7 What isArchitecture? • Division • naming • and binding
  • 10.
    #8 What isArchitecture? Architectural task • Divide and give names, build connections • Combine subsystems to system Concepts and Tools Selection • Paradigms, standards, models • Technologies, frameworks, patterns • Module interaction types • Topology • Protocols and data formats System Integration • Planning internal interfaces before development • Define external interfaces and links
  • 11.
    Asynchrony • Lazy operations •Maximizing memory usage • No I/O is faster even then asyncronous I/O State (statefull vs stateless) • Long-living processes can afford this... • Stateless gives nothing nowadays • Application can't contain just pure functions • Interactivity or large state requires stateful Scalability • IP and cookie sticky • Interprocess communication #9 Node.js Features
  • 12.
    #10 Minimal client-serverA. Client Server DBMS interface process request response Client Server DBMS browser
  • 13.
    #11 Separation andBinding Client Server DBMS browser Client Server DBMS browser stubs and marshalling binding e.g. ORM e.g. RPC
  • 14.
    #12 Introspection andBinding Dynamic binding
  • 15.
    #13 Wrong LayerSeparation Client Server DBMS Interface Logic Data Logic Data Interface
  • 16.
    #14 Right LayerSeparation Client Server DBMS Interface DataLogic Interface DataLogic Interface DataLogic
  • 17.
    You can't oposethem: «The system distributed better is the better centralized one» Monolithic is not bad, bad is when we have strong coupling between modules and loose coupling inside module. General rules, restrictions, agreements and standards make microservices one monolithic but the lack of consistency leads to the fact that the system is not a system at all, it falls into parts, it is not stable, not operating acording to one goal as an organisms should do. #15 Microservices vs Monolithic
  • 18.
    Software System Architecture for Node.js TimurShemsedinov Research Institute of System Technologies Thank you Your questions please

Editor's Notes

  • #3 Серверы – события - Websocket, SSE <number>
  • #4 <number>
  • #5 <number>
  • #6 <number>
  • #7 Предыдущим языком или техно логическим стеком Слоев или вообще нет или в одном слое используются абстракции разного уровня <number>
  • #8 Предыдущим языком или техно логическим стеком Слоев или вообще нет или в одном слое используются абстракции разного уровня <number>
  • #9 <number>
  • #10 <number>
  • #11 <number>
  • #12 <number>
  • #13 <number>
  • #14 <number>
  • #15 <number>
  • #16 <number>
  • #17 <number>
  • #18 <number>
  • #19 <number>