lt;pgt;Dưới đây là lt;stronggt;Bài 01lt;/stronggt; theo đúng phong cách của series lt;stronggt;Laravel 12 (2026)lt;/stronggt;: giải thích dễ hiểu, nhiều ví dụ thực tế, bám sát Node.js LTS năm 2026 và hướng đến mục tiêu xây dựng REST API.lt;/pgt;lt;blockquotegt;lt;pgt;lt;emgt;quot;JavaScript không còn chỉ chạy trong trình duyệt. Với Node.js, JavaScript có thể xây dựng cả những hệ thống backend hiện đại phục vụ hàng triệu người dùng.quot;lt;/emgt;lt;/pgt;lt;/blockquotegt;lt;hr /gt;lt;h1gt;Mục tiêu bài họclt;/h1gt;lt;pgt;Sau bài học này bạn sẽ hiểu được:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;Node.js là gì?lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;JavaScript Runtime là gì?lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;V8 Engine hoạt động như thế nào?lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Event Loop là gì?lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Non-blocking I/O là gì?lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Khi nào nên dùng Node.js?lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Khi nào không nên dùng Node.js?lt;br /gt;lt;br /gt;lt;/pgt;lt;div class=quot;separatorquot; style=quot;clear: both; text-align: center;quot;gt;lt;a href=quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrBfN3BuzIKRsExOq5WfLS8HC3DyYzD1jjdytZcht7s7UZq7qRW-jBgRLEHG2NiBD5ODpmffCdFS4sPb2lgeE05y1N7SvgH-crAKTZpwt7HLT6Vq-Hozf5f5gSXWobSzbjqqB3P7e3D1pBOwjbTZaemtNnQF1f-a1krXkZfUsO9URqTI5lmEqSRvjV-uQ/s1402/bai01.pngquot; style=quot;margin-left: 1em; margin-right: 1em;quot;gt;lt;img border=quot;0quot; data-original-height=quot;1122quot; data-original-width=quot;1402quot; height=quot;256quot; src=quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrBfN3BuzIKRsExOq5WfLS8HC3DyYzD1jjdytZcht7s7UZq7qRW-jBgRLEHG2NiBD5ODpmffCdFS4sPb2lgeE05y1N7SvgH-crAKTZpwt7HLT6Vq-Hozf5f5gSXWobSzbjqqB3P7e3D1pBOwjbTZaemtNnQF1f-a1krXkZfUsO9URqTI5lmEqSRvjV-uQ/s320/bai01.pngquot; width=quot;320quot; /gt;lt;/agt;lt;/divgt;lt;spangt;lt;/spangt;lt;pgt;lt;/pgt;lt;a name=#39;more#39;gt;lt;/agt;lt;pgt;lt;/pgt;lt;/ligt;lt;/ulgt;lt;hr /gt;lt;h1gt;JavaScript trước khi có Node.jslt;/h1gt;lt;pgt;Trong nhiều năm, JavaScript chỉ chạy bên trong trình duyệt.lt;/pgt;lt;pgt;Ví dụ:lt;/pgt;lt;pregt;lt;code class=quot;language-javascriptquot;gt;alert(quot;Hello Worldquot;);
lt;/codegt;lt;/pregt;lt;pgt;hoặclt;/pgt;lt;pregt;lt;code class=quot;language-javascriptquot;gt;document.getElementById(quot;titlequot;);
lt;/codegt;lt;/pregt;lt;pgt;Các đoạn mã trên chỉ hoạt động khi có trình duyệt như:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;Chromelt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Firefoxlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Edgelt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Safarilt;/pgt;lt;/ligt;lt;/ulgt;lt;pgt;JavaScript lúc này chủ yếu dùng để:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;xử lý giao diệnlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;tạo hiệu ứnglt;/pgt;lt;/ligt;lt;ligt;lt;pgt;kiểm tra dữ liệu nhậplt;/pgt;lt;/ligt;lt;ligt;lt;pgt;tương tác với người dùnglt;/pgt;lt;/ligt;lt;/ulgt;lt;pgt;Nó lt;stronggt;không thểlt;/stronggt;:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;đọc file trên máy chủlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;kết nối cơ sở dữ liệult;/pgt;lt;/ligt;lt;ligt;lt;pgt;tạo Web Serverlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;xây dựng REST APIlt;/pgt;lt;/ligt;lt;/ulgt;lt;pgt;Backend khi đó thường được viết bằng:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;PHPlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Javalt;/pgt;lt;/ligt;lt;ligt;lt;pgt;C#lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Pythonlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Rubylt;/pgt;lt;/ligt;lt;/ulgt;lt;hr /gt;lt;h1gt;Node.js ra đờilt;/h1gt;lt;pgt;Năm lt;stronggt;2009lt;/stronggt;, lt;codegt;Ryan Dahllt;/codegt; giới thiệu Node.js.lt;/pgt;lt;pgt;Ý tưởng rất đơn giản:lt;/pgt;lt;blockquotegt;lt;pgt;lt;stronggt;Tại sao JavaScript chỉ được chạy trong trình duyệt?lt;/stronggt;lt;/pgt;lt;/blockquotegt;lt;pgt;Nếu JavaScript có thể chạy trực tiếp trên hệ điều hành thì sao?lt;/pgt;lt;pgt;Đó chính là Node.js.lt;/pgt;lt;hr /gt;lt;h1gt;Node.js là gì?lt;/h1gt;lt;pgt;Node.js là một lt;stronggt;JavaScript Runtimelt;/stronggt; cho phép chạy JavaScript bên ngoài trình duyệt.lt;/pgt;lt;pgt;Ví dụ:lt;/pgt;lt;pregt;lt;code class=quot;language-javascriptquot;gt;console.log(quot;Hello Node.jsquot;);
lt;/codegt;lt;/pregt;lt;pgt;Lưu vào file:lt;/pgt;lt;pregt;lt;codegt;app.js
lt;/codegt;lt;/pregt;lt;pgt;Chạy:lt;/pgt;lt;pregt;lt;code class=quot;language-bashquot;gt;node app.js
lt;/codegt;lt;/pregt;lt;pgt;Kết quả:lt;/pgt;lt;pregt;lt;codegt;Hello Node.js
lt;/codegt;lt;/pregt;lt;pgt;Không cần Chrome.lt;/pgt;lt;pgt;Không cần Firefox.lt;/pgt;lt;pgt;Không cần HTML.lt;/pgt;lt;pgt;Chỉ cần Node.js.lt;/pgt;lt;hr /gt;lt;h1gt;JavaScript Runtime là gì?lt;/h1gt;lt;pgt;Runtime là môi trường thực thi chương trình.lt;/pgt;lt;pgt;Ví dụ:lt;/pgt;lt;pgt;PHP cần:lt;/pgt;lt;pregt;lt;codegt;PHP Runtime
lt;/codegt;lt;/pregt;lt;pgt;Java cần:lt;/pgt;lt;pregt;lt;codegt;JVM
lt;/codegt;lt;/pregt;lt;pgt;Python cần:lt;/pgt;lt;pregt;lt;codegt;Python Interpreter
lt;/codegt;lt;/pregt;lt;pgt;JavaScript trong trình duyệt cần:lt;/pgt;lt;pregt;lt;codegt;Chrome Runtime
lt;/codegt;lt;/pregt;lt;pgt;JavaScript trên máy chủ cần:lt;/pgt;lt;pregt;lt;codegt;Node.js Runtime
lt;/codegt;lt;/pregt;lt;pgt;Node.js bổ sung rất nhiều khả năng mà trình duyệt không có.lt;/pgt;lt;pgt;Ví dụ:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;đọc filelt;/pgt;lt;/ligt;lt;ligt;lt;pgt;ghi filelt;/pgt;lt;/ligt;lt;ligt;lt;pgt;tạo serverlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;kết nối databaselt;/pgt;lt;/ligt;lt;ligt;lt;pgt;tạo REST APIlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;chạy script tự độnglt;/pgt;lt;/ligt;lt;/ulgt;lt;hr /gt;lt;h1gt;Node.js không phải là ngôn ngữ mớilt;/h1gt;lt;pgt;Đây là điều rất nhiều người mới học hiểu nhầm.lt;/pgt;lt;pgt;Node.js lt;stronggt;không phảilt;/stronggt; một ngôn ngữ lập trình.lt;/pgt;lt;pgt;Bạn vẫn viết:lt;/pgt;lt;pregt;lt;code class=quot;language-javascriptquot;gt;const age = 20;
lt;/codegt;lt;/pregt;lt;pgt;không phải:lt;/pgt;lt;pregt;lt;codegt;NodeScript
lt;/codegt;lt;/pregt;lt;pgt;haylt;/pgt;lt;pregt;lt;codegt;Node Language
lt;/codegt;lt;/pregt;lt;pgt;Node.js chỉ là môi trường chạy JavaScript.lt;/pgt;lt;hr /gt;lt;h1gt;V8 Enginelt;/h1gt;lt;pgt;Node.js sử dụng lt;stronggt;V8 Enginelt;/stronggt;.lt;/pgt;lt;pgt;Đây cũng chính là engine đang chạy bên trong trình duyệt Google Chrome.lt;/pgt;lt;pgt;Quy trình hoạt động:lt;/pgt;lt;pregt;lt;codegt;JavaScript
│
▼
V8 Engine
│
▼
Machine Code
│
▼
CPU
lt;/codegt;lt;/pregt;lt;pgt;Nhờ V8, JavaScript được biên dịch và tối ưu rất nhanh, thay vì chỉ được thông dịch từng dòng.lt;/pgt;lt;pgt;Ưu điểm:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;tốc độ caolt;/pgt;lt;/ligt;lt;ligt;lt;pgt;tối ưu bộ nhớlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;hiệu năng tốtlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;được Google phát triển liên tụclt;/pgt;lt;/ligt;lt;/ulgt;lt;hr /gt;lt;h1gt;Node.js bổ sung những gì?lt;/h1gt;lt;pgt;Trình duyệt chỉ cung cấp:lt;/pgt;lt;pregt;lt;code class=quot;language-javascriptquot;gt;document
window
localStorage
lt;/codegt;lt;/pregt;lt;pgt;Node.js cung cấp thêm rất nhiều API hệ thống:lt;/pgt;lt;pregt;lt;code class=quot;language-javascriptquot;gt;fs
path
http
https
os
crypto
stream
process
lt;/codegt;lt;/pregt;lt;pgt;Ví dụ đọc file:lt;/pgt;lt;pregt;lt;code class=quot;language-javascriptquot;gt;const fs = require(quot;fsquot;);
const data = fs.readFileSync(quot;hello.txtquot;, quot;utf8quot;);
console.log(data);
lt;/codegt;lt;/pregt;lt;pgt;Điều này trình duyệt không thể làm vì lý do bảo mật.lt;/pgt;lt;hr /gt;lt;h1gt;Event Looplt;/h1gt;lt;pgt;Một trong những điểm đặc biệt nhất của Node.js là lt;stronggt;Event Looplt;/stronggt;.lt;/pgt;lt;pgt;Thay vì tạo nhiều luồng xử lý cho mỗi yêu cầu, Node.js sử dụng:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;một luồng JavaScript chínhlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Event Looplt;/pgt;lt;/ligt;lt;ligt;lt;pgt;các API bất đồng bộ của hệ điều hànhlt;/pgt;lt;/ligt;lt;/ulgt;lt;pgt;Mô hình đơn giản:lt;/pgt;lt;pregt;lt;code class=quot;language-textquot;gt;Request
│
▼
Event Loop
│
▼
Async Operation
│
▼
Callback
lt;/codegt;lt;/pregt;lt;pgt;Nhờ vậy Node.js có thể xử lý hàng nghìn kết nối đồng thời mà không cần tạo hàng nghìn luồng.lt;/pgt;lt;pgt;Đây là nền tảng cho hiệu năng cao của Node.js trong các ứng dụng mạng.lt;/pgt;lt;hr /gt;lt;h1gt;Non-blocking I/Olt;/h1gt;lt;pgt;Đây là khái niệm quan trọng nhất của Node.js.lt;/pgt;lt;pgt;Giả sử đọc một file rất lớn.lt;/pgt;lt;pgt;Nếu chương trình phải chờ đọc xong mới làm việc tiếp thì gọi là:lt;/pgt;lt;pregt;lt;codegt;Blocking I/O
lt;/codegt;lt;/pregt;lt;pgt;Ví dụ:lt;/pgt;lt;pregt;lt;codegt;Đọc file...
(chờ)
(chờ)
(chờ)
Đọc xong
lt;/codegt;lt;/pregt;lt;pgt;Trong thời gian chờ, chương trình không thể xử lý công việc khác.lt;/pgt;lt;pgt;Ngược lại, với Node.js:lt;/pgt;lt;pregt;lt;codegt;Đọc file
↓
Tiếp tục xử lý yêu cầu khác
↓
File đọc xong
↓
Thông báo kết quả
lt;/codegt;lt;/pregt;lt;pgt;Đó gọi là:lt;/pgt;lt;pregt;lt;codegt;Non-blocking I/O
lt;/codegt;lt;/pregt;lt;pgt;Chính cơ chế này giúp Node.js rất mạnh trong các ứng dụng có nhiều kết nối đồng thời.lt;/pgt;lt;hr /gt;lt;h1gt;Node.js phù hợp với những gì?lt;/h1gt;lt;pgt;Node.js đặc biệt phù hợp với:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;REST APIlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Backend Weblt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Chat Realtimelt;/pgt;lt;/ligt;lt;ligt;lt;pgt;WebSocketlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Dashboardlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Streaminglt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Proxy Serverlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Microserviceslt;/pgt;lt;/ligt;lt;ligt;lt;pgt;API Gatewaylt;/pgt;lt;/ligt;lt;ligt;lt;pgt;IoTlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Serverless Functionslt;/pgt;lt;/ligt;lt;/ulgt;lt;pgt;Ví dụ:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;Hệ thống bán hànglt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Quản lý nhân sựlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;CRMlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;ERPlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Mạng xã hộilt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Hệ thống chatlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Ứng dụng học trực tuyếnlt;/pgt;lt;/ligt;lt;/ulgt;lt;hr /gt;lt;h1gt;Khi nào không nên dùng Node.js?lt;/h1gt;lt;pgt;Không phải dự án nào cũng phù hợp.lt;/pgt;lt;pgt;Ví dụ các tác vụ tính toán nặng như:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;xử lý ảnh hàng loạtlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;dựng videolt;/pgt;lt;/ligt;lt;ligt;lt;pgt;AI Traininglt;/pgt;lt;/ligt;lt;ligt;lt;pgt;mô phỏng vật lýlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;tính toán khoa họclt;/pgt;lt;/ligt;lt;/ulgt;lt;pgt;Nếu một tác vụ chiếm CPU trong thời gian dài, luồng JavaScript chính sẽ bị bận, làm giảm khả năng phản hồi của ứng dụng.lt;/pgt;lt;pgt;Trong những trường hợp này, thường sẽ kết hợp Node.js với các tiến trình riêng, Worker Threads hoặc sử dụng các ngôn ngữ phù hợp hơn cho phần tính toán.lt;/pgt;lt;hr /gt;lt;h1gt;Node.js trong hệ sinh thái năm 2026lt;/h1gt;lt;pgt;Ngày nay Node.js là nền tảng của rất nhiều công nghệ phổ biến:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;Express.jslt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Fastifylt;/pgt;lt;/ligt;lt;ligt;lt;pgt;NestJSlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Prisma ORMlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;TypeScriptlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Next.jslt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Vitelt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Electronlt;/pgt;lt;/ligt;lt;/ulgt;lt;pgt;Trong khóa học này, chúng ta sẽ tập trung vào việc xây dựng backend hiện đại với:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;Node.js LTSlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Express 5lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Prisma ORMlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;PostgreSQLlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;MongoDBlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;JWT Authenticationlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Dockerlt;/pgt;lt;/ligt;lt;ligt;lt;pgt;PM2lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Nginxlt;/pgt;lt;/ligt;lt;/ulgt;lt;pgt;Đây cũng là nền tảng để học tiếp các kiến trúc nâng cao như Microservices, GraphQL và triển khai ứng dụng lên môi trường Production.lt;/pgt;lt;hr /gt;lt;h1gt;Tổng kếtlt;/h1gt;lt;pgt;Qua bài học này, bạn đã biết:lt;/pgt;lt;ulgt;lt;ligt;lt;pgt;✅ Node.js là JavaScript Runtime chạy ngoài trình duyệt.lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;✅ Node.js sử dụng V8 Engine để thực thi JavaScript với hiệu năng cao.lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;✅ Event Loop và Non-blocking I/O là hai nền tảng quan trọng giúp Node.js xử lý nhiều kết nối đồng thời.lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;✅ Node.js rất phù hợp để xây dựng REST API, backend web và các ứng dụng realtime.lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;✅ Đây là nền tảng của nhiều framework hiện đại như Express, NestJS và Fastify.lt;/pgt;lt;/ligt;lt;/ulgt;lt;hr /gt;lt;h1gt;Bài tập thực hànhlt;/h1gt;lt;pgt;lt;stronggt;Bài 1lt;/stronggt;lt;/pgt;
lt;pgt;Tìm hiểu lịch sử ra đời của Node.js và cho biết vì sao nó đã thay đổi cách xây dựng ứng dụng web phía máy chủ.lt;/pgt;
lt;p style=quot;background-color: white; box-sizing: inherit; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;quot;gt;Năm lt;strong style=quot;box-sizing: inherit;quot;gt;2009lt;/stronggt;, lt;codegt;Ryan Dahllt;/codegt; giới thiệu Node.js.lt;/pgt;lt;p style=quot;background-color: white; box-sizing: inherit; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;quot;gt;Ý tưởng rất đơn giản:lt;/pgt;lt;blockquote style=quot;background-color: white; box-sizing: inherit; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;quot;gt;lt;p style=quot;box-sizing: inherit;quot;gt;lt;strong style=quot;box-sizing: inherit;quot;gt;Tại sao JavaScript chỉ được chạy trong trình duyệt?lt;/stronggt;lt;/pgt;lt;/blockquotegt;lt;p style=quot;background-color: white; box-sizing: inherit; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;quot;gt;Nếu JavaScript có thể chạy trực tiếp trên hệ điều hành thì sao?lt;/pgt;lt;p style=quot;background-color: white; box-sizing: inherit; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;quot;gt;Đó chính là Node.js.lt;/pgt;lt;p style=quot;background-color: white; box-sizing: inherit; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;quot;gt;Node.js sử dụng lt;strong data-end=quot;534quot; data-start=quot;486quot;gt;một luồng JavaScript chính (single-threaded)lt;/stronggt; kết hợp với lt;strong data-end=quot;561quot; data-start=quot;547quot;gt;Event Looplt;/stronggt; và các API bất đồng bộ để xử lý rất nhiều kết nối cùng lúc.lt;/pgt;lt;p style=quot;background-color: white; box-sizing: inherit; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;quot;gt;lt;br /gt;lt;/pgt;lt;pgt;lt;stronggt;Bài 2lt;/stronggt;lt;/pgt;lt;pgt;Phân biệt JavaScript chạy trong trình duyệt và JavaScript chạy bằng Node.js.lt;/pgt;lt;p style=quot;background-color: white; box-sizing: inherit; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;quot;gt;JavaScript chạy trong trình duyệt chủ yếu dùng để:lt;/pgt;lt;ul style=quot;background-color: white; box-sizing: inherit; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px; line-height: 1.4; list-style: disc; margin: 0.5em 0px; padding: 0px 2.5em;quot;gt;lt;li style=quot;border-color: currentcolor; border-image: initial; border-style: none; border-width: medium; box-sizing: inherit; margin: 0px 0px 0.25em; padding: 0px;quot;gt;lt;p style=quot;box-sizing: inherit;quot;gt;xử lý giao diệnlt;/pgt;lt;/ligt;lt;li style=quot;border-color: currentcolor; border-image: initial; border-style: none; border-width: medium; box-sizing: inherit; margin: 0px 0px 0.25em; padding: 0px;quot;gt;lt;p style=quot;box-sizing: inherit;quot;gt;tạo hiệu ứnglt;/pgt;lt;/ligt;lt;li style=quot;border-color: currentcolor; border-image: initial; border-style: none; border-width: medium; box-sizing: inherit; margin: 0px 0px 0.25em; padding: 0px;quot;gt;lt;p style=quot;box-sizing: inherit;quot;gt;kiểm tra dữ liệu nhậplt;/pgt;lt;/ligt;lt;li style=quot;border-color: currentcolor; border-image: initial; border-style: none; border-width: medium; box-sizing: inherit; margin: 0px 0px 0.25em; padding: 0px;quot;gt;lt;p style=quot;box-sizing: inherit;quot;gt;tương tác với người dùnglt;/pgt;lt;/ligt;lt;/ulgt;lt;p style=quot;background-color: white; box-sizing: inherit; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;quot;gt;NodeJS:lt;/pgt;lt;ul style=quot;background-color: white; box-sizing: inherit; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px; line-height: 1.4; list-style: disc; margin: 0.5em 0px; padding: 0px 2.5em;quot;gt;lt;li style=quot;border-color: currentcolor; border-image: initial; border-style: none; border-width: medium; box-sizing: inherit; margin: 0px 0px 0.25em; padding: 0px;quot;gt;lt;p style=quot;box-sizing: inherit;quot;gt;đọc file trên máy chủlt;/pgt;lt;/ligt;lt;li style=quot;border-color: currentcolor; border-image: initial; border-style: none; border-width: medium; box-sizing: inherit; margin: 0px 0px 0.25em; padding: 0px;quot;gt;lt;p style=quot;box-sizing: inherit;quot;gt;kết nối cơ sở dữ liệult;/pgt;lt;/ligt;lt;li style=quot;border-color: currentcolor; border-image: initial; border-style: none; border-width: medium; box-sizing: inherit; margin: 0px 0px 0.25em; padding: 0px;quot;gt;lt;p style=quot;box-sizing: inherit;quot;gt;tạo Web Serverlt;/pgt;lt;/ligt;lt;li style=quot;border-color: currentcolor; border-image: initial; border-style: none; border-width: medium; box-sizing: inherit; margin: 0px 0px 0.25em; padding: 0px;quot;gt;lt;p style=quot;box-sizing: inherit;quot;gt;xây dựng REST APIlt;/pgt;lt;/ligt;lt;/ulgt;lt;tablegt;lt;theadgt;lt;trgt;lt;thgt;JavaScript Browserlt;/thgt;lt;thgt;Node.jslt;/thgt;lt;/trgt;lt;/theadgt;lt;tbodygt;lt;trgt;lt;tdgt;DOMlt;/tdgt;lt;tdgt;Không có DOMlt;/tdgt;lt;/trgt;lt;trgt;lt;tdgt;windowlt;/tdgt;lt;tdgt;Không có windowlt;/tdgt;lt;/trgt;lt;trgt;lt;tdgt;documentlt;/tdgt;lt;tdgt;Không có documentlt;/tdgt;lt;/trgt;lt;trgt;lt;tdgt;alert()lt;/tdgt;lt;tdgt;Không cólt;/tdgt;lt;/trgt;lt;trgt;lt;tdgt;fslt;/tdgt;lt;tdgt;Cólt;/tdgt;lt;/trgt;lt;trgt;lt;tdgt;httplt;/tdgt;lt;tdgt;Cólt;/tdgt;lt;/trgt;lt;trgt;lt;tdgt;processlt;/tdgt;lt;tdgt;Cólt;/tdgt;lt;/trgt;lt;/tbodygt;lt;/tablegt;lt;pgt;lt;stronggt;lt;br /gt;lt;/stronggt;lt;/pgt;lt;pgt;lt;stronggt;Bài 3lt;/stronggt;lt;/pgt;lt;pgt;Giải thích bằng lời của bạn:lt;/pgt;lt;ul style=quot;text-align: left;quot;gt;lt;ligt;lt;pgt;JavaScript Runtime là gì?lt;br /gt;lt;br /gt;lt;strong data-end=quot;1210quot; data-start=quot;1147quot;gt;JavaScript Runtime là môi trường để thực thi mã JavaScript.lt;/stronggt; lt;br /gt;Ví dụ: Chrome Runtime hoặc Node.js Runtime.lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;V8 Engine là gì?lt;br /gt;lt;br /gt;V8 là engine của Google dùng để lt;bgt;biên dịchlt;/bgt; JavaScript thành mã máy giúp chạy nhanh hơn.lt;/pgt;lt;/ligt;lt;ligt;lt;pgt;Event Loop là gì?lt;br /gt;1. JavaScript chạy trên lt;strong data-end=quot;2966quot; data-start=quot;2947quot;gt;một luồng chínhlt;/stronggt;.lt;br /gt;lt;br /gt;2. Các tác vụ I/O được thực hiện bất đồng bộ với sự hỗ trợ của hệ điều hành và lt;code data-end=quot;3053quot; data-start=quot;3046quot;gt;libuvlt;/codegt;.lt;br /gt;lt;br /gt;3. Event Loop điều phối khi nào các callback hoặc promise tiếp tục được thực thi.lt;/pgt;lt;/ligt;lt;/ulgt;lt;ul style=quot;text-align: left;quot;gt;lt;ligt;lt;pgt;Non-blocking I/O là gì?lt;br /gt;lt;br /gt;Không phải chờ thao tác I/O hoàn thành mới tiếp tục chạy chương trình; trong lúc chờ, Node.js có thể xử lý các công việc khác.lt;/pgt;lt;/ligt;lt;/ulgt;lt;pgt;lt;stronggt;Bài 4lt;/stronggt;lt;/pgt;lt;pgt;Hãy liệt kê ít nhất lt;stronggt;5 loại ứng dụnglt;/stronggt; mà theo bạn Node.js là một lựa chọn phù hợp, và giải thích ngắn gọn lý do.lt;br /gt;lt;/pgt;lt;ol style=quot;text-align: left;quot;gt;lt;li data-end=quot;2457quot; data-section-id=quot;cf9zyxquot; data-start=quot;2411quot;gt;lt;strong data-end=quot;2425quot; data-start=quot;2413quot;gt;REST APIlt;/stronggt;: xử lý nhiều request đồng thời.lt;span aria-hidden=quot;truequot; class=quot;PDq2pG_selectionAnchorquot;gt;lt;/spangt;
lt;/ligt;
lt;li data-end=quot;2519quot; data-section-id=quot;foiygkquot; data-start=quot;2458quot;gt;
lt;strong data-end=quot;2477quot; data-start=quot;2460quot;gt;Chat Realtimelt;/stronggt;: kết hợp WebSocket cho trao đổi tức thời.
lt;/ligt;
lt;li data-end=quot;2580quot; data-section-id=quot;9x9f67quot; data-start=quot;2520quot;gt;
lt;strong data-end=quot;2535quot; data-start=quot;2522quot;gt;Streaminglt;/stronggt;: hỗ trợ Stream giúp truyền dữ liệu hiệu quả.
lt;/ligt;
lt;li data-end=quot;2624quot; data-section-id=quot;u36kofquot; data-start=quot;2581quot;gt;
lt;strong data-end=quot;2590quot; data-start=quot;2583quot;gt;IoTlt;/stronggt;: xử lý nhiều kết nối từ thiết bị.
lt;/ligt;
lt;li data-end=quot;2701quot; data-section-id=quot;7shujyquot; data-start=quot;2625quot;gt;
lt;strong data-end=quot;2651quot; data-start=quot;2627quot;gt;Serverless Functionslt;/stronggt;: khởi động nhanh, phù hợp cho các hàm xử lý ngắn.lt;/ligt;lt;/olgt;lt;pgt;lt;/pgt;lt;hr /gt;lt;pgt;📖 lt;a href=quot;http://www.lophocvitinh.com/2026/07/bai-02-cai-at-nodejs-lts-2026.htmlquot; target=quot;_blankquot;gt;lt;stronggt;Bài tiếp theo:lt;/stronggt; lt;/agt;lt;stronggt;lt;a href=quot;http://www.lophocvitinh.com/2026/07/bai-02-cai-at-nodejs-lts-2026.htmlquot; target=quot;_blankquot;gt;Bài 02 — Cài đặt Node.js LTS (2026): Node.js, npm, npx, VS Code và Terminallt;/agt;.lt;/stronggt;lt;/pgt;x1lt;br /gt;lt;pgt;quay vềlt;stronggt; lt;a href=quot;http://www.lophocvitinh.com/2026/08/nodejs-2026-tu-javascript-en-backend.htmlquot; target=quot;_blankquot;gt;MỤC LỤClt;/agt;lt;/stronggt;lt;/pgt;