Announcing the Node Patterns mini-book series
by YLD • February 12th, 2015 • 3min
tl;dr: New mini-book series about Node-based code and networking patterns here: http://nodepatternsbooks.com
Unlike opinionated frameworks in other languages, Node and most of Node frameworks don’t impose any back-end database, network protocols or even directory structure. It’s up to the developer to choose what they think better fits the project and the development team.
For more than six months I’ve been developing this new series of short books aiming to extract and present some of the common patterns I have used and seen used throughout several types of applications. Today I’m releasing the first batch, covering some small-scale code and large-scale networking patterns, aiming to build up a portfolio of concepts, libraries and code that I hope you find interesting and useful. Here they are:
Most applications have some type of work that can be performed independently from the client request cycle. You can defer these types of work into a memory queue or, to survive crashes, a persisted queue. A distributed queue separates the work producer from the work consumer, allowing you to perform work on a different process.
This book will show you how to create and consume work in a local or distributed environment using Node.
Any application normally needs some environment-specific configuration details: the hostname and port of the database server, the access token for the mail delivery service API and many others. Once your application starts spanning more than one machine, the distribution of the configuration can start becoming troublesome.
This book shows some approaches for managing and distributing the configuration of your Node application.
Building an application using a web framework can soon lead to one big chunk of monolithic code. This happens not because of the web framework itself, but mostly because building distributed services can be a hard task. Fortunately, Node makes it easy to build networked services, allowing you to spread your application logic into a set of processes that communicate with each other.
This book shows you how to build and consume TCP-based services like streaming services, multiplexing streams, remote emitters, RPC streams and other types of network-based servers and clients.
Databases — Volume I
Node.js has been designed to do quick and efficient network I/O. It’s event-driven streams make it ideal to be used as a kind of smart proxy, often working as the glue between back-end systems and clients. Node was originally designed with that intention in mind, but meanwhile it also has been successfully used to build traditional web applications: an HTTP server that serves HTML pages or replies JSON messages and uses a database to store the data. Even though web frameworks in other platforms and languages have preferred to stick with traditional open-source relational databases like MySQL or PostgreSQL, most of the existing Node web frameworks (like Express, Hapi and others) don’t impose any database or even any type of database at all. This bring-your-own-database approach has been in part fed by the explosion in the variety of database servers now available, but also by the ease with which the Node module system and NPM allow you to install and use third-party libraries.
In this book we will analyze some of the existing solutions for interacting with some types of databases and what interesting uses can you give them. This first short book on databases starts with some of my favourites: LevelDB, Redis and CouchDB.
Written by YLD • February 12th, 2015
Share this article