SlideShare une entreprise Scribd logo
1  sur  18
AN INTRODUCTION TO NODE.JS

+ SAILS.JS QUICK DEMO

Meet.js Katowice – 5 lutego 2014 – Kamil PrzeoRski
www.facebook.com/groups/nodejsPL
słowo wstępu

•
•
•
•
•
•
•

teoria node.js
korzyści
wyzwania / problemy
popyt / podaż – potencjalne możliwości kariery :-)
przykłady i najlepsze zastosowania node.js
krótkie demo sails.js
przyszłość node.js ( dyskusja :-)
wydajność I/O
OPERATION CPU CYCLES

300,000,000
240,000,000
225,000,000

150,000,000

75,000,000
41,000,000
3

14

250

L1

0

L2

RAM

Source: Ryan Dahl's 2008.11.08 presentation on Node.js

DISK

NETWORK
waiting ...

ROUTE REQUEST

QUERY DB OR WEB SERVICE

OPERACJE I/O ZAJMUJĄ O WIELE
WIĘCEJ CZASU NIŻ INNE OPERACJE
W TWOJEJ APLIKACJI

PROCESS RESULT

WRITE TO LOG FILE

STANDARDOWE APLIKACJE POSIADAJĄCE
OPERACJE I/O CZEKAJĄ PRZEZ WIĘKSZOŚĆ
CZASU

FORMAL RESPONSE

Source: Ryan Dahl's 2008.11.08
presentation on Node.js
skalowalnie przy użyciu wątków

THREAD 1
THREAD 2
THREAD 3

THREAD 4
Source: Ryan Dahl's 2008.11.08 presentation on Node.js

OBSŁUGA WĄTKÓW PRZEZ
SYSTEM OS JEST “DROGA”

ALOKACJA PAMIĘCI, “CONTEXT SWITCHING”
I CZEKANIE NA WYKONANIE SIĘ OPERACJI
I/O

SZTUCZNE OGRANICZENIE ILOŚCI
JEDNOCZESNYCH POŁĄCZEO
skalowalnie przy użyciu “Event Loop”

PROCESS 1

NETWORK

FILESYSTEM
Thread Pool and Async I/I APIs

JEDEN WĄTEK W CAŁEJ APLIKACJI

DELEGUJE OPERACJE I/O
MECHANIZMOWI “THREADPOOL”

Source: Ryan Dahl's 2008.11.08
presentation on Node.js
event loop

thread pool
event
queue
NODE.JS KORZYSTA
Z BIBLIOTEKI LIBEV DO OBSŁUGI
MECHANIZMU EVENT-LOOP

filesystem

EVENT
LOOP

network
process
other

PO WYKONANIU SIĘ OPERACJI I/O,
ZA POMOCĄ MECHANIZMU “CALLBACK”
WYNIK ZOSTAJE PRZEKAZANY SPOWROTEM
DO GŁÓWNEGO WĄTKU APLIKACJI
Source: Ryan Dahl's 2008.11.08 presentation on Node.js
platforma

•

•
•

V8 JAVASCRIPT VIRTUAL
MACHINE

Java Script

NODE STANDARD LIBRARY
NODE BINDINGS

LIBEIO (THREAD POOL)

LIBEV (EVENT LOOP)

C

V8

Thread
Pool
(libeio)

Event
Loop
(livev)
problemy i wyzwania

thread pool

NIESTABILNE MODUŁY API

TRUDNY W DEBUGOWANIU

event
queue

filesystem

EVENT
LOOP

network
process
other

MAŁO DOŚWIADCZONYCH SPECJALISTÓW
NA RYNKU JEST DODATKOWYM RYZYKIEM
DLA FIRM CHCĄCYCH UŻYWAD NODE.JS
W CELACH KOMERCYJNYCH

0:2
Source: Ryan Dahl's 2008.11.08 presentation on Node.js
popularność
Job trends from indeed.com
NODES

PHP

JAVA

PYTHON

RUBY

.NET

12,000
11,000
10,000

9,000
8,000
7,000
6,000
5,000
4,000
3,000
2,000
1,000

0
Jan ’06

Jan ’07

PONAD 1000 OSÓB
ONLINE NA IRC'U NODE.JS

Jan ’08

Jan ’09

Jan ’10

