Deploying Node.js
eBook - ePub

Deploying Node.js

Sandro Pasquali

Compartir libro
  1. 274 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Deploying Node.js

Sandro Pasquali

Detalles del libro
Vista previa del libro
Índice
Citas

Información del 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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Deploying Node.js un PDF/ePUB en línea?
Sí, puedes acceder a Deploying Node.js de Sandro Pasquali en formato PDF o ePUB, así como a otros libros populares de Informatique y Informatique client-serveur. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2015
ISBN
9781783981403
Edición
1
Categoría
Informatique

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...

Índice