Deploying Node.js
eBook - ePub

Deploying Node.js

Sandro Pasquali

Condividi libro
  1. 274 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Deploying Node.js

Sandro Pasquali

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

If you are an intermediate or advanced developer deploying your Node.js applications, then this book is for you. If you have already built a Node application or module and want to take your knowledge to the next level, this book will help you find your way.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Deploying Node.js è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Deploying Node.js di Sandro Pasquali in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatique e Informatique client-serveur. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2015
ISBN
9781783981403

Deploying Node.js


Table of Contents

Deploying Node.js
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Appreciating Node
Understanding Node's unique design
Concurrency
Parallelism and threads
Concurrency and processes
Events
The event loop
The implications of Node's design on system architects
Building large systems out of small systems
Streams
Using full-stack JavaScript to maximum effect
Hot code
Browserify
Summary
2. Installing and Virtualizing Node Servers
Getting a basic Node server up and running
Hello world
Making HTTP requests
Proxying and tunneling
HTTPS, TLS (SSL), and securing your server
Creating a self-signed certificate for development
Installing a real SSL certificate
Installing applications on Heroku
Add-ons
Git
Managing configuration variables
Managing your deployment
Installing applications on OpenShift
Installing a Node application and MongoDB
Deploying your app
Using Docker to create lightweight virtual containers
First, some Unix
Getting started with Docker
Creating a Dockerfile
Building and running a Docker image
Summary
3. Scaling Node
Scaling vertically across multiple cores
spawn(command, [arguments], [options])
fork(modulePath, [arguments], [options])
exec(command, [options], callback)
execFile
Communicating with your child process
child.connected
child.stdin
child.stdout
child.stderr
child.pid
child.kill([signal])
child.disconnect()
child.send(message, [sendHandle])
The cluster module
cluster.isMaster
cluster.isWorker
cluster.worker
cluster.workers
cluster.setupMaster([settings])
cluster.fork([env])
cluster.disconnect([callback])
cluster events
worker.id
worker.process
worker.suicide
worker.send(message, [sendHandle])
worker.kill([signal])
worker.disconnect()
Scaling horizontally across different machines
Using Nginx
Deploying an Nginx load balancer on DigitalOcean
Installing and configuring Nginx
Load balancing with Node
Using node-http-proxy
Using message queues
Using Node's UDP Module
Summary
4. Managing Memory and Space
Dealing with large crowds
Microservices
Redis pub/sub
Microservices with Seneca
Reducing memory usage
Use streams, not buffers
Understanding prototypes
Memory-efficient data structures with Redis
Using bitwise operations to analyze user actions over time
Setting, getting, and counting bits
Bitmasks and filtering results
Using HyperLogLog to count unique anonymous visitors
Taming V8 and optimizing performance
Optimizing JavaScript
Numbers and tracing optimization/de-optimization
Objects and arrays
Functions
Caching strategies
Using Redis as a cache
Deploying CloudFlare as a CDN
Managing sessions
JSON Web Token authentication and sessions
Summary
5. Monitoring Applications
Dealing with failure
The 'domain' module
Catching process errors
Logging
Logging with UDP
Logging with Morgan
Modifying behavior in changing environments
Node REPL
Remotely monitoring and managing Node processes
Profiling processes
Using third-party monitoring tools
PM2
Monitoring
Nodetime
Using New Relic for monitoring
Summary
6. Building and Testing
Building with Gulp, Browserify, and Handlebars
Using Gulp
Erecting a build scaffold
Running and testing your build
Using Node's native testing tools
The Node debugger
The 'assert' module
Testing with Mocha, Chai, Sinon, and npm
Mocha
Chai
Sinon
Spies
Stubs
Mocks
Automated browser testing with PhantomJS and CasperJS
Headless testing with PhantomJS
Navigation scenarios with CasperJS
Summary
7. Deploying and Maintaining
Using GitHub webhooks
Enabling webhooks
Implementing a build/deploy system using webhooks
Synchronizing local and deployed builds
Developing locally with Vagrant
Provisioning with Ansible
Integrating, delivering, and deploying
Continuous integration
Continuous delivery
Continuous deployment
Building and deploying with Jenkins
Deploying to Heroku
Package maintenance
Understanding Semver
Managing packages with npm
Designing a dependency tree
Summary
Index

Deploying Node.js

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: July 2015
Production reference: 1170715
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-140-3
www.packtpub.com

Credits

Author
Sandro Pasquali
Reviewers
Benjamin Bahrenburg
Nikola Brežnjak
Félix Saparelli
Jim Schubert
Commissioning Editor
Edward Gordon
Acquisition Editor
Meeta Rajani
Content Development Editor
Rohit Kumar Singh
Technical Editor
Humera Shaikh
Copy Editor
Sarang Chari
Project Coordinator
Mary Alex
Proofreader
Safis Editing
Indexer
Mariammal Chettiyar
Production Coordinator
Conidon Miranda
Cover Work
Conidon Miranda

About the Author

Sandro Pasquali, in 1997, formed Simple.com, a technology company that sold the world's first JavaScript-based application development framework and was awarded several patents for deployment and advertising technologies that anticipated the future of Internet-based software. Node represents, for him, the natural next step in the inexorable march toward the day when JavaScript powers nearly every level of software development.
Sandro has led the design of enterprise-grade applications for some of the largest companies in the world, including Nintendo, Major League Baseball, Bang and Olufsen, LimeWire, AppNexus, Conde Nast, and others. He has displayed interactive media exhibits during the Venice Biennial, won design awards, built knowledge management tools for research institutes and schools, and started...

Indice dei contenuti