OGROMNY WZROST
ZAINTERESOWANIA W OSTATNICH 3
LATACH

Jan ’11

Jan ’12

Jan ’13

O WIELE WIĘKSZY POPYT NIŻ PODAŻ W
WIĘKSZYCH HUB'ACH TECHNOLOGICZNYCH
(NP. LONDYN, SAN FRANCISCO)
popularność_2
Module counts
Rubygems.org

PyPl

php

nuget

Node.js

80000
70000
60000
50000
40000
30000
20000
10000

0
Jul 2010

Jan 2011

ILOŚD MODUŁÓW ZWIĘKSZA
SIĘ DRAMATYCZNIE (ŻÓŁTA
LINIA)

Jul 2011

Jan 2012

Jul 2012

POPULARNOŚD NODE.JS W
RASBERRY PI ( INTERNET OF THINGS )

Jan 2013

Jul 2013

Jan 2014

NIESTETY JAKOŚD MODUŁÓW
MA WIELE DO ŻYCZENIA ( POTRZEBA CZASU )
PayPal: Node.js vs. Java
Java application

14

2000

Node.js application

1800

12
1400
10
8

25

1000

20

1000
800

6

800
600

15
600

4

10

400

400
2

200
0

0
1

5

10

Pages/sec

Account response time (ms)

1200

5

200
0

0

15

Pages/sec

1

/home

/wallet

5

10

/activity

15

20

25

Pages/sec

1400

30

1200

1600
PayPal: Node.js vs. Java

PAYPAL'S “ACCOUNT OVERVIEW”

“BUILT ALMOST TWICE AS FAST WITH
FEWER PEOPLE”

“WRITTEN IN 33% FEWER LINES OF CODE”

“CONSTRUCTED WITH 40% FEWER FILES”
estimote ( Kraków,PL )

SZUKAJĄ LUDZI DO BUDOWANIA ICH
API W NODE.JS

ZNALEZIENIE KOGOŚ Z 3 LETNIM DOŚWIADCZENIEM
W NODE.JS JEST NAPRAWDĘ HARDDD W POLSCE... :-)
sails.js

“MVC PATTERN” WZOROWANY
NA ROR'ZE

WSPIERA BUDOWANIE
APLIKACJI RESTOWYCH

SZYBKIE DEMO
Dziękuję :-)
Reach me at kamil.przeorski@skygatedigital.co.uk

Meet.js Katowice – 5 lutego 2014 – Kamil PrzeoRski
www.facebook.com/groups/nodejsPL
An introduction to Node.js and Sails.js at Meet.js Katowice (in polish)

Contenu connexe

Similaire à An introduction to Node.js and Sails.js at Meet.js Katowice (in polish)

SE2016 Exotic Oleg Gorbunov "Action cable"
SE2016 Exotic Oleg Gorbunov "Action cable"SE2016 Exotic Oleg Gorbunov "Action cable"
SE2016 Exotic Oleg Gorbunov "Action cable"Inhacking
 
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation Ecosystem
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation EcosystemHow APIs are Transforming Cisco Solutions and Catalyzing an Innovation Ecosystem
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation EcosystemCisco DevNet
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open SourceBertrand Delacretaz
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
Mainframe DevOps Using Zowe Open Source
Mainframe DevOps Using Zowe Open SourceMainframe DevOps Using Zowe Open Source
Mainframe DevOps Using Zowe Open SourceDevOps.com
 
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing It
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing ItYou Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing It
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing ItAleksandr Yampolskiy
 
E Snet Raf Essc Jan2005
E Snet Raf Essc Jan2005E Snet Raf Essc Jan2005
E Snet Raf Essc Jan2005FNian
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopJimmy Guerrero
 
A map for DevOps on Microsoft Stack - MS DevSummit
A map for DevOps on Microsoft Stack - MS DevSummitA map for DevOps on Microsoft Stack - MS DevSummit
A map for DevOps on Microsoft Stack - MS DevSummitGiulio Vian
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate
 
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogicRakuten Group, Inc.
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open SourceBertrand Delacretaz
 
Pulumi iac on gcp
Pulumi iac on gcpPulumi iac on gcp
Pulumi iac on gcpVishwas N
 
Social Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DaySocial Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DayTechMaster Vietnam
 

Similaire à An introduction to Node.js and Sails.js at Meet.js Katowice (in polish) (20)

