Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Node.js

You're reading from   Mastering Node.js Expert techniques for building fast servers and scalable, real-time network applications with minimal effort

Arrow left icon
Product type Paperback
Published in Nov 2013
Publisher Packt
ISBN-13 9781782166320
Length 346 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Sandro Pasquali Sandro Pasquali
Author Profile Icon Sandro Pasquali
Sandro Pasquali
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Understanding the Node Environment 2. Understanding Asynchronous Event-Driven Programming FREE CHAPTER 3. Streaming Data Across Nodes and Clients 4. Using Node to Access the Filesystem 5. Managing Many Simultaneous Client Connections 6. Creating Real-time Applications 7. Utilizing Multiple Processes 8. Scaling Your Application 9. Testing your Application A. Organizing Your Work B. Introducing the Path Framework C. Creating your own C++ Add-ons Index

What this book covers

Chapter 1, Understanding the Node Environment, gives a brief description of the particular problems Node attempts to solve, with a focus on how its single-threaded event-loop is designed, implemented, and used. We will also learn about how Google's V8 engine can be configured and managed, as well as best practices when building Node programs.

Chapter 2, Understanding Asynchronous Event-Driven Programming, digs deep into the fundamental characteristic of Node's design: event-driven, asynchronous programming. By the end of this chapter you will understand how events, callbacks, and timers are used in Node, as well as how the event loop works to enable high-speed I/O across filesystems, networks, and processes.

Chapter 3, Streaming Data Across Nodes and Clients, describes how streams of I/O data are knitted through most network software, emitted by file servers or broadcast in response to an HTTP GET request. Here we learn how Node facilitates the design, implementation, and composition of network software, using examples of HTTP servers, readable and writable file streams, and other I/O focused Node modules and patterns.

Chapter 4, Using Node to Access the Filesystem, lays out what you need to know when accessing the filesystem with Node, along with techniques for handling file uploads and other networked file operations.

Chapter 5, Managing Many Simultaneous Client Connections, shows you how Node helps in solving problems accompanying the high volume, high concurrency environments that contemporary, collaborative web applications demand. Through examples, learn how to efficiently track user state, route HTTP requests, handle sessions, and authenticate requests using the Redis database and Express web application framework.

Chapter 6, Creating Real-Time Applications, explores AJAX, Server-Sent-Events, and the WebSocket protocol, discussing their pros and cons, and how to implement each using Node. We finish the chapter by building a collaborative document editing application.

Chapter 7, Utilizing Multiple Processes, teaches how to distribute clusters of Node processes across multi-core processors, and other techniques for scaling Node applications. An investigation of the differences between programming in single and multithreaded environments leads to a discussion of how to spawn, fork, and communicate with child processes in Node, and we build an analytics tool that records, and displays, the mouse actions of multiple, simultaneous clients connected through a cluster of web sockets.

Chapter 8, Scaling Your Application, outlines some techniques for detecting when to scale, deciding how to scale, and scaling Node applications across multiple servers and cloud services, with examples including: how to use RabbitMQ as a message queue, using NGINX to proxy Node servers, and using Amazon Web Services in your application.

Chapter 9, Testing Your Application, explains how to implement unit, functional, and integration tests with Node. We will explore several testing libraries, including native Node assertion, sandboxing, and debugging modules. Examples using Grunt, Mocha, PhantomJS, and other build and testing tools accompany the discussion.

Appendix A, Organizing Your Work, gives tips on using the npm package management system. Learn how create packages, publish packages, and manage packages.

Appendix B, Introducing the Path Framework, demonstrates how to use this powerful full-stack application framework to build your next web application using only JavaScript, thanks to Node and its ability to handle thousands of simultaneously connected clients.

Appendix C, Creating Your Own C++ Add-ons, provides a brief introduction on how to build your own C++ add-ons, and how to use them from within Node.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime