Node JS: Advanced Concepts

Node JS: Advanced Concepts

English | MP4 | AVC 1920×1080 | AAC 44KHz 2ch | 177 Lessons (16h 5m) | 8.67 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.

Who this course is for:

  • Anyone who wants a deep mastery of Node
  • Engineers looking to understand the internals of Node
  • Programmers looking to improve Node’s performance
Table of Contents

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

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

Project Setup
38 The Next Phase
39 Starter Project Files – boilerplate
40 Project Walkthrough
41 Key Customization
42 MongoDB Altas Setup and Configuration
43 MongoDB Creation
44 Routes Walkthrough

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

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

Wiring Up Continuous Integration
128 Introduction to CI
129 CI Providers
130 The Basics of YAML Files
131 Github Actions instead of Travis for CI
132 Travis YAML Setup
133 More Travis YAML
134 Client Builds
135 Script Config
136 Using Travis Documentation
137 More Server Configuration
138 Note – Travis Update
139 A Touch More Configuration
140 Git Repo Setup
141 Travis CI Setup
142 Triggering CI Builds
143 Build Success
144 Completed Code Checkpoint – ci-checkpoint

Scalable Image – File Upload
145 Image Upload
146 Big Issues Around Image Upload
147 Alternate Image Upload
148 Chosen Storage Solution
149 Upload Constraints
150 Image File Transport
151 Upload Flow with AWS S3
152 Details of the Presigned URL
153 Security Issues Solved with Presigned URL’s
154 Adding an Image Picker
155 Handling File Changes
156 Recording Image Files
157 The SubmitBlog Function
158 AWS Credentials with IAM
159 Creating S3 Buckets
160 Allowing Actions with IAM Policies
161 Creating IAM Users
162 Upload Routes Files
163 Required update for uploadRoutes
164 Configuring the AWS SDK
165 GetSignedURL Arguments
166 Calling GetSignedURL
167 Viewing the Signed URL
168 Attempting Image Upload
169 CORS Configuration in JSON Form
170 Handling CORS Errors
171 Outstanding Issues
172 S3 Bucket Policies
173 Tying Uploads to Blogs
174 Ensuring Images get Tied
175 Displaying Images
176 Completed Code – completed

Extras
177 Bonus!

Homepage