SlideShare a Scribd company logo
OdessaJS - 2020
Effective NodeJS
Development
Viktor Turskyi
Viktor Turskyi
● CEO and principal software
architect at WebbyLab
● Open source developer
● More than 15 years of experience
● Delivered more than 60 projects
of different scale
● Did projects for 5 companies
from Fortune 500 list
2/86
Simple mental model for:
● Solution architecture
● Application architecture
(https://www.youtube.com/watch?v=TjvIEgBCxZo)
● Development process
● Deployment process
How to make development more
effective?
3/86
Solved most of the standard edge cases in starter-kit:
● Folders structure
● Configs
● Sessions
● Error handling
● Transactions
● Dependencies management
(including 3rd party services)
● Tests etc
How to make development more
effective?
4/86
5/86
Complex is easy. Simple is hard.
● Define standard technology stack
● Define standard architecture
● Define the most effective software development
approaches
● Define the most effective deployment strategies
● Define the most effective way of production support
● Internal trainings
Engineering productivity group
7/86
● NodeJS
● ReactJS
● React Native
● MySQL/Postgres
● S3 like object storage
● Docker
Standard technology stack
8/86
Example Project
Solution architecture overview
Monolith or Microservices by default?
"If you cannot build a monolith what makes you
think that you can build Distributed Microservices"
Simon Brown
● High operational complexity (increases costs)
● Versions compatibility issues (harder to track all dependencies in
consistent state, reduces iterations speed)
● Extremely hard to support transactions (risks of inconsistencies)
● Distribution issues (harder to program)
● Traceability issues (harder to debug)
● Technology diversity (mixing languages increases support costs,
standardization issues, hiring issues etc)
● You need more experienced team (hiring issues)
Microservices drawbacks
13/86
Key microservices issue
What is the best architectural
decision?
“The job of architect is not to make decision, the job of
the architect is to defer decisions as long as possible”
“Good architecture maximizes number
of decisions not made”
Robert Martin
https://www.youtube.com/watch?v=o_TH-Y78tt4
● But when your components are services with remote
communications, then refactoring is much harder than with
in-process libraries.
● Another issue is If the components do not compose cleanly,
then all you are doing is shifting complexity from inside a
component to the connections between components. Not
just does this just move complexity around, it moves it to a
place that's less explicit and harder to control.
https://martinfowler.com/bliki/MonolithFirst.html
Martin Fowler:
17/86
So, we start with monolith
in 90% of cases
What is Monolith?
Usually it looks like
20/86
9/19
21/86
9/19
21/86
Application architecture
Which web-framework to choose?
● Express
● Koa
● Sails
● Nest
● Feathers
● Derby
● Kraken
● Hapi etc
NodeJs frameworks:
25/86
It doesn’t matter!
Your application architecture
should not depend on a web
framework
● NodeJs: Express
● PHP: Slim3
● Perl : Mojolicious
Web frameworks we use
28/86
“We use MVC why do we need
another architecture?”
MVC (from wikipedia)
30/86
Where to place this code? Model
or Controller?
“The M in MVC: Why Models are Misunderstood
and Unappreciated” Pádraic Brady
http://blog.astrumfutura.com/2008/12/the-m-in-mvc-w
hy-models-are-misunderstood-and-unappreciated/
Fat Stupid Ugly Controllers
32/86
Is Model (MVC) and
Domain Model the same?
● Domain model
● Transaction script
● Table module
● Service layer
Model (from MVC)/Domain Logic
34/86
An object model of the domain that incorporates
both behavior and data. (M. Fowler)
Works well for medium and large applications.
Domain model
35/86
Organizes business logic by procedures where
each procedure handles a single request from the
presentation (M. Fowler).
Works well for small projects.
Transaction script
36/86
Controllers
Services
Domain model
Data access
layer
Dispatcher
How do we cook the service layer?
Separate service class (implemented
as command) for each endpoint
42/86
Real code (with meta
programming)
43/86
● Extremely thin layer
● Protects underneath layers from
everything related to HTTP
● If you change JSON to XML (or even CLI),
only controllers should be rewritten
The way of thinking about
Controllers
44/86
NodeJs example of a Service class
Base class (the simplest version)
46/86
47/86
Template method in base class
Guarantees that all procedures are kept:
● Data was validated
● “execute” will be called only after validation
● “execute” will receive only clean data
● Checks permissions before calling “execute”
● Throws exception in case of validation errors
Can do extra work like caching validator objects, etc.
“run” method
48/86
● Belongs to Model layer of MVC
● Contains application logic
● Does not trust any incoming params
● You should keep thin if possible
● Knows nothing about controllers/transport/UI.
● Use cases based API
● Knows about context (what user asks for data)
● Knows when and how to notify user (emails etc)
● Does coordination and security
● Coarse grained API (well suited for remote invocation)
The way of thinking about
Services
49/86
Never return objects directly
Whitelist every object property:
1. You know what you return (that no internal/secret data there)
2. Your API is stable
50/86
● DO NOT TRUST ANY USER INPUT! NEVER!!!
● Declarative validation
● Exclude all fields that do not have validation
rules described
● Returns understandable error codes (neither
error messages nor numeric codes)
● It should be clear for the service user what is
wrong with his data
Unified approach to validation
51/86
It should be clear where any code should be! Otherwise
you do not architecture.
One of the risks, than you can end up with
an “Anemic domain model”
(https://www.martinfowler.com/bliki/AnemicDomainModel.html)
If you have a large project, this can be a reason
of project failure as you will implicitly switch to
“transaction script” approach which is not well
suited for large applications.
Be aware of “Anemic domain
model” antipattern
52/86
ORM Sequelize
● Belongs to Model layer of MVC
● The core part of your application
● You have almost all of your business logic here (not
only database access)!!!
● Knows nothing about service layer and upper layers
● Responsible for data storing and data integrity
● Fine grained API (not suited for remote invocation)
The way of thinking about
Domain Model
54/86
● ES6 syntax
● Transactions
● Configuration
Sequelize
55/86
Sequelize ES6
(do not follow docs strictly)
57/86
58/86
Initialize once
59/86
Sequelize transactions
Continuation-local storage works like
thread-local storage in threaded programming,
but is based on chains of Node-style callbacks
instead of threads.
https://www.npmjs.com/package/cls-hooked
Transactions with CLS
(continuation local storage)
61/86
Transactions with CLS
(continuation local storage)
62/86
Sequelize config
Do not do this: violates
12 factors apps principles
64/86
Chatbot example in Perl6
https://github.com/koorchik/codegolf-telegram-bot/
Configs
How to work with configs
according to 12 factors?
“confme”
https://www.npmjs.com/package/confme
69/86
How to use config?
70/86
How to use config data for
Sequelize?
71/86
How to read config in migrations?
sequelize --config lib/config.js db:migrate --env db
72/86
How do we use “12 factors”
configs with next.js?
73/86
How do we use “12 factors”
configs with SPA?
Hack for Parcel (with webpack you just have “script” tag)
74/86
public/config.js and lib/config.js
74/86
“confme” demo
Docker
● How do new developers setup working environment?
● How to work with S3 (we do not use localstack)?
● How to work with emails?
● How to run the whole platform?
● How to do migrations?
● How to work with cron?
● Do I need pm2?
● How to build frontend in docker?
Questions
78/86
Demo
● Minio (vs localstack)
● Mailhog
● Adminer
Services that we use
80/86
User sessions
● Classical sessions or JWT?
● Which type of transport to use (Cookie, Query
params, Custom headers)?
● How to refresh JWT?
● CSRF protection?
● CORS issues?
● How to implement “Force logout”?
● Sensitive information
Questions to solve
82/86
● MonolithFirst by Martin Fowler
● Microservice Trade-Offs by Martin Fowler
● PresentationDomainDataLayering by Martin Fowler
● The Principles of Clean Architecture by Uncle Bob Martin
● The Clean Architecture by Robert Martin
● Microservice Architecture at Medium
● https://12factor.net/
Useful links
83/86
● Based on ideas of Clean Architecture
● Works with small and large projects
● Follows 12 factor app approach
● Modern JS (including ES6 for Sequelize)
● Supports both REST API and GraphQL
● Follows security best practices.
● Docker support
● Covered with tests
● Battle tested
● Built on top of express.js
● Users managment
NodeJs Starter App
84/86
https://github.com/WebbyLab/webbylab-
starter-app-for-nodejs
Telegram: @JABASCRIPT
85/86
Email
viktor@webbylab.com
Website
https://webbylab.com
@koorchik
@koorchik
My contacts
86/86

More Related Content

What's hot

Clean architecture
Clean architectureClean architecture
Clean architecture
Travis Frisinger
 
A walkthrough of JavaScript ES6 features
A walkthrough of JavaScript ES6 featuresA walkthrough of JavaScript ES6 features
A walkthrough of JavaScript ES6 features
Michal Juhas
 
NYC Continuous Delivery Meetup - Introducing delta
NYC Continuous Delivery Meetup - Introducing deltaNYC Continuous Delivery Meetup - Introducing delta
NYC Continuous Delivery Meetup - Introducing delta
Michael Bryzek
 
Introduction to K6
Introduction to K6Introduction to K6
Introduction to K6
Knoldus Inc.
 
Embracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetryEmbracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetry
Cyrille Le Clerc
 
CI back to basis
CI back to basisCI back to basis
CI back to basis
Sergio Navarro Pino
 
How to go about testing in React?
How to go about testing in React? How to go about testing in React?
How to go about testing in React?
Lisa Gagarina
 
Design Microservice Architectures the Right Way
Design Microservice Architectures the Right WayDesign Microservice Architectures the Right Way
Design Microservice Architectures the Right Way
Michael Bryzek
 
Enter the Team City
Enter the Team CityEnter the Team City
Enter the Team City
Kashif Ali Siddiqui
 
Migration from AngularJS to Angular
Migration from AngularJS to AngularMigration from AngularJS to Angular
Migration from AngularJS to Angular
Aleks Zinevych
 
Testing Without a GUI Using TestComplete
 Testing Without a GUI Using TestComplete Testing Without a GUI Using TestComplete
Testing Without a GUI Using TestComplete
SmartBear
 
Alexey Kupriyanenko "Release Early, Often, Stable"
Alexey Kupriyanenko "Release Early, Often, Stable"Alexey Kupriyanenko "Release Early, Often, Stable"
Alexey Kupriyanenko "Release Early, Often, Stable"
Fwdays
 
vodQA Pune (2019) - Jenkins pipeline As code
vodQA Pune (2019) - Jenkins pipeline As codevodQA Pune (2019) - Jenkins pipeline As code
vodQA Pune (2019) - Jenkins pipeline As code
vodQA
 
Trunk based development
Trunk based developmentTrunk based development
Trunk based development
go_oh
 
Javascript Unit Testing Tools
Javascript Unit Testing ToolsJavascript Unit Testing Tools
Javascript Unit Testing Tools
PixelCrayons
 
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneTDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
Michael Kuehne-Schlinkert
 
Trunk based development for Beginners
Trunk based development for BeginnersTrunk based development for Beginners
Trunk based development for Beginners
Nebulaworks
 
Modern Tools for Building Progressive Web Apps
Modern Tools for Building Progressive Web AppsModern Tools for Building Progressive Web Apps
Modern Tools for Building Progressive Web Apps
All Things Open
 
Fault tolerance - look, it's simple!
Fault tolerance - look, it's simple!Fault tolerance - look, it's simple!
Fault tolerance - look, it's simple!
Izzet Mustafaiev
 
.NET Code Coverage for Continuous Integration using TeamCity and dotCover
.NET Code Coverage for Continuous Integrationusing TeamCity and dotCover.NET Code Coverage for Continuous Integrationusing TeamCity and dotCover
.NET Code Coverage for Continuous Integration using TeamCity and dotCover
Maarten Balliauw
 

What's hot (20)

Clean architecture
Clean architectureClean architecture
Clean architecture
 
A walkthrough of JavaScript ES6 features
A walkthrough of JavaScript ES6 featuresA walkthrough of JavaScript ES6 features
A walkthrough of JavaScript ES6 features
 
NYC Continuous Delivery Meetup - Introducing delta
NYC Continuous Delivery Meetup - Introducing deltaNYC Continuous Delivery Meetup - Introducing delta
NYC Continuous Delivery Meetup - Introducing delta
 
Introduction to K6
Introduction to K6Introduction to K6
Introduction to K6
 
Embracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetryEmbracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetry
 
CI back to basis
CI back to basisCI back to basis
CI back to basis
 
How to go about testing in React?
How to go about testing in React? How to go about testing in React?
How to go about testing in React?
 
Design Microservice Architectures the Right Way
Design Microservice Architectures the Right WayDesign Microservice Architectures the Right Way
Design Microservice Architectures the Right Way
 
Enter the Team City
Enter the Team CityEnter the Team City
Enter the Team City
 
Migration from AngularJS to Angular
Migration from AngularJS to AngularMigration from AngularJS to Angular
Migration from AngularJS to Angular
 
Testing Without a GUI Using TestComplete
 Testing Without a GUI Using TestComplete Testing Without a GUI Using TestComplete
Testing Without a GUI Using TestComplete
 
Alexey Kupriyanenko "Release Early, Often, Stable"
Alexey Kupriyanenko "Release Early, Often, Stable"Alexey Kupriyanenko "Release Early, Often, Stable"
Alexey Kupriyanenko "Release Early, Often, Stable"
 
vodQA Pune (2019) - Jenkins pipeline As code
vodQA Pune (2019) - Jenkins pipeline As codevodQA Pune (2019) - Jenkins pipeline As code
vodQA Pune (2019) - Jenkins pipeline As code
 
Trunk based development
Trunk based developmentTrunk based development
Trunk based development
 
Javascript Unit Testing Tools
Javascript Unit Testing ToolsJavascript Unit Testing Tools
Javascript Unit Testing Tools
 
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneTDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
 
Trunk based development for Beginners
Trunk based development for BeginnersTrunk based development for Beginners
Trunk based development for Beginners
 
Modern Tools for Building Progressive Web Apps
Modern Tools for Building Progressive Web AppsModern Tools for Building Progressive Web Apps
Modern Tools for Building Progressive Web Apps
 
Fault tolerance - look, it's simple!
Fault tolerance - look, it's simple!Fault tolerance - look, it's simple!
Fault tolerance - look, it's simple!
 
.NET Code Coverage for Continuous Integration using TeamCity and dotCover
.NET Code Coverage for Continuous Integrationusing TeamCity and dotCover.NET Code Coverage for Continuous Integrationusing TeamCity and dotCover
.NET Code Coverage for Continuous Integration using TeamCity and dotCover
 

Similar to 'Effective node.js development' by Viktor Turskyi at OdessaJS'2020

Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"
Fwdays
 
The working architecture of node js applications open tech week javascript ...
The working architecture of node js applications   open tech week javascript ...The working architecture of node js applications   open tech week javascript ...
The working architecture of node js applications open tech week javascript ...
Viktor Turskyi
 
The working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор ТурскийThe working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор Турский
Sigma Software
 
The working architecture of NodeJs applications
The working architecture of NodeJs applicationsThe working architecture of NodeJs applications
The working architecture of NodeJs applications
Viktor Turskyi
 
"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi
Julia Cherniak
 
From class to architecture
From class to architectureFrom class to architecture
From class to architecture
Marcin Hawraniak
 
Clean architecture
Clean architectureClean architecture
Clean architecture
.NET Crowd
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
Matthias Noback
 
Breaking down a monolith
Breaking down a monolithBreaking down a monolith
Breaking down a monolith
GeekNightHyderabad
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
Shyam Sunder Verma
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
VeilFramework
 
DDD with Behat
DDD with BehatDDD with Behat
DDD with Behat
Anton Serdyuk
 
Keeping business logic out of your UIs
Keeping business logic out of your UIsKeeping business logic out of your UIs
Keeping business logic out of your UIs
Petter Holmström
 
Keeping code clean
Keeping code cleanKeeping code clean
Keeping code clean
Brett Child
 
Rapid app building with loopback framework
Rapid app building with loopback frameworkRapid app building with loopback framework
Rapid app building with loopback framework
Thomas Papaspiros
 
Dev ops presentation
Dev ops presentationDev ops presentation
Dev ops presentation
Ahmed Kamel
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projects
IBACZ
 
Network Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveNetwork Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspective
Walid Shaari
 
JavaScript for Enterprise Applications
JavaScript for Enterprise ApplicationsJavaScript for Enterprise Applications
JavaScript for Enterprise Applications
Piyush Katariya
 
First Steps to DevOps
First Steps to DevOpsFirst Steps to DevOps
First Steps to DevOps
Inductive Automation
 

Similar to 'Effective node.js development' by Viktor Turskyi at OdessaJS'2020 (20)

Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"
 
The working architecture of node js applications open tech week javascript ...
The working architecture of node js applications   open tech week javascript ...The working architecture of node js applications   open tech week javascript ...
The working architecture of node js applications open tech week javascript ...
 
The working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор ТурскийThe working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор Турский
 
The working architecture of NodeJs applications
The working architecture of NodeJs applicationsThe working architecture of NodeJs applications
The working architecture of NodeJs applications
 
"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi
 
From class to architecture
From class to architectureFrom class to architecture
From class to architecture
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
Breaking down a monolith
Breaking down a monolithBreaking down a monolith
Breaking down a monolith
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
 
DDD with Behat
DDD with BehatDDD with Behat
DDD with Behat
 
Keeping business logic out of your UIs
Keeping business logic out of your UIsKeeping business logic out of your UIs
Keeping business logic out of your UIs
 
Keeping code clean
Keeping code cleanKeeping code clean
Keeping code clean
 
Rapid app building with loopback framework
Rapid app building with loopback frameworkRapid app building with loopback framework
Rapid app building with loopback framework
 
Dev ops presentation
Dev ops presentationDev ops presentation
Dev ops presentation
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projects
 
Network Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveNetwork Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspective
 
JavaScript for Enterprise Applications
JavaScript for Enterprise ApplicationsJavaScript for Enterprise Applications
JavaScript for Enterprise Applications
 
First Steps to DevOps
First Steps to DevOpsFirst Steps to DevOps
First Steps to DevOps
 

More from OdessaJS Conf

'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021
'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021
'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021
OdessaJS Conf
 
'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021
'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021
'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021
OdessaJS Conf
 
"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021
"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021
"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021
OdessaJS Conf
 
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
OdessaJS Conf
 
Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...
Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...
Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...
OdessaJS Conf
 
Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021
Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021
Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021
OdessaJS Conf
 
"NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні...
"NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні..."NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні...
"NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні...
OdessaJS Conf
 
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
OdessaJS Conf
 
'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by Dmytro Gusev
'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by  Dmytro Gusev'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by  Dmytro Gusev
'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by Dmytro Gusev
OdessaJS Conf
 
'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko
'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko
'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko
OdessaJS Conf
 
'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...
'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...
'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...
OdessaJS Conf
 
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
 'MICROFRONTENDS WITH REACT' by Liliia Karpenko 'MICROFRONTENDS WITH REACT' by Liliia Karpenko
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
OdessaJS Conf
 
'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020
'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020
'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020
OdessaJS Conf
 
'STORY OF ANOTHER ANIMATION' by YURII ARTYUKH at OdessaJS'2020
'STORY OF ANOTHER ANIMATION' by  YURII ARTYUKH at OdessaJS'2020'STORY OF ANOTHER ANIMATION' by  YURII ARTYUKH at OdessaJS'2020
'STORY OF ANOTHER ANIMATION' by YURII ARTYUKH at OdessaJS'2020
OdessaJS Conf
 
'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020
'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020
'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020
OdessaJS Conf
 
'Why svelte' by BORYS MOHYLA at OdessaJS'2020
'Why svelte' by BORYS MOHYLA at OdessaJS'2020'Why svelte' by BORYS MOHYLA at OdessaJS'2020
'Why svelte' by BORYS MOHYLA at OdessaJS'2020
OdessaJS Conf
 
'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020
'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020
'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020
OdessaJS Conf
 
'React+d3=LOVE' by Illia Olenchenko at OdessaJS'2020
'React+d3=LOVE' by Illia Olenchenko at OdessaJS'2020'React+d3=LOVE' by Illia Olenchenko at OdessaJS'2020
'React+d3=LOVE' by Illia Olenchenko at OdessaJS'2020
OdessaJS Conf
 
'THE AGE OF DATA STREAMING' by DENIS BURYACHKOVSKY at OdessaJS'2020
'THE AGE OF DATA STREAMING' by DENIS BURYACHKOVSKY at OdessaJS'2020'THE AGE OF DATA STREAMING' by DENIS BURYACHKOVSKY at OdessaJS'2020
'THE AGE OF DATA STREAMING' by DENIS BURYACHKOVSKY at OdessaJS'2020
OdessaJS Conf
 
'Worker threads vs c++ addons' by Novokhatskyi Oleksii at OdessaJS'2020
'Worker threads vs c++ addons' by Novokhatskyi Oleksii at OdessaJS'2020'Worker threads vs c++ addons' by Novokhatskyi Oleksii at OdessaJS'2020
'Worker threads vs c++ addons' by Novokhatskyi Oleksii at OdessaJS'2020
OdessaJS Conf
 

More from OdessaJS Conf (20)

'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021
'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021
'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021
 
'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021
'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021
'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021
 
"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021
"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021
"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021
 
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
 
Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...
Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...
Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...
 
Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021
Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021
Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021
 
"NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні...
"NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні..."NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні...
"NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні...
 
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
 
'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by Dmytro Gusev
'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by  Dmytro Gusev'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by  Dmytro Gusev
'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by Dmytro Gusev
 
'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko
'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko
'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko
 
'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...
'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...
'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...
 
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
 'MICROFRONTENDS WITH REACT' by Liliia Karpenko 'MICROFRONTENDS WITH REACT' by Liliia Karpenko
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
 
'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020
'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020
'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020
 
'STORY OF ANOTHER ANIMATION' by YURII ARTYUKH at OdessaJS'2020
'STORY OF ANOTHER ANIMATION' by  YURII ARTYUKH at OdessaJS'2020'STORY OF ANOTHER ANIMATION' by  YURII ARTYUKH at OdessaJS'2020
'STORY OF ANOTHER ANIMATION' by YURII ARTYUKH at OdessaJS'2020
 
'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020
'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020
'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020
 
'Why svelte' by BORYS MOHYLA at OdessaJS'2020
'Why svelte' by BORYS MOHYLA at OdessaJS'2020'Why svelte' by BORYS MOHYLA at OdessaJS'2020
'Why svelte' by BORYS MOHYLA at OdessaJS'2020
 
'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020
'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020
'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020
 
'React+d3=LOVE' by Illia Olenchenko at OdessaJS'2020
'React+d3=LOVE' by Illia Olenchenko at OdessaJS'2020'React+d3=LOVE' by Illia Olenchenko at OdessaJS'2020
'React+d3=LOVE' by Illia Olenchenko at OdessaJS'2020
 
'THE AGE OF DATA STREAMING' by DENIS BURYACHKOVSKY at OdessaJS'2020
'THE AGE OF DATA STREAMING' by DENIS BURYACHKOVSKY at OdessaJS'2020'THE AGE OF DATA STREAMING' by DENIS BURYACHKOVSKY at OdessaJS'2020
'THE AGE OF DATA STREAMING' by DENIS BURYACHKOVSKY at OdessaJS'2020
 
'Worker threads vs c++ addons' by Novokhatskyi Oleksii at OdessaJS'2020
'Worker threads vs c++ addons' by Novokhatskyi Oleksii at OdessaJS'2020'Worker threads vs c++ addons' by Novokhatskyi Oleksii at OdessaJS'2020
'Worker threads vs c++ addons' by Novokhatskyi Oleksii at OdessaJS'2020
 

Recently uploaded

Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 

Recently uploaded (20)

Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 

'Effective node.js development' by Viktor Turskyi at OdessaJS'2020

  • 1. OdessaJS - 2020 Effective NodeJS Development Viktor Turskyi
  • 2. Viktor Turskyi ● CEO and principal software architect at WebbyLab ● Open source developer ● More than 15 years of experience ● Delivered more than 60 projects of different scale ● Did projects for 5 companies from Fortune 500 list 2/86
  • 3. Simple mental model for: ● Solution architecture ● Application architecture (https://www.youtube.com/watch?v=TjvIEgBCxZo) ● Development process ● Deployment process How to make development more effective? 3/86
  • 4. Solved most of the standard edge cases in starter-kit: ● Folders structure ● Configs ● Sessions ● Error handling ● Transactions ● Dependencies management (including 3rd party services) ● Tests etc How to make development more effective? 4/86
  • 6. Complex is easy. Simple is hard.
  • 7. ● Define standard technology stack ● Define standard architecture ● Define the most effective software development approaches ● Define the most effective deployment strategies ● Define the most effective way of production support ● Internal trainings Engineering productivity group 7/86
  • 8. ● NodeJS ● ReactJS ● React Native ● MySQL/Postgres ● S3 like object storage ● Docker Standard technology stack 8/86
  • 12. "If you cannot build a monolith what makes you think that you can build Distributed Microservices" Simon Brown
  • 13. ● High operational complexity (increases costs) ● Versions compatibility issues (harder to track all dependencies in consistent state, reduces iterations speed) ● Extremely hard to support transactions (risks of inconsistencies) ● Distribution issues (harder to program) ● Traceability issues (harder to debug) ● Technology diversity (mixing languages increases support costs, standardization issues, hiring issues etc) ● You need more experienced team (hiring issues) Microservices drawbacks 13/86
  • 15. What is the best architectural decision?
  • 16. “The job of architect is not to make decision, the job of the architect is to defer decisions as long as possible” “Good architecture maximizes number of decisions not made” Robert Martin https://www.youtube.com/watch?v=o_TH-Y78tt4
  • 17. ● But when your components are services with remote communications, then refactoring is much harder than with in-process libraries. ● Another issue is If the components do not compose cleanly, then all you are doing is shifting complexity from inside a component to the connections between components. Not just does this just move complexity around, it moves it to a place that's less explicit and harder to control. https://martinfowler.com/bliki/MonolithFirst.html Martin Fowler: 17/86
  • 18. So, we start with monolith in 90% of cases
  • 20. Usually it looks like 20/86
  • 25. ● Express ● Koa ● Sails ● Nest ● Feathers ● Derby ● Kraken ● Hapi etc NodeJs frameworks: 25/86
  • 27. Your application architecture should not depend on a web framework
  • 28. ● NodeJs: Express ● PHP: Slim3 ● Perl : Mojolicious Web frameworks we use 28/86
  • 29. “We use MVC why do we need another architecture?”
  • 31. Where to place this code? Model or Controller?
  • 32. “The M in MVC: Why Models are Misunderstood and Unappreciated” Pádraic Brady http://blog.astrumfutura.com/2008/12/the-m-in-mvc-w hy-models-are-misunderstood-and-unappreciated/ Fat Stupid Ugly Controllers 32/86
  • 33. Is Model (MVC) and Domain Model the same?
  • 34. ● Domain model ● Transaction script ● Table module ● Service layer Model (from MVC)/Domain Logic 34/86
  • 35. An object model of the domain that incorporates both behavior and data. (M. Fowler) Works well for medium and large applications. Domain model 35/86
  • 36. Organizes business logic by procedures where each procedure handles a single request from the presentation (M. Fowler). Works well for small projects. Transaction script 36/86
  • 37.
  • 39.
  • 40.
  • 41. How do we cook the service layer?
  • 42. Separate service class (implemented as command) for each endpoint 42/86
  • 43. Real code (with meta programming) 43/86
  • 44. ● Extremely thin layer ● Protects underneath layers from everything related to HTTP ● If you change JSON to XML (or even CLI), only controllers should be rewritten The way of thinking about Controllers 44/86
  • 45. NodeJs example of a Service class
  • 46. Base class (the simplest version) 46/86
  • 47. 47/86
  • 48. Template method in base class Guarantees that all procedures are kept: ● Data was validated ● “execute” will be called only after validation ● “execute” will receive only clean data ● Checks permissions before calling “execute” ● Throws exception in case of validation errors Can do extra work like caching validator objects, etc. “run” method 48/86
  • 49. ● Belongs to Model layer of MVC ● Contains application logic ● Does not trust any incoming params ● You should keep thin if possible ● Knows nothing about controllers/transport/UI. ● Use cases based API ● Knows about context (what user asks for data) ● Knows when and how to notify user (emails etc) ● Does coordination and security ● Coarse grained API (well suited for remote invocation) The way of thinking about Services 49/86
  • 50. Never return objects directly Whitelist every object property: 1. You know what you return (that no internal/secret data there) 2. Your API is stable 50/86
  • 51. ● DO NOT TRUST ANY USER INPUT! NEVER!!! ● Declarative validation ● Exclude all fields that do not have validation rules described ● Returns understandable error codes (neither error messages nor numeric codes) ● It should be clear for the service user what is wrong with his data Unified approach to validation 51/86
  • 52. It should be clear where any code should be! Otherwise you do not architecture. One of the risks, than you can end up with an “Anemic domain model” (https://www.martinfowler.com/bliki/AnemicDomainModel.html) If you have a large project, this can be a reason of project failure as you will implicitly switch to “transaction script” approach which is not well suited for large applications. Be aware of “Anemic domain model” antipattern 52/86
  • 54. ● Belongs to Model layer of MVC ● The core part of your application ● You have almost all of your business logic here (not only database access)!!! ● Knows nothing about service layer and upper layers ● Responsible for data storing and data integrity ● Fine grained API (not suited for remote invocation) The way of thinking about Domain Model 54/86
  • 55. ● ES6 syntax ● Transactions ● Configuration Sequelize 55/86
  • 56. Sequelize ES6 (do not follow docs strictly)
  • 57. 57/86
  • 58. 58/86
  • 61. Continuation-local storage works like thread-local storage in threaded programming, but is based on chains of Node-style callbacks instead of threads. https://www.npmjs.com/package/cls-hooked Transactions with CLS (continuation local storage) 61/86
  • 62. Transactions with CLS (continuation local storage) 62/86
  • 64. Do not do this: violates 12 factors apps principles 64/86
  • 65. Chatbot example in Perl6 https://github.com/koorchik/codegolf-telegram-bot/
  • 67. How to work with configs according to 12 factors?
  • 69. 69/86
  • 70. How to use config? 70/86
  • 71. How to use config data for Sequelize? 71/86
  • 72. How to read config in migrations? sequelize --config lib/config.js db:migrate --env db 72/86
  • 73. How do we use “12 factors” configs with next.js? 73/86
  • 74. How do we use “12 factors” configs with SPA? Hack for Parcel (with webpack you just have “script” tag) 74/86
  • 78. ● How do new developers setup working environment? ● How to work with S3 (we do not use localstack)? ● How to work with emails? ● How to run the whole platform? ● How to do migrations? ● How to work with cron? ● Do I need pm2? ● How to build frontend in docker? Questions 78/86
  • 79. Demo
  • 80. ● Minio (vs localstack) ● Mailhog ● Adminer Services that we use 80/86
  • 82. ● Classical sessions or JWT? ● Which type of transport to use (Cookie, Query params, Custom headers)? ● How to refresh JWT? ● CSRF protection? ● CORS issues? ● How to implement “Force logout”? ● Sensitive information Questions to solve 82/86
  • 83. ● MonolithFirst by Martin Fowler ● Microservice Trade-Offs by Martin Fowler ● PresentationDomainDataLayering by Martin Fowler ● The Principles of Clean Architecture by Uncle Bob Martin ● The Clean Architecture by Robert Martin ● Microservice Architecture at Medium ● https://12factor.net/ Useful links 83/86
  • 84. ● Based on ideas of Clean Architecture ● Works with small and large projects ● Follows 12 factor app approach ● Modern JS (including ES6 for Sequelize) ● Supports both REST API and GraphQL ● Follows security best practices. ● Docker support ● Covered with tests ● Battle tested ● Built on top of express.js ● Users managment NodeJs Starter App 84/86