Node JS: Advanced Concepts

Node JS: Advanced Concepts

English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 16 Hours | 1.76 GB

Get advanced with Node.Js! Learn caching with Redis, speed up through clustering, and add image upload with S3 and Node!

Go beyond the basics of Node! This course will give you the skills needed to become a top Node engineer.

Query Caching with Redis? You will learn it. The Node Event Loop? Included. Scalable File Upload? Of course!

This is a must-take course if you work with Node.

Node Internals: Here’s one of the most common interview questions you’ll face when looking for a Node job: “Can you explain Node’s Event Loop?” There are two types of engineers: those who can describe the Event Loop and those who cannot! This course will ensure that you are incredibly well prepared to answer that most important question. Besides being critical for interviews, knowledge of the Event Loop will give you a better understanding of how Node works internally. Many engineers know not to ‘block’ the Event Loop, but they don’t necessarily understand why. You will be one of the engineers who can clearly articulate the performance profile of Node and its Event Loop.

Caching with Redis: We’ll also supercharge the performance of database queries by implementing caching backed by Redis. No previous experience of Redis is required! Redis is an in-memory data store purpose built for solving caching needs. By adding caching to your application, you can decrease the amount of time that any given request takes, improving the overall response time of your app.

File Upload: There are many resources online that offer suggestions on how to handle file upload, but few show a solution that can truly scale. Hint: saving files directly on your server isn’t a scalable solution! Learn how to leverage AWS S3 to implement file upload that can scale to millions of users with a few dozen lines of simple code. Plentiful discussions are included on security concerns with handling uploads, as well.

Continuous Integration Testing: This is a must have feature for any serious production app. We’ll first learn how to test huge swaths of our codebase with just a few lines of code by using Puppeteer and Jest. After writing many effective tests, we’ll enable continuous integration on Travis CI, a popular – and free – CI platform. Testing can sometimes be boring, so we’ll use this section to brush up on some advanced Javascript techniques, including one of the only legitimate uses of ES2015 Proxies that you’ll ever see!

Here’s what we’ll learn:

  • Master the Node Event Loop – understand how Node executes your source code.
  • Understand the purpose of Node, and how the code you write is eventually executed by C++ code in the V8 engine
  • Add a huge boost to performance in your Node app through clustering and worker threads
  • Turbocharge MongoDB queries by adding query caching backed by a lightning-fast Redis instance
  • Scale your app to infinity with image and file upload backed by Amazon’s S3 file service
  • Implement a continuous integration testing pipeline so you always know your project functions properly
  • Think you know everything there is about managing cookies and session? Well, you might, but learn even more!
  • Ensure your app works the way you expect with automated browser testing using Jest and Puppeteer
  • Bonus – learn advanced JS techniques along the way, including where to use ES2015 proxies!

I’ve built the course that I would have wanted to take when I was learning to Node. A course that explains the concepts and how they’re implemented in the best order for you to learn and deeply understand them.

Table of Contents

The Internals of Node
1 How to Get Help
2 Is Node Single Threaded
3 Testing for Single Threads
4 The Libuv Thread Pool
5 Threadpools with Multithreading
6 Changing Threadpool Size
7 Common Threadpool Questions
8 Explaining OS Operations
9 Libuv OS Delegation
10 OSAsync Common Questions
11 Review
12 Starting With Node Internals
13 Crazy Node Behavior
14 Unexpected Event Loop Events
15 Module Implementations
16 Node Backed by C++!
17 The Basics of Threads
18 The Node Event Loop
19 The Event Loop Implementation
20 Event Loop Ticks

Enhancing Node Performance
21 Enhancing Performance
22 PM2 Installation
23 PM2 Configuration
24 Webworker Threads
25 Worker Threads in Action
26 Benchmarking Workers
27 Express Setup
28 Blocking the Event Loop
29 Clustering in Theory
30 Forking Children
31 Clustering in Action
32 Benchmarking Server Performance
33 Benchmark Refactor
34 Need More Children!