Introduction to Node.JS
Introduction to Node.JSIntroduction to Node.JS
Introduction to Node.JS
 
Sql Azure
Sql AzureSql Azure
Sql Azure
 
Node.js
Node.jsNode.js
Node.js
 
Oleg Gorbunov Action cable
Oleg Gorbunov Action cableOleg Gorbunov Action cable
Oleg Gorbunov Action cable
 
SE2016 Exotic Oleg Gorbunov "Action cable"
SE2016 Exotic Oleg Gorbunov "Action cable"SE2016 Exotic Oleg Gorbunov "Action cable"
SE2016 Exotic Oleg Gorbunov "Action cable"
 
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation Ecosystem
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation EcosystemHow APIs are Transforming Cisco Solutions and Catalyzing an Innovation Ecosystem
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation Ecosystem
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open Source
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Mainframe DevOps Using Zowe Open Source
Mainframe DevOps Using Zowe Open SourceMainframe DevOps Using Zowe Open Source
Mainframe DevOps Using Zowe Open Source
 
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing It
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing ItYou Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing It
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing It
 
Beyond JEE
Beyond JEEBeyond JEE
Beyond JEE
 
E Snet Raf Essc Jan2005
E Snet Raf Essc Jan2005E Snet Raf Essc Jan2005
E Snet Raf Essc Jan2005
 
MSDN Dec2007
MSDN Dec2007MSDN Dec2007
MSDN Dec2007
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
 
A map for DevOps on Microsoft Stack - MS DevSummit
A map for DevOps on Microsoft Stack - MS DevSummitA map for DevOps on Microsoft Stack - MS DevSummit
A map for DevOps on Microsoft Stack - MS DevSummit
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
 
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open Source
 
Pulumi iac on gcp
Pulumi iac on gcpPulumi iac on gcp
Pulumi iac on gcp
 
Social Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DaySocial Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech Day
 

