22
© Copyright 2012 Avanade Inc. All Rights Reserved. The Avanade name and logo are registered trademarks in the US and other countries. var about = { Topic: ‘Node.js’, Presenter : 'Jason Park‘ } Brown Bag Session Quick tour on Node JS

Brownbag on basics of node.js

Embed Size (px)

Citation preview

Page 1: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved.The Avanade name and logo are registered trademarks in the US and other countries.

var about = {Topic: ‘Node.js’,Presenter : 'Jason Park‘

}

Brown Bag SessionQuick tour on Node JS

Page 2: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 2

Who’s talking

• Singapore Avanade App Dev family

• ASP.NET (MVC) / C# guy

• Tech lover

Page 3: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 3

What is Node JS?

• Node.js uses an event-driven, non-blocking

I/O model that makes it lightweight and

efficient, perfect for data-intensive real-time

applications that run across distributed

devices

NodeJS.org

Page 4: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 4

What is Node JS?

• 2nd most popular project in GitHub 

Page 5: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 5

What is Node JS?

• Server-side Javascript

• Event-driven

• Built on Chrome V8 engine

• NPM (like NuGet for .NET)

Page 6: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 6

What is Node JS?

Page 7: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 7

Server-Side JS?

• But wait, server-side JS[1] has been around since

1996!

• What's makes Node JS so special?

[1] Netscape Enterprise Server

Page 8: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 8

Speed

• Handles thousands of requests/sec with no

performance degradation

• Ideal for hosting a single-page application - highly

concurrent server application

Page 9: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 9

Speed

Page 10: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 10

How?

• Keep slow operations from blocking other operations

Page 11: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 11

How?

Page 12: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 12

How?

• 1 Threaded Application

PROS: Good for conceptual simplicityCONS: Bad for CPU-bound algorithm

Page 13: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 13

How?

• Traditional I/O

Page 14: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 14

How?

• JavaScript is already geared towards event-based programming

Page 15: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 15

How?

• Async I/O

No need to wait for disk.Do something else meanwhile!

Page 16: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 16

HTTP Server

Page 17: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 17

TCP Server

Page 18: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 18

 

Page 19: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 19

Consider Node JS if you

• Want to have a website handling large number of

concurrent connections

• Want to quickly build an Ajax-rich web application

• Want to learn JavaScript/Event-based programming

Page 20: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 20

Consider other options if you

• Want something mature

• Want a framework with enterprise-level security

proven in the market

• Need IDE like Visual Studio for coding

Page 21: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 21

Big Names using Node JS

• Microsoft

– Azure & WebMatrix support

• Linked In

– Mobile application running on Node JS

• Wallmart

– Mobile application running on Node JS

Page 22: Brownbag on basics of node.js

© Copyright 2012 Avanade Inc. All Rights Reserved. 22

Questions?