Project Setup
35 The Next Phase
36 Project Walkthrough
37 Key Customization
38 MongoDB Atlas Setup and Configuration
39 MongoDB Creation
40 Routes Walkthrough

Data Caching with Redis
41 MongoDB Query Performance
42 Promisifying a Function
43 Caching in Action
44 Caching Issues
45 The Ultimate Caching Solution
46 Patching Mongoose’s Exec
47 Restoring Blog Routes Handler
48 Unique Keys
49 Key Creation
50 Restoring Redis Config
51 Cache Implementation
52 Query Caching Layer
53 Resolving Values
54 Hydrating Models
55 Hydrating Arrays
56 Toggleable Cache
57 Cache Expiration
58 Forced Cache Expiration
59 Nested Hashes
60 Clearing Nested hashes
61 Automated Cache Clearing with Middlware
62 Redis Introduction
63 Installing Redis on MacOS
64 Redis on Windows
65 Getting and Setting Basic Values
66 Redis Hashes
67 One Redis Gotcha
68 Cache Keys

Automated Headless Browser Testing
69 Testing Flow
70 Browser Termination
71 Asserting OAuth Flow
72 Asserting URL Domain
73 Issues with OAuth
74 Solving Authentication Issues with Automation Testing
75 The Google OAuth Flow
76 Inner Workings of Sessions
77 Sessions From Another Angle
78 Session Signatures
79 Generating Sessions and Signatures
80 Testing Challenges
81 Assembling the Pieces
82 WaitFor Statements
83 Factory Functions
84 The Session Factory
85 Assembling the Session Factory
86 Code Separation
87 Global Jest Setup
88 Testing Factory Tests!
89 Adding a Login Method
90 Extending Page
91 Commands Around Testing
92 Introduction to Proxies
93 Proxies in Action
94 Combining Object Property Access
95 Combining the Page and Browser
96 Custom Page Implementation
97 Function Lookup Priority
98 Gee, I Hope This Works!
99 Reusable Functions on Page
100 Testing Blog Creation
101 Default Navigation
102 First Jest Test
103 Asserting Form Display
104 Test Timeout
105 Common Test Setup
106 Nested Describes for Structure
107 Asserting Validation Errors
108 Asserting Form Confirmation
109 Asserting Blog Creation
110 Options for Testing Prohibited Actions
111 Direct API Requests
112 Executed Arbitrary JS in Chromium
113 Launching Chromium Instances
114 Asserting Page Response
115 Get Restrictions
116 A Final ‘GET’ Test
117 Super Advanced Test Helpers
118 Chromium Navigation
119 Extracting Page Content
120 Puppeteer – Behind the Scenes
121 DRY Tests

Wiring Up Continuous Integration
122 Introduction to CI
123 Note – Travis Update
124 A Touch More Configuration
125 Git Repo Setup
126 Travis CI Setup
127 Triggering CI Builds
128 Build Success
129 CI Providers
130 The Basics of YAML Files
131 Travis YAML Setup
132 More Travis YAML
133 Client Builds
134 Script Config
135 Using Travis Documentation
136 More Server Configuration

Scalable ImageFile Upload
137 Image Upload
138 Adding an Image Picker
139 Handling File Changes
140 Recording Image Files
141 The SubmitBlog Function
142 AWS Credentials with IAM
143 Creating S3 Buckets
144 Allowing Actions with IAM Policies
145 Creating IAM Users
146 Upload Routes Files
147 Configuring the AWS SDK
148 Big Issues Around Image Upload
149 GetSignedURL Arguments
150 Calling GetSignedURL
151 Viewing the Signed URL
152 Attempting Image Upload
153 Handling CORS Errors
154 Outstanding Issues
155 S3 Bucket Policies
156 Tying Uploads to Blogs
157 Ensuring Images get Tied
158 Displaying Images
159 Alternate Image Upload
160 Bonus!
161 Chosen Storage Solution
162 Upload Constraints
163 Image File Transport
164 Upload Flow with AWS S3
165 Details of the Presigned URL
166 Security Issues Solved with Presigned URL’s