Dernier

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Dernier (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

An introduction to Node.js and Sails.js at Meet.js Katowice (in polish)

  • 1.
  • 2. AN INTRODUCTION TO NODE.JS + SAILS.JS QUICK DEMO Meet.js Katowice – 5 lutego 2014 – Kamil PrzeoRski www.facebook.com/groups/nodejsPL
  • 3. słowo wstępu • • • • • • • teoria node.js korzyści wyzwania / problemy popyt / podaż – potencjalne możliwości kariery :-) przykłady i najlepsze zastosowania node.js krótkie demo sails.js przyszłość node.js ( dyskusja :-)
  • 4. wydajność I/O OPERATION CPU CYCLES 300,000,000 240,000,000 225,000,000 150,000,000 75,000,000 41,000,000 3 14 250 L1 0 L2 RAM Source: Ryan Dahl's 2008.11.08 presentation on Node.js DISK NETWORK
  • 5. waiting ... ROUTE REQUEST QUERY DB OR WEB SERVICE OPERACJE I/O ZAJMUJĄ O WIELE WIĘCEJ CZASU NIŻ INNE OPERACJE W TWOJEJ APLIKACJI PROCESS RESULT WRITE TO LOG FILE STANDARDOWE APLIKACJE POSIADAJĄCE OPERACJE I/O CZEKAJĄ PRZEZ WIĘKSZOŚĆ CZASU FORMAL RESPONSE Source: Ryan Dahl's 2008.11.08 presentation on Node.js
  • 6. skalowalnie przy użyciu wątków THREAD 1 THREAD 2 THREAD 3 THREAD 4 Source: Ryan Dahl's 2008.11.08 presentation on Node.js OBSŁUGA WĄTKÓW PRZEZ SYSTEM OS JEST “DROGA” ALOKACJA PAMIĘCI, “CONTEXT SWITCHING” I CZEKANIE NA WYKONANIE SIĘ OPERACJI I/O SZTUCZNE OGRANICZENIE ILOŚCI JEDNOCZESNYCH POŁĄCZEO
  • 7. skalowalnie przy użyciu “Event Loop” PROCESS 1 NETWORK FILESYSTEM Thread Pool and Async I/I APIs JEDEN WĄTEK W CAŁEJ APLIKACJI DELEGUJE OPERACJE I/O MECHANIZMOWI “THREADPOOL” Source: Ryan Dahl's 2008.11.08 presentation on Node.js
  • 8. event loop thread pool event queue NODE.JS KORZYSTA Z BIBLIOTEKI LIBEV DO OBSŁUGI MECHANIZMU EVENT-LOOP filesystem EVENT LOOP network process other PO WYKONANIU SIĘ OPERACJI I/O, ZA POMOCĄ MECHANIZMU “CALLBACK” WYNIK ZOSTAJE PRZEKAZANY SPOWROTEM DO GŁÓWNEGO WĄTKU APLIKACJI Source: Ryan Dahl's 2008.11.08 presentation on Node.js
  • 9. platforma • • • V8 JAVASCRIPT VIRTUAL MACHINE Java Script NODE STANDARD LIBRARY NODE BINDINGS LIBEIO (THREAD POOL) LIBEV (EVENT LOOP) C V8 Thread Pool (libeio) Event Loop (livev)
  • 10. problemy i wyzwania thread pool NIESTABILNE MODUŁY API TRUDNY W DEBUGOWANIU event queue filesystem EVENT LOOP network process other MAŁO DOŚWIADCZONYCH SPECJALISTÓW NA RYNKU JEST DODATKOWYM RYZYKIEM DLA FIRM CHCĄCYCH UŻYWAD NODE.JS W CELACH KOMERCYJNYCH 0:2 Source: Ryan Dahl's 2008.11.08 presentation on Node.js
  • 11. popularność Job trends from indeed.com NODES PHP JAVA PYTHON RUBY .NET 12,000 11,000 10,000 9,000 8,000 7,000 6,000 5,000 4,000 3,000 2,000 1,000 0 Jan ’06 Jan ’07 PONAD 1000 OSÓB ONLINE NA IRC'U NODE.JS Jan ’08 Jan ’09 Jan ’10 OGROMNY WZROST ZAINTERESOWANIA W OSTATNICH 3 LATACH Jan ’11 Jan ’12 Jan ’13 O WIELE WIĘKSZY POPYT NIŻ PODAŻ W WIĘKSZYCH HUB'ACH TECHNOLOGICZNYCH (NP. LONDYN, SAN FRANCISCO)
  • 12. popularność_2 Module counts Rubygems.org PyPl php nuget Node.js 80000 70000 60000 50000 40000 30000 20000 10000 0 Jul 2010 Jan 2011 ILOŚD MODUŁÓW ZWIĘKSZA SIĘ DRAMATYCZNIE (ŻÓŁTA LINIA) Jul 2011 Jan 2012 Jul 2012 POPULARNOŚD NODE.JS W RASBERRY PI ( INTERNET OF THINGS ) Jan 2013 Jul 2013 Jan 2014 NIESTETY JAKOŚD MODUŁÓW MA WIELE DO ŻYCZENIA ( POTRZEBA CZASU )
  • 13. PayPal: Node.js vs. Java Java application 14 2000 Node.js application 1800 12 1400 10 8 25 1000 20 1000 800 6 800 600 15 600 4 10 400 400 2 200 0 0 1 5 10 Pages/sec Account response time (ms) 1200 5 200 0 0 15 Pages/sec 1 /home /wallet 5 10 /activity 15 20 25 Pages/sec 1400 30 1200 1600
  • 14. PayPal: Node.js vs. Java PAYPAL'S “ACCOUNT OVERVIEW” “BUILT ALMOST TWICE AS FAST WITH FEWER PEOPLE” “WRITTEN IN 33% FEWER LINES OF CODE” “CONSTRUCTED WITH 40% FEWER FILES”
  • 15. estimote ( Kraków,PL ) SZUKAJĄ LUDZI DO BUDOWANIA ICH API W NODE.JS ZNALEZIENIE KOGOŚ Z 3 LETNIM DOŚWIADCZENIEM W NODE.JS JEST NAPRAWDĘ HARDDD W POLSCE... :-)
  • 16. sails.js “MVC PATTERN” WZOROWANY NA ROR'ZE WSPIERA BUDOWANIE APLIKACJI RESTOWYCH SZYBKIE DEMO
  • 17. Dziękuję :-) Reach me at kamil.przeorski@skygatedigital.co.uk Meet.js Katowice – 5 lutego 2014 – Kamil PrzeoRski www.facebook.com/groups/nodejsPL