官术网_书友最值得收藏!

Chapter 1. Appreciating Node

At the time of writing this book, Node is approaching its fifth year of existence, and its usage has grown in each of those five years. The opportunity for Node to fail has come, and passed. Node is a serious technology built by a highly skilled core team and very active community focused on constantly improving its speed, security, and usefulness.

Every day, developers face some of the problems that NodeJS aims to solve. Some of them are as follows:

  • Scaling networked applications beyond a single server
  • Preventing I/O bottlenecks (database, file, and network access)
  • Monitoring system usage and performance
  • Testing the integrity of system components
  • Managing concurrency safely and reliably
  • Pushing code changes and bug fixes into live environments

In this book, we will look at techniques of deploying, scaling, monitoring, testing, and maintaining your Node applications. The focus will be on how Node's event-driven, nonblocking model can be applied in practice to these aspects of software design and deployment.

On February 28, 2014, Eran Hammer delivered the keynote address to attendees of NodeDay, a large developer conference organized and sponsored by PayPal. He began his address by reciting some numbers relevant to his employer, Walmart:

  • 11,000 stores
  • Half a trillion dollars of net sales per year
  • 2.2 million employees
  • The largest private employer in the world

He continued:

Modern network software, for various reasons, is growing in complexity and, in many ways, changing how we think about application development. Most new platforms and languages are attempting to address these changes. Node is no exception—and JavaScript is no exception.

Learning about Node means learning about event-driven programming, composing software out of modules, creating and linking data streams, and producing and consuming events and their related data. Node-based architectures are often composed of many small processes and/or services communicating with events—internally, by extending the EventEmitter interface and using callbacks and externally, over one of several common transport layers (for example, HTTP, TCP) or through a thin messaging layer covering one of these transport layers (for example, 0MQ, Redis PUBSUB, and Kafka). It is likely that these processes are composed of several free, open source, and high-quality npm modules, each distributed with unit tests and/or examples and/or documentation.

In this chapter, we will take a quick tour of Node, highlighting the problems it aims to solve, the solutions implied by its design, and what this means to you. We will also briefly discuss some of the core topics we will explore more comprehensively in later chapters, such as how to structure efficient and stable Node servers, how to make the best use of JavaScript for your application and your team, and how to think about and use Node for best results.

Let's start with understanding the how and why of Node's design.

主站蜘蛛池模板: 兴文县| 靖宇县| 那曲县| 衡阳市| 灵台县| 常熟市| 深圳市| 天水市| 安陆市| 思茅市| 盐津县| 罗城| 正定县| 阜新市| 遂昌县| 安化县| 中超| 金山区| 许昌县| 普洱| 陆河县| 双城市| 靖宇县| 泰顺县| 鄱阳县| 松溪县| 秀山| 石阡县| 山阳县| 海城市| 辛集市| 双江| 化隆| 台北市| 正宁县| 宝山区| 石嘴山市| 海南省| 朝阳市| 庐江县| 大荔县|