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

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.

主站蜘蛛池模板: 铜梁县| 龙井市| 张家港市| 孝义市| 罗城| 桐乡市| 富阳市| 夏邑县| 德阳市| 大庆市| 贵港市| 文山县| 涞源县| 长岛县| 客服| 兴安盟| 万载县| 名山县| 卢氏县| 格尔木市| 龙胜| 新兴县| 闵行区| 镶黄旗| 双峰县| 惠来县| 台中市| 漳平市| 剑川县| 宁明县| 汕头市| 新田县| 泰顺县| 巴楚县| 陆河县| 盱眙县| 石林| 电白县| 礼泉县| 中阳县| 雅安市|