PageSourceSearch

https://www.lazyoffer.ru/assets/js/e3b09118.fec0d32e.js

js lazyoffer.ru collected 2026-10-08 15:47:55 UTC 360,499 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunklazyoffer=globalThis.webpackChunklazyoffer||[]).push([[1644],{3472(e,n,l){l.r(n),l.d(n,{assets:()=>h,contentTitle:()=>c,default:()=>a,frontMatter:()=>r,metadata:()=>s,toc:()=>o});const s=JSON.parse('{"id":"questions/nodejs-20","title":"Node.js","description":"\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u043e Node.js \u0434\u043b\u044f middle/senior \u0438 fullstack \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e.","source":"@site/docs/questions/nodejs-20.md","sourceDirName":"questions","slug":"/questions/nodejs","permalink":"/docs/questions/nodejs","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":6,"frontMatter":{"sidebar_position":6,"title":"Node.js","sidebar_label":"\u0421\u0442\u0435\u043a: Node.js","slug":"/questions/nodejs","description":"\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u043e Node.js \u0434\u043b\u044f middle/senior \u0438 fullstack \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e.","grade":["middle","senior"],"topic":["nodejs","backend"],"format":"question-set"},"sidebar":"tutorialSidebar","previous":{"title":"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430: Playbook \u043e\u0442\u0432\u0435\u0442\u043e\u0432","permalink":"/docs/questions/playbook"},"next":{"title":"\u0421\u0442\u0435\u043a: Next.js","permalink":"/docs/questions/nextjs"}}');var d=l(4848),i=l(8453);const r={sidebar_position:6,title:"Node.js",sidebar_label:"\u0421\u0442\u0435\u043a: Node.js",slug:"/questions/nodejs",description:"\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u043e Node.js \u0434\u043b\u044f middle/senior \u0438 fullstack \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e.",grade:["middle","senior"],topic:["nodejs","backend"],format:"question-set"},c="Node.js",h={},o=[{value:"\u042d\u043a\u0441\u043f\u0440\u0435\u0441\u0441-\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 20/20",id:"\u044d\u043a\u0441\u043f\u0440\u0435\u0441\u0441-\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430-2020",level:2},{value:"1. \u041a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d Event Loop \u0432 Node.js \u0438 \u0435\u0433\u043e \u0444\u0430\u0437\u044b?",id:"q-1",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430",level:3},{value:"2. \u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Streams \u0432\u043c\u0435\u0441\u0442\u043e \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0446\u0435\u043b\u0438\u043a\u043e\u043c?",id:"q-2",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-1",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-1",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-1",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-1",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-1",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-1",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-1",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-1",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-1",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-1",level:3}
1,{value:"3. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Buffer \u0438 \u0433\u0434\u0435 \u043e\u043d \u043d\u0443\u0436\u0435\u043d?",id:"q-3",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-2",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-2",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-2",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-2",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-2",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-2",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-2",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-2",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-2",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-2",level:3},{value:"4. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 <code>process.nextTick</code>, <code>setImmediate</code> \u0438 <code>setTimeout</code>?",id:"q-4",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-3",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-3",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-3",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-3",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-3",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-3",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-3",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-3",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-3",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-3",level:3},{value:"5. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c <code>worker_threads</code>, \u0430 \u043a\u043e\u0433\u0434\u0430 <code>cluster</code>?",id:"q-5",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-4",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-4",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-4",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-4",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-4",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-4",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-4",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-4",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-4",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-4",level:3},{value:"6. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 CommonJS \u0438 ESM \u0432 Node.js?",id:"q-6",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-5",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-5",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-5",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-5",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-5",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-5",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-5",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-5",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-5",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-5",level:3},{value:"7. \u041a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 error handling \u0432 Node API?",id:"q-7",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-6",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-6",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-6",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-6",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-6",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-6",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-6",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-6",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-6",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-6",level:3},{value:"8. \u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c graceful shutdown \u0441\u0435\u0440\u0432\u0438\u0441\u0430?",id:"q-8",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-7",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-7",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-7",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-7",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-7",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-7",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-7",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-7",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-7",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-7",level:3},{value:"9. \u041a\u0430\u043a \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c API \u043e\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 (rate limit/backpressure)?",id:"q-9",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-8",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-8",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-8",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-8",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-8",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-8",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-8",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-8",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-8",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-8",level:3},{value:"10. \u041a\u0430\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438?",id:"q-10",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-9",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-9",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-9",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-9",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u04
131\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-9",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-9",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-9",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-9",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-9",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-9",level:3},{value:"11. \u041a\u0430\u043a \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 secrets?",id:"q-11",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-10",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-10",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-10",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-10",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-10",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-10",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-10",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-10",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-10",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-10",level:3},{value:"12. \u041a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 Node?",id:"q-12",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-11",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-11",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-11",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-11",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-11",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-11",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-11",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-11",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-11",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-11",level:3},{value:"13. \u0417\u0430\u0447\u0435\u043c \u0438 \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c healthcheck/readiness endpoints?",id:"q-13",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-12",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-12",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-12",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-12",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-12",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-12",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-12",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-12",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-12",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-12",level:3},{value:"14. \u041a\u0430\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 JWT \u043d\u0430 backend?",id:"q-14",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-13",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-13",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-13",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-13",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-13",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-13",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-13",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-13",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-13",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-13",level:3},{value:"15. \u041a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 N
1ode-\u0441\u0435\u0440\u0432\u0438\u0441\u0430?",id:"q-15",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-14",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-14",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-14",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-14",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-14",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-14",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-14",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-14",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-14",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-14",level:3},{value:"16. \u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c WebSocket \u0438 \u043a\u0430\u043a\u0438\u0435 \u0443 \u043d\u0435\u0433\u043e \u0440\u0438\u0441\u043a\u0438?",id:"q-16",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-15",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-15",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-15",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-15",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-15",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-15",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-15",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-15",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-15",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-15",level:3},{value:"17. \u041a\u0430\u043a \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 Node \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438?",id:"q-17",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-16",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-16",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-16",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-16",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-16",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-16",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-16",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-16",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-16",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-16",level:3},{value:"18. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c ORM, \u0430 \u043a\u043e\u0433\u0434\u0430 query builder?",id:"q-18",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-17",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-17",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-17",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-17",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-17",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-17",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-17",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-17",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-17",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-17",level:3},{value:"19. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 N+1 \u043d\u0430 backend \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c?",id:"q-19",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-18",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-18",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-18",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-18",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-18",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-18",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-18",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-18",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-18",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-18",level:3},{value:"20. \u041a\u0430\u043a \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c backward compatibility API?",id:"q-20",level:2},{value:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442",id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-19",level:3},{value:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)",id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-19",level:3},{value:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-19",level:3},{value:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-19",level:3},{value:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)",id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-19",level:3},{value:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-19",level:3},{value:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438",id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-19",level:3},{value:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b",id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-19",level:3},{value:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-19",level:3},{value:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430",id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-19",level:3},{value:"\u041a\u0443\u0434\u0430 \u0434\u0430\u043b\u044c\u0448\u0435",id:"\u043a\u0443\u0434\u0430-\u0434\u0430\u043b\u044c\u0448\u0435",level:2}];function t(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.header,{children:(0,d.jsx)(n.h1,{id:"nodejs",children:"Node.js"})}),"\n",(0,d.jsx)(n.h2,{id:"\u044d\u043a\u0441\u043f\u0440\u0435\u0441\u0441-\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430-2020",children:"\u042d\u043a\u0441\u043f\u0440\u0435\u0441\u0441-\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 20/20"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["Event Loop \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0444\u0430\u0437\u044b ",(0,d.jsx)(n.code,{children:"timers ->
1 pending callbacks -> poll -> check -> close"}),", \u0430 ",(0,d.jsx)(n.code,{children:"microtasks"})," (",(0,d.jsx)(n.code,{children:"Promise"}),", ",(0,d.jsx)(n.code,{children:"nextTick"}),") \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0444\u0430\u0437\u0430\u043c\u0438."]}),"\n",(0,d.jsx)(n.li,{children:"Streams \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 payload \u0438 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432\u0441\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c backpressure."}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"Buffer"})," \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: \u0444\u0430\u0439\u043b\u044b, \u0441\u043e\u043a\u0435\u0442\u044b, \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f, \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438."]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"nextTick"})," \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e, ",(0,d.jsx)(n.code,{children:"setImmediate"})," \u0432 ",(0,d.jsx)(n.code,{children:"check"}),", ",(0,d.jsx)(n.code,{children:"setTimeout"})," \u0432 ",(0,d.jsx)(n.code,{children:"timers"})," \u043f\u043e\u0441\u043b\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438."]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"worker_threads"})," \u0434\u043b\u044f CPU-bound \u0437\u0430\u0434\u0430\u0447, ",(0,d.jsx)(n.code,{children:"cluster"})," \u0434\u043b\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f HTTP-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043f\u043e \u044f\u0434\u0440\u0430\u043c."]}),"\n",(0,d.jsxs)(n.li,{children:["CommonJS (",(0,d.jsx)(n.code,{children:"require"}),") \u043f\u0440\u043e\u0449\u0435 \u0434\u043b\u044f legacy, ESM (",(0,d.jsx)(n.code,{children:"import"}),") \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0435\u0435 \u0438 \u043b\u0443\u0447\u0448\u0435 \u0434\u043b\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e tooling."]}),"\n",(0,d.jsx)(n.li,{children:"\u0426\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 error handling: \u0435\u0434\u0438\u043d\u044b\u0439 error schema, middleware/filters, correlation id \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 4xx/5xx."}),"\n",(0,d.jsx)(n.li,{children:"Graceful shutdown: stop accepting new requests -> drain active -> close DB/broker -> forced exit by timeout."}),"\n",(0,d.jsx)(n.li,{children:"\u041e\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0442 rate limit, \u043e\u0447\u0435\u0440\u0435\u0434\u0438, \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u044b, circuit breaker \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430."}),"\n",(0,d.jsxs)(n.li,{children:["\u041b\u043e\u0433\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u043c\u0438 (JSON), \u0441 ",(0,d.jsx)(n.code,{children:"traceId/requestId"}),", \u0443\u0440\u043e\u0432\u043d\u044f\u043c\u0438 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438 latency/error-rate."]}),"\n",(0,d.jsxs)(n.li,{children:["\u041a\u043e\u043d\u0444\u0438\u0433: ",(0,d.jsx)(n.code,{children:"12-factor"}),", fail-fast \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f env \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435, \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 secret manager."]}),"\n",(0,d.jsx)(n.li,{children:"\u0411\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 stream/pipeline \u0441 \u043b\u0438\u043c\u0438\u0442\u0430\u043c\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430, type-check \u0438 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432."}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"health"})," \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0436\u0438\u0432 \u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, ",(0,d.jsx)(n.code,{children:"readiness"})," \u0433\u043e\u0442\u043e\u0432 \u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439."]}),"\n",(0,d.jsxs)(n.li,{children:["JWT \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 ",(0,d.jsx)(n.code,{children:"alg"}),", \u043f\u043e\u0434\u043f\u0438\u0441\u0438, ",(0,d.jsx)(n.code,{children:"exp/aud/iss"}),", \u0440\u043e\u0442\u0430\u0446\u0438\u0435\u0439 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u043c TTL access-\u0442\u043e\u043a\u0435\u043d\u0430."]}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u044d\u0448 \u0441\u0442\u0430\u0432\u044f\u0442 \u043d\u0430 read-heavy \u043f\u0443\u0442\u0438 \u0441 TTL, \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439 \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0438 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 cache stampede."}),"\n",(0,d.jsx)(n.li,{children:"WebSocket \u0442\u0440\u0435\u0431\u0443\u0435\u0442 heartbeat/ping-pong, \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, backpressure \u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 reconnect."}),"\n",(0,d.jsx)(n.li,{children:"\u0423\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0449\u0443\u0442 \u0447\u0435\u0440\u0435\u0437 heap snapshots, allocation profiling \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u043e\u0441\u0442\u0430 heap \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438."}),"\n",(0,d.jsx)(n.li,{children:"ORM \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 CRUD, query builder/raw SQL \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0445 \u043f\u043e perf \u
10437\u0430\u043f\u0440\u043e\u0441\u043e\u0432."}),"\n",(0,d.jsx)(n.li,{children:"N+1 \u043b\u0435\u0447\u0430\u0442 batching, joins/eager loading \u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u043e\u0434\u0438\u043d API call."}),"\n",(0,d.jsx)(n.li,{children:"Backward compatibility \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u044e\u0442 additive changes, versioning, deprecation window \u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438."}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-1",children:"1. \u041a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d Event Loop \u0432 Node.js \u0438 \u0435\u0433\u043e \u0444\u0430\u0437\u044b?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),", ",(0,d.jsx)(n.code,{children:"event-loop"}),", ",(0,d.jsx)(n.code,{children:"async"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsxs)(n.p,{children:["Event Loop - \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 Node.js \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 I/O \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c JavaScript-\u043f\u043e\u0442\u043e\u043a\u0435. \u041e\u043d \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0444\u0430\u0437\u044b ",(0,d.jsx)(n.code,{children:"timers"}),", ",(0,d.jsx)(n.code,{children:"pending callbacks"}),", ",(0,d.jsx)(n.code,{children:"poll"}),", ",(0,d.jsx)(n.code,{children:"check"}),", ",(0,d.jsx)(n.code,{children:"close callbacks"}),"; ",(0,d.jsx)(n.code,{children:"process.nextTick"})," \u0438 microtasks \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0433\u0443\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438 latency."]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}),"\n",(0,d.jsxs)(n.p,{children:["Node.js \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0430\u0448 JavaScript \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438: \u043e\u0434\u0438\u043d \u0434\u043e\u043b\u0433\u0438\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 callback \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 callbacks. \u041d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e \u044f \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e \u0444\u0430\u0437\u044b \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f: ",(0,d.jsx)(n.code,{children:"timers"})," \u0434\u043b\u044f ",(0,d.jsx)(n.code,{children:"setTimeout/setInterval"}),", ",(0,d.jsx)(n.code,{children:"poll"})," \u0434\u043b\u044f I/O, ",(0,d.jsx)(n.code,{children:"check"})," \u0434\u043b\u044f ",(0,d.jsx)(n.code,{children:"setImmediate"}),", ",(0,d.jsx)(n.code,{children:"close"})," \u0434\u043b\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u043e\u043a\u0435\u0442\u043e\u0432. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u044e, \u0447\u0442\u043e timers \u0437\u0430\u0434\u0430\u044e\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u043e\u0433, \u0430 \u043d\u0435 \u0442\u043e\u0447\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0412 \u043f\u0440\u043e\u0434\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 event loop lag, p95/p99 latency \u0438 \u043f\u043e\u0438\u0441\u043a CPU-bound \u043a\u043e\u0434\u0430 \u0432 request path."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"console.log('A');\nsetTimeout(() => console.log('timer'), 0);\nsetImmediate(() => console.log('immediate'));\nprocess.nextTick(() => console.log('nextTick'));\n"})}),"\n",(0,d.jsxs)(n.p,{children:["\u0412\u043d\u0435 I/O \u043f\u043e\u0440\u044f\u0434\u043e\u043a ",(0,d.jsx)(n.code,{children:"timer"})," \u0438 ",(0,d.jsx)(n.code,{children:"immediate"})," \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0432\u0435\u0440\u0441\u0438\u0438 Node.js, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0440\u0435\u043b\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u0435\u0449\u0430\u0442\u044c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsx)(n.p,{children:'Event Loop - \u044d\u0442\u043e \u043d\u0435 "\u0446\u0438\u043a\u043b \u043f\u0440\u043e\u043c\u0438\u0441\u043e\u0432", \u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 callbacks \u0432\u043e\u043a\u0440\u0443\u0433 I/O. \u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0442\u0430\u043a\u043e\u0439: JavaScript \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u0430\u0432\u0438\u0442 I/O-\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e, \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u0442 \u043f\u043e\u0442\u043e\u043a, \u043f\u043e\u0442\u043e\u043c callback \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0443\u0436\u043d\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c. \u0415\u0441\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 callback \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u044f\u0436\u0435\u043b\u044b\u0439 JSON parse, \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0446\u0438\u043a\u043b, Node \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c callbacks.'}),"\n",(0,d.jsx)(n.p,{children:"\u041d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e \u0432\u0430\u0436\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0444\u0430\u0437\u044b \u0441 \u0441\u0438\u043c\u043f\u0442\u043e\u043c\u0430\u043c\u0438. \u
10415\u0441\u043b\u0438 \u0440\u0430\u0441\u0442\u0435\u0442 event loop lag, \u043d\u043e CPU \u0432\u044b\u0441\u043e\u043a\u043e, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0447\u0430\u0441\u0442\u043e \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u0415\u0441\u043b\u0438 CPU \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439, \u043d\u043e \u0440\u0430\u0441\u0442\u0435\u0442 latency \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432, Event Loop \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439. \u0422\u0430\u043a \u0432\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0444\u0430\u0437\u044b."}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0424\u0430\u0437\u0430"}),(0,d.jsx)(n.th,{children:"\u0427\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f"}),(0,d.jsx)(n.th,{children:"\u0418\u043d\u0442\u0435\u0440\u0432\u044c\u044e-\u043b\u043e\u0432\u0443\u0448\u043a\u0430"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"timers"})}),(0,d.jsxs)(n.td,{children:["callbacks ",(0,d.jsx)(n.code,{children:"setTimeout"}),"/",(0,d.jsx)(n.code,{children:"setInterval"})," \u043f\u043e\u0441\u043b\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e threshold"]}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"0 ms"}),' \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442 "\u0441\u0440\u0430\u0437\u0443"']})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"pending callbacks"})}),(0,d.jsx)(n.td,{children:"\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 I/O callbacks"}),(0,d.jsx)(n.td,{children:"\u0440\u0435\u0434\u043a\u043e \u043d\u0443\u0436\u0435\u043d \u0432 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u043d\u043e \u0444\u0430\u0437\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"poll"})}),(0,d.jsx)(n.td,{children:"\u043f\u0440\u0438\u0435\u043c \u043d\u043e\u0432\u044b\u0445 I/O \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 I/O callbacks"}),(0,d.jsx)(n.td,{children:"\u0434\u043b\u0438\u043d\u043d\u044b\u0439 callback \u0437\u0430\u0434\u0435\u0440\u0436\u0438\u0442 timers"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"check"})}),(0,d.jsxs)(n.td,{children:["callbacks ",(0,d.jsx)(n.code,{children:"setImmediate"})]}),(0,d.jsxs)(n.td,{children:["\u0432\u043d\u0443\u0442\u0440\u0438 I/O \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435 ",(0,d.jsx)(n.code,{children:"setTimeout(..., 0)"})]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"close callbacks"})}),(0,d.jsx)(n.td,{children:"\u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 handles, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 socket close"}),(0,d.jsx)(n.td,{children:"\u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f cleanup"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:'\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439: API \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 CSV, \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u043f\u0430\u0440\u0441\u0438\u0442 \u0435\u0433\u043e \u0432 handler \u0438 "\u0438\u043d\u043e\u0433\u0434\u0430" \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442 \u0432\u0435\u0441\u044c \u0441\u0435\u0440\u0432\u0438\u0441. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442: \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440, \u0447\u0438\u0442\u0430\u0442\u044c stream-\u043e\u043c, \u0442\u044f\u0436\u0435\u043b\u0443\u044e CPU-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 worker/\u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a\u0443 event loop lag \u0438 latency \u043f\u043e endpoint.'}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0412\u044b\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u043b\u044f 3 snippets: top-level ",(0,d.jsx)(n.code,{children:"setTimeout/setImmediate"}),", \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 ",(0,d.jsx)(n.code,{children:"fs.readFile"}),", \u0438 \u043a\u043e\u0434 \u0441 ",(0,d.jsx)(n.code,{children:"Promise.resolve().then(...)"})," \u043f\u043b\u044e\u0441 ",(0,d.jsx)(n.code,{children:"process.nextTick(...)"}),"."]}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0430\u0443\u0447\u0438\u0442\u0435\u0441\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 timer \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0437\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e delay."}),"\n",(0,d.jsx)(n.li,{children:'\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435 production-\u043a\u0435\u0439\u0441: "event loop lag \u0432\u044b\u0440\u043e\u0441, CPU 95%, p99 latency \u0440\u0430\u0441\u0442\u0435\u0442" \u0438 \u043f\u043b\u0430\u043d \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438.'}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:'\u0413\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e Node.js "\u043e\u0434\u043d\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0439", \u0438 \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u043e libuv/system kernel \u0434\u043b\u044f I/O \u0438 worker pool \u0434\u043b\u044f \u0447\u0430\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.'}),"\n",(0,d.jsxs)(n.li,{children:["\u041e\u0431\u0435\u0449\u0430\u044e\u0442 \u0442\u043e\u0447\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a ",(0,d.jsx)(n.code,{children:"setTimeout(..., 0)"})," \u0438 ",(0,d.jsx)(n.code,{children:"setImmediate"})," \u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430."]}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442 I/O-bound \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043e\u0442 CPU-bound \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b."}),"\n",(0,d.jsxs)(n.li,{children:["\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 ",(0,d.jsx)(n.code,{children:"process.nextTick"})," \u0438 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430starve-\u0438\u0442\u044c I/O."]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u041f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"setTimeout(fn, 0)"})," \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435?"]}),"\n",(0,d.jsx)(n.li,{children:"\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0441 HTTP latency, \u0435\u0441\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 handler \u0441\u0434\u0435\u043b\u0430\u0442\u044c CPU-bound \u0446\u0438\u043a\u043b \u043d\u0430 300 ms?"}),"\n",(0,d.jsx)(n.li,{children:"\u0427\u0435\u043c event loop lag \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 latency \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445?"}),"\n",(0,d.jsxs)(n.li,{children:["\u041f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"setImmediate"})," \u0432\u043d\u0443\u0442\u0440\u0438 I/O callback \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u0435\u0435 ",(0,d.jsx)(n.code,{children:"setTimeout(..., 0)"}),"?"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0424\u0430\u0437\u044b Event Loop \u0438 \u0440\u043e\u043b\u044c ",(0,d.jsx)(n.code,{children:"poll"}),"/",(0,d.jsx)(n.code,{children:"check"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["Microtasks, ",(0,d.jsx)(n.code,{children:"process.nextTick"}),", ",(0,d.jsx)(n.code,{children:"Promise"}),"."]}),"\n",(0,d.jsx)(n.li,{children:"Event loop lag, CPU profiling, flamegraph."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-2",children:"2. \u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Streams \u0432\u043c\u0435\u0441\u0442\u043e \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0446\u0435\u043b\u0438\u043a\u043e\u043c?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),", ",(0,d.jsx)(n.code,{children:"streams"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-1",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"Streams \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0435, \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u0435 \u0438\u043b\u0438 \u0438\u0434\u0443\u0442 \u043c\u0435\u0436\u0434\u0443 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u043c \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e - \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0447\u0430\u043d\u043a\u0430\u043c\u0438 \u0438 backpressure: \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 consumer \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442\u044c producer \u0432\u043c\u0435\u0441\u0442\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0440\u043e\u0441\u0442\u0430 \u043f\u0430\u043c\u044f\u0442\u0438."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-1",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}
1),"\n",(0,d.jsxs)(n.p,{children:['\u042f \u0432\u044b\u0431\u0438\u0440\u0430\u044e stream, \u043a\u043e\u0433\u0434\u0430 payload \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438: \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430, \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043b\u043e\u0433\u043e\u0432, \u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u043e\u0442\u0447\u0435\u0442\u0430. \u0412 \u0437\u0440\u0435\u043b\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0435 \u0432\u0430\u0436\u043d\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c "\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u043f\u0430\u043c\u044f\u0442\u044c", \u0430 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c backpressure: \u0435\u0441\u043b\u0438 ',(0,d.jsx)(n.code,{children:"Writable.write()"})," \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 ",(0,d.jsx)(n.code,{children:"false"}),", producer \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f ",(0,d.jsx)(n.code,{children:"drain"}),". \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e ",(0,d.jsx)(n.code,{children:"pipeline"}),", \u0441\u0442\u0430\u0432\u043b\u044e \u043b\u0438\u043c\u0438\u0442\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u0430/\u0442\u0430\u0439\u043c\u0430\u0443\u0442\u044b \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e RSS memory \u043f\u043e\u0434 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-1",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"import { createReadStream } from 'node:fs';\nimport { pipeline } from 'node:stream/promises';\nimport { createGzip } from 'node:zlib';\n\nawait pipeline(\n  createReadStream('./big.log'),\n  createGzip(),\n  process.stdout,\n);\n"})}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"pipeline"})," \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0440\u0443\u0447\u043d\u043e\u0433\u043e ",(0,d.jsx)(n.code,{children:".pipe()"}),", \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-1",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"readFile"})," \u043d\u043e\u0440\u043c\u0430\u043b\u0435\u043d \u0434\u043b\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e config-\u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e JSON, \u0433\u0434\u0435 \u043f\u0440\u043e\u0449\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c. Stream \u043d\u0443\u0436\u0435\u043d, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0435\u0441\u044f\u0442\u043a\u0438/\u0441\u043e\u0442\u043d\u0438 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043f\u043e \u0441\u0435\u0442\u0438 \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 transform \u0431\u0435\u0437 \u043f\u043e\u043b\u043d\u043e\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445."]}),"\n",(0,d.jsx)(n.p,{children:"Backpressure - \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430. \u0415\u0441\u043b\u0438 consumer \u043f\u0438\u0448\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c producer \u0447\u0438\u0442\u0430\u0435\u0442, Node \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0442\u043e\u043a \u0447\u0442\u0435\u043d\u0438\u044f. \u0418\u043d\u0430\u0447\u0435 \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0442\u0438 \u0434\u043e OOM. \u041d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e happy path, \u043d\u043e \u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043e\u0431\u0440\u044b\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u043e\u0448\u0438\u0431\u043a\u0443 transform \u0438 \u043b\u0438\u043c\u0438\u0442\u044b."}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-1",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0420\u0435\u0448\u0435\u043d\u0438\u0435"}),(0,d.jsx)(n.th,{children:"\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442"}),(0,d.jsx)(n.th,{children:"\u0420\u0438\u0441\u043a"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"readFile"})}),(0,d.jsx)(n.td,{children:"\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0444\u0430\u0439\u043b, \u043d\u0443\u0436\u0435\u043d \u0432\u0435\u0441\u044c payload \u0441\u0440\u0430\u0437\u0443"}),(0,d.jsx)(n.td,{children:"\u0441\u043a\u0430\u0447\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"Readable"}),"/",(0,d.jsx)(n.code,{children:"Writable"})]}),(0,d.jsx)(n.td,{children:"\u0444\u0430\u0439\u043b, socket, HTTP response, \u043b\u043e\u0433"}),(0,d.jsx)(n.td,{children:"\u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"Transform"})}),(0,d.jsx)(n.td,{children:"gzip, CSV parser, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0440\u043e\u043a"}),(0,d.jsx)(n.td,{children:"\u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c backpressure"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"pipeline"})}),(0,d.jsx)(n.td,{children:"production-\u0446\u0435\u043f\u043e\u0447\u043a\u0430 streams"}),(0,d.jsx)(n.td,{children:"\u043d\u0430\u0434\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c abort/cleanup"})]})]})]}),"\n",(0,d.jsxs)(n.p,{children:["\u041a\u0435\u0439\u0441: endpoint \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0430\u0440\u0445\u0438\u0432 \u0437\u0430\u043a\u0430\u0437\u043e\u0432. \u041f\u043b\u043e\u0445\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 - \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0435\u0441\u044c CSV \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043f\u043e\u0442\u043e\u043c gzip. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 - curs
1or/page source -> ",(0,d.jsx)(n.code,{children:"Transform"})," \u0432 CSV -> gzip -> response stream, \u0441 \u043b\u0438\u043c\u0438\u0442\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 abort \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438 bytes/duration/errors."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-1",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0421\u043e\u0431\u0435\u0440\u0438\u0442\u0435 checklist: ",(0,d.jsx)(n.code,{children:"pipeline"}),", \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a, abort \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043b\u0438\u043c\u0438\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430, timeout, memory RSS, slow consumer."]}),"\n",(0,d.jsxs)(n.li,{children:["\u041e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 ",(0,d.jsx)(n.code,{children:".write()"})," \u0432\u0435\u0440\u043d\u0443\u043b ",(0,d.jsx)(n.code,{children:"false"}),": \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u043e\u0432\u044b\u0445 chunks \u0434\u043e ",(0,d.jsx)(n.code,{children:"drain"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["\u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043b\u044f ",(0,d.jsx)(n.code,{children:"readFile"})," \u0438 stream \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0438 \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u0432\u044b\u0432\u043e\u0434 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e."]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-1",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 ",(0,d.jsx)(n.code,{children:".on('data')"})," \u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0438\u0448\u0443\u0442 \u0432 consumer, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044f ",(0,d.jsx)(n.code,{children:"write() === false"}),"."]}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u0445 stream chain."}),"\n",(0,d.jsx)(n.li,{children:"\u0421\u0447\u0438\u0442\u0430\u044e\u0442 streams \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435: \u0434\u043b\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e payload \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u0448\u043d\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 abort \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0440\u0438 streaming response."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-1",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u041f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"pipeline"})," \u0447\u0430\u0441\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 ",(0,d.jsx)(n.code,{children:".pipe().pipe()"}),"?"]}),"\n",(0,d.jsxs)(n.li,{children:["\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 ",(0,d.jsx)(n.code,{children:"highWaterMark"})," \u0438 \u043a\u0430\u043a \u043e\u043d \u0441\u0432\u044f\u0437\u0430\u043d \u0441 backpressure?"]}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0447\u0438\u0442\u0430\u0435\u0442 response?"}),"\n",(0,d.jsxs)(n.li,{children:["\u041a\u043e\u0433\u0434\u0430 ",(0,d.jsx)(n.code,{children:"readFile"})," \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440?"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-1",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"Readable"}),", ",(0,d.jsx)(n.code,{children:"Writable"}),", ",(0,d.jsx)(n.code,{children:"Transform"}),", ",(0,d.jsx)(n.code,{children:"Duplex"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"stream.pipeline"})," \u0438 ",(0,d.jsx)(n.code,{children:"stream/promises"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["Backpressure, ",(0,d.jsx)(n.code,{children:"highWaterMark"}),", ",(0,d.jsx)(n.code,{children:"drain"}),"."]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-1",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-3",children:"3. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Buffer \u0438 \u0433\u0434\u0435 \u043e\u043d \u043d\u0443\u0436\u0435\u043d?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),", ",(0,d.jsx)(n.code,{children:"buffer"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-2",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"Buffer"})," - \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0431\u0430\u0439\u0442\u043e\u0432 \u0434\u043b\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Node.js. \u041e\u043d \u043d\u0443\u0436\u0435\u043d \u0442\u0430\u043c, \u0433\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430: \u0444\u0430\u0439\u043b\u044b, TCP/HTTP chunks, \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0430\u0440\u0445\u0438\u0432\u044b, \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b."]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-2",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}),"\n",(0,d.jsxs)(n.p,{children:["Buffer \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 bytes, \u0430 \u043d\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b. \u042f \u
10438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0435\u0433\u043e, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0441 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c payload \u0438\u043b\u0438 \u044f\u0432\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e encoding. \u0412\u0430\u0436\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e: ",(0,d.jsx)(n.code,{children:"Buffer.alloc"})," \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c, ",(0,d.jsx)(n.code,{children:"Buffer.from"})," \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438/\u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0430 ",(0,d.jsx)(n.code,{children:"Buffer.byteLength(str, 'utf8')"})," \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 ",(0,d.jsx)(n.code,{children:"str.length"}),". \u0412 production \u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0442\u0430\u0432\u043b\u044e \u043b\u0438\u043c\u0438\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 payload, \u0447\u0442\u043e\u0431\u044b binary upload \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 memory pressure."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-2",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"const payload = Buffer.from('hello', 'utf8');\nconsole.log(payload.toString('hex'));\n"})}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"const text = '\u043f\u0440\u0438\u0432\u0435\u0442';\nconsole.log(text.length);\nconsole.log(Buffer.byteLength(text, 'utf8'));\n"})}),"\n",(0,d.jsx)(n.p,{children:"\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0433\u0440\u0430\u043d\u0438\u0446\u0443: \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 JS \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u0432 UTF-8 - \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0438."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-2",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsx)(n.p,{children:'Buffer \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e \u0432 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445 \u043f\u0440\u043e \u0444\u0430\u0439\u043b\u044b, network protocols \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c. \u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e "\u044d\u0442\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435": \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u0433\u0440\u0430\u043d\u0438\u0446\u044b string/bytes/encoding. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 API \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 base64-\u0444\u0430\u0439\u043b, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c MIME/signature, \u043d\u0435 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 Buffer \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043b\u0443\u0447\u0448\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a stream \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.'}),"\n",(0,d.jsxs)(n.p,{children:["\u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c: ",(0,d.jsx)(n.code,{children:"Buffer"})," \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u043e\u043c ",(0,d.jsx)(n.code,{children:"Uint8Array"}),", \u043d\u043e Node \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043d\u043e\u0432\u043e\u043c \u043a\u043e\u0434\u0435 \u043b\u0443\u0447\u0448\u0435 \u044f\u0432\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c ",(0,d.jsx)(n.code,{children:"Buffer"})," \u0438\u0437 ",(0,d.jsx)(n.code,{children:"node:buffer"}),", \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u043e\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d."]}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-2",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0413\u0440\u0430\u043d\u0438\u0446\u0430"}),(0,d.jsx)(n.th,{children:"\u0427\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c"}),(0,d.jsx)(n.th,{children:"\u041f\u043e\u0447\u0435\u043c\u0443 \u0432\u0430\u0436\u043d\u043e"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"string -> bytes"}),(0,d.jsxs)(n.td,{children:["encoding \u0438 ",(0,d.jsx)(n.code,{children:"Buffer.byteLength"})]}),(0,d.jsx)(n.td,{children:"\u043a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0430/emoji \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 1 byte"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"bytes -> string"}),(0,d.jsxs)(n.td,{children:["\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 ",(0,d.jsx)(n.code,{children:"toString(encoding)"})]}),(0,d.jsx)(n.td,{children:"\u0438\u043d\u0430\u0447\u0435 corrupted text"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"upload -> Buffer"}),(0,d.jsx)(n.td,{children:"\u043b\u0438\u043c\u0438\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0441\u043b\u0435"}),(0,d.jsx)(n.td,{children:"\u0437\u0430\u0449\u0438\u0442\u0430 \u043f\u0430\u043c\u044f\u0442\u0438"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Buffer -> stream"}),(0,d.jsx)(n.td,{children:"\u043d\u0443\u0436\u0435\u043d \u043b\u0438 \u043f\u043e\u043b\u043d\u044b\u0439 payload \u0432 \u043f\u0430\u043c\u044f\u0442\u0438"}),(0,d.jsx)(n.td,{children:"\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u043b\u0443\u0447\u0448\u0435 stream-\u0438\u0442\u044c"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"binary protocol"}),(0,d.jsx)(n.td,{children:"offset, endianess, checksum"}),(0,d.jsx)(n.td,{children:"\u043e\u0448\u0438\u0431\u043a\u0430 \u0434\u0430\u0435\u0442 \u0431\u0438\u0442\u044b\u0439 packet"})]})]})]}),"\n",(0,d.jsxs)(n.p,{children:["\u041a\u0435\u0439\u0441: \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0432 base64. \u041f\u043b\u043e\u0445\u043e\u0439 \u043e\u0442\u0432\u0435\u0442 - \u043f\u0440\u043e\u0441\u0442\u043e ",(0,d.jsx)(n.code,{children:"Buffer.from(body.file, 'base64')"})," \u0431\u0435\u0437 \u043b\u0438\u043c\u0438\u0442\u043e\u0432. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442 - \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043e\u0446\u0435\u043d\u0438\u0442\u044c decoded size, \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0438\u043f, \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c streaming upload/storage, \u0430 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0444\u0430\u0439\u043b \u0432 heap."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-2",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 boun
1dary map: ",(0,d.jsx)(n.code,{children:"HTTP body -> base64/string -> Buffer -> storage/stream"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["\u041f\u043e\u043a\u0430\u0436\u0438\u0442\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"str.length"})," \u043d\u0435 \u0440\u0430\u0432\u0435\u043d \u0440\u0430\u0437\u043c\u0435\u0440\u0443 payload \u0432 bytes."]}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435 \u043e\u0442\u0432\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 Buffer \u043d\u0443\u0436\u0435\u043d, \u0430 \u043a\u043e\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0435 stream."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-2",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u0447\u0435\u0440\u0435\u0437 ",(0,d.jsx)(n.code,{children:"length"}),"."]}),"\n",(0,d.jsx)(n.li,{children:"\u0414\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u044e\u0442 base64 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u0435\u0437 \u043b\u0438\u043c\u0438\u0442\u0430."}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u0443\u0442\u0430\u044e\u0442 Buffer \u0441 JSON object \u0438\u043b\u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0447\u0438\u0441\u0435\u043b."}),"\n",(0,d.jsxs)(n.li,{children:["\u041d\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u044e\u0442 encoding \u043f\u0440\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0438 ",(0,d.jsx)(n.code,{children:"string"}),"/",(0,d.jsx)(n.code,{children:"Buffer"}),"."]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-2",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0427\u0435\u043c ",(0,d.jsx)(n.code,{children:"Buffer.byteLength('\u043f\u0440\u0438\u0432\u0435\u0442')"})," \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 ",(0,d.jsx)(n.code,{children:"'\u043f\u0440\u0438\u0432\u0435\u0442'.length"}),"?"]}),"\n",(0,d.jsxs)(n.li,{children:["\u041f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"Buffer.alloc"})," \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435 \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438?"]}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u043e\u0433\u0434\u0430 binary payload \u043b\u0443\u0447\u0448\u0435 \u0432\u0435\u0441\u0442\u0438 stream-\u043e\u043c?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-2",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"Buffer.from"}),", ",(0,d.jsx)(n.code,{children:"Buffer.alloc"}),", ",(0,d.jsx)(n.code,{children:"Buffer.byteLength"}),"."]}),"\n",(0,d.jsx)(n.li,{children:"UTF-8, base64, hex."}),"\n",(0,d.jsx)(n.li,{children:"\u041b\u0438\u043c\u0438\u0442\u044b upload payload \u0438 stream processing."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-2",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsxs)(n.h2,{id:"q-4",children:["4. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 ",(0,d.jsx)(n.code,{children:"process.nextTick"}),", ",(0,d.jsx)(n.code,{children:"setImmediate"})," \u0438 ",(0,d.jsx)(n.code,{children:"setTimeout"}),"?"]}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-3",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"process.nextTick"})," \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f Event Loop, ",(0,d.jsx)(n.code,{children:"setImmediate"})," \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 ",(0,d.jsx)(n.code,{children:"check"}
1)," phase \u043f\u043e\u0441\u043b\u0435 ",(0,d.jsx)(n.code,{children:"poll"}),", \u0430 ",(0,d.jsx)(n.code,{children:"setTimeout"})," \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 ",(0,d.jsx)(n.code,{children:"timers"}),' \u043f\u043e\u0441\u043b\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e delay. \u042d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 "\u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438".']}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-3",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}),"\n",(0,d.jsxs)(n.p,{children:["\u042f \u0431\u044b \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u043b \u0447\u0435\u0440\u0435\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u044c: ",(0,d.jsx)(n.code,{children:"nextTick"}),' \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f "\u0441\u0434\u0435\u043b\u0430\u0442\u044c callback \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c, \u043d\u043e \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u0430\u0437\u044b"; \u0437\u043b\u043e\u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0442\u044c \u0438\u043c \u043d\u0435\u043b\u044c\u0437\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0434\u0430\u0442\u044c Event Loop \u0434\u043e\u0439\u0442\u0438 \u0434\u043e I/O. ',(0,d.jsx)(n.code,{children:"setImmediate"})," \u0443\u0434\u043e\u0431\u0435\u043d, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e I/O cycle. ",(0,d.jsx)(n.code,{children:"setTimeout(fn, 0)"}),' \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 "\u043d\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0430", \u0430 \u043d\u0435 "\u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e". \u0414\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e userland deferral \u0447\u0430\u0441\u0442\u043e \u043b\u0443\u0447\u0448\u0435 ',(0,d.jsx)(n.code,{children:"queueMicrotask"}),", \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 ",(0,d.jsx)(n.code,{children:"nextTick"}),"."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-3",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"import { readFile } from 'node:fs';\n\nreadFile(import.meta.url, () => {\n  setTimeout(() => console.log('timeout'), 0);\n  setImmediate(() => console.log('immediate'));\n});\n"})}),"\n",(0,d.jsxs)(n.p,{children:["\u0412\u043d\u0443\u0442\u0440\u0438 I/O callback ",(0,d.jsx)(n.code,{children:"setImmediate"})," \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0440\u0430\u043d\u044c\u0448\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0441 ",(0,d.jsx)(n.code,{children:"0"}),", \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 ",(0,d.jsx)(n.code,{children:"check"})," phase \u043f\u043e\u0441\u043b\u0435 ",(0,d.jsx)(n.code,{children:"poll"}),"."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-3",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsxs)(n.p,{children:['\u042d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0435 \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0432\u043e\u0434\u0430, \u0430 \u0437\u0440\u0435\u043b\u043e\u0441\u0442\u044c \u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 "\u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a", \u044d\u0442\u043e \u0441\u043b\u0430\u0431\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c: \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0433\u0434\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e\u0442\u0441\u044f callbacks. Top-level ',(0,d.jsx)(n.code,{children:"setTimeout(..., 0)"})," \u0438 ",(0,d.jsx)(n.code,{children:"setImmediate"})," \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b, \u0430 \u0432\u043d\u0443\u0442\u0440\u0438 I/O callback ",(0,d.jsx)(n.code,{children:"setImmediate"})," \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442."]}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"process.nextTick"})," \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u0444\u0430\u0437: \u043e\u0447\u0435\u0440\u0435\u0434\u044c ",(0,d.jsx)(n.code,{children:"nextTick"})," \u043e\u0447\u0438\u0449\u0430\u0435\u0442\u0441\u044f \u0434\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f Event Loop. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c callback \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u043d\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 ",(0,d.jsx)(n.code,{children:"nextTick"})," \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c I/O."]}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-3",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442"}),(0,d.jsx)(n.th,{children:"\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f"}),(0,d.jsx)(n.th,{children:"\u0425\u043e\u0440\u043e\u0448\u0438\u0439 use case"}),(0,d.jsx)(n.th,{children:"\u0420\u0438\u0441\u043a"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"process.nextTick"})}),(0,d.jsx)(n.td,{children:"\u0434\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 Event Loop \u0434\u0430\u043b\u044c\u0448\u0435"}),(0,d.jsx)(n.td,{children:"\u0441\u0434\u0435\u043b\u0430\u0442\u044c callback \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e async \u0432 Node API"}),(0,d.jsx)(n.td,{children:"starvation I/O"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"queueMicrotask"})}),(0,d.jsx)(n.td,{children:"microtask queue"}),(0,d.jsx)(n.td,{children:"\u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u044b\u0439 deferral \u0434\u043b\u044f userland"}),(0,d.jsx)(n.td,{children:"\u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043d\u0430\u0434\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"setImmediate"})}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"check"})," phase"]}),(0,d.jsx)(n.td,{children:"\u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e\u0441\u043b\u0435 I/O callback"}),(0,d.jsx)(n.td,{children:"\u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c \u0441 timer"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"setTimeout(fn, 0)"})}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"timers"})," \u043f\u043e\u0441\u043b\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e delay"]}),(0,d.jsx)(n.td,{children:"\u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 timer turn"}),(0,d.jsx)(n.td,{children:"\u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0442\u043e\u0447\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f"})]})]})]}),"\n",(0,d.jsxs)(n.p,{children:["\u041a\u0435\u0439\u0441: \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 callback \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435 I/O. \u042d\u0442\u043e \u043b\u043e\u043c\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 - \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c callback \u043a\u0430\u043a \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439, \u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 ",(0,d.jsx)(n.code,{children:"nextTick"}),"; \u0434\u043b\u044f \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0447\u0430\u0449\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e ",(0,d.jsx)(n.code,{children:"queueMicrotask"})," \u0438\u043b\u0438 ",(0,d.jsx)(n.code,{children:"setImmediate"})," \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0443\u0436\u043d\u043e\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u0438."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-3",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e snippet \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u0432\u044b\u0432\u043e\u0434: top-level, \u0432\u043d\u0443\u0442\u0440\u0438 ",(0,d.jsx)(n.code,{children:"fs.readFile"}),", \u0441 ",(0,d.jsx)(n.code,{children:"Promise.then"}),", \u0441 ",(0,d.jsx)(n.code,{children:"process.nextTick"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["\u041e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 ",(0,d.jsx)(n.code,{children:"nextTick"})," \u043e\u043f\u0430\u0441\u0435\u043d."]}),"\n",(0,d.jsxs)(n.li,{children:["\u0421\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432\u044b\u0431\u043e\u0440\u0430: ",(0,d.jsx)(n.code,{children:"nextTick"})," \u0434\u043b\u044f Node API edge, ",(0,d.jsx)(n.code,{children:"setImmediate"})," \u043f\u043e\u0441\u043b\u0435 I/O, ",(0,d.jsx)(n.code,{children:"setTimeout"})," \u0434\u043b\u044f real delay."]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-3",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u041d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 ",(0,d.jsx)(n.code,{children:"setTimeout(fn, 0)"})," \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c."]}),"\n",(0,d.jsxs)(n.li,{children:["\u0421\u0447\u0438\u0442\u0430\u044e\u0442 ",(0,d.jsx)(n.code,{children:"nextTick"})," \u0447\u0430\u0441\u0442\u044c\u044e \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0444\u0430\u0437 Event Loop."]}),"\n",(0,d.jsxs)(n.li,{children:["\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 ",(0,d.jsx)(n.code,{children:"nextTick"})," \u0434\u043b\u044f \u0442\u044f\u0436\u0435\u043b\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b."]}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f CJS/ESM \u0438 microtask queue \u0432 edge cases."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-3",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u041f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"process.nextTick"})," \u043c\u043e\u0436\u0435\u0442 \u0437\u0430starve-\u0438\u0442\u044c I/O?"]}),"\n",(0,d.jsxs)(n.li,{children:["\u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 I/O callback: ",(0,d.jsx)(n.code,{children:"setImmediate"})," \u0438\u043b\u0438 ",(0,d.jsx)(n.code,{children:"setTimeout(..., 0)"}),"?"]}),"\n",(0,d.jsxs)(n.li,{children:["\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u0442\u0435 ",(0,d.jsx)(n.code,{children:"queueMicrotask"})," \u0432\u043c\u0435\u0441\u0442\u043e ",(0,d.jsx)(n.code,{children:"process.nextTick"}),"?"]}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u043e\u0447\u0435\u043c\u0443 timer delay - \u044d\u0442\u043e threshold, \u0430 \u043d\u0435 SLA \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-3",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"process.nextTick"})," queue."]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"setImmediate"})," \u0438 ",(0,d.jsx)(n.code,{children:"check"})," phase."]}),"\n",(0,d.jsx)(n.li,{children:"Timers API \u0438 minimum threshold."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-3",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsxs)(n.h2,{id:"q-5",children:["5. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c ",(0,d.jsx)(n.code,{children:"worker_threads"}),", \u0430 \u043a\u043
1e\u0433\u0434\u0430 ",(0,d.jsx)(n.code,{children:"cluster"}),"?"]}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-4",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"worker_threads"})," \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u0434\u043b\u044f CPU-bound JavaScript-\u0440\u0430\u0431\u043e\u0442\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e Node.js \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438/\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438. ",(0,d.jsx)(n.code,{children:"cluster"})," \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 Node.js, \u043e\u0431\u044b\u0447\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c HTTP workload \u043f\u043e \u044f\u0434\u0440\u0430\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c process isolation."]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-4",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}),"\n",(0,d.jsxs)(n.p,{children:["\u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 CPU-bound, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 image processing, PDF generation, crypto-heavy work \u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 parse, \u044f \u0441\u043c\u043e\u0442\u0440\u044e \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 ",(0,d.jsx)(n.code,{children:"worker_threads"})," \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 workers, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c Event Loop API-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 HTTP connections \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 CPU cores, \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432: ",(0,d.jsx)(n.code,{children:"cluster"}),", process manager \u0438\u043b\u0438 container replicas. \u0412\u0430\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e workers \u043d\u0435 \u0443\u0441\u043a\u043e\u0440\u044f\u044e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 async I/O: \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 I/O Node \u0443\u0436\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435, \u0447\u0435\u043c \u0433\u043e\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 worker."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-4",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"import { Worker } from 'node:worker_threads';\n\nconst worker = new Worker(new URL('./hash-worker.js', import.meta.url), {\n  workerData: { payload: 'large-input' },\n});\n\nworker.once('message', console.log);\nworker.once('error', console.error);\n"})}),"\n",(0,d.jsx)(n.p,{children:"Worker \u0432\u044b\u043d\u043e\u0441\u0438\u0442 CPU-heavy \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e Event Loop, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0437\u0430\u0434\u0430\u0447, \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-4",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"worker_threads"})," \u0438 ",(0,d.jsx)(n.code,{children:"cluster"}),' \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b. Worker thread - "\u043a\u0430\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0442\u044f\u0436\u0435\u043b\u044b\u0439 JS parallel \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430". Cluster - "\u043a\u0430\u043a \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e Node \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0442\u044c server port". \u0423 ',(0,d.jsx)(n.code,{children:"cluster"})," \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044f: \u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e worker process \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d\u043e \u0443\u0440\u043e\u043d\u0438\u0442\u044c primary/\u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043d\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0435 \u043e\u0431\u0449\u0430\u044f. \u0423 ",(0,d.jsx)(n.code,{children:"worker_threads"})," \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u043e\u0431\u043c\u0435\u043d \u0447\u0435\u0440\u0435\u0437 transfer/shared memory, \u043d\u043e shared state \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0441\u0442\u0438."]}),"\n",(0,d.jsxs)(n.p,{children:["\u0417\u0440\u0435\u043b\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b. \u0412 Kubernetes/PM2/systemd \u0447\u0430\u0441\u0442\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 HTTP \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0434\u0435\u043b\u0430\u044e\u0442 \u043d\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0447\u0435\u0440\u0435\u0437 ",(0,d.jsx)(n.code,{children:"cluster"}),", \u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0414\u043b\u044f CPU-heavy \u0437\u0430\u0434\u0430\u0447 \u0447\u0430\u0441\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438 worker service, \u0435\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0434\u043e\u043b\u0433\u0430\u044f \u0438 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0436\u0438\u0442\u044c \u0432 lifecycle HTTP request."]}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-4",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0417\u0430\u0434\u0430\u0447\u0430"}
1),(0,d.jsx)(n.th,{children:"\u041b\u0443\u0447\u0448\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c"}),(0,d.jsx)(n.th,{children:"\u041f\u043e\u0447\u0435\u043c\u0443"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"CPU-heavy parse/hash/image \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430"}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"worker_threads"})}),(0,d.jsx)(n.td,{children:"\u0440\u0430\u0437\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 Event Loop"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u041c\u043d\u043e\u0433\u043e HTTP traffic \u043d\u0430 \u043e\u0434\u043d\u043e\u043c host"}),(0,d.jsxs)(n.td,{children:["\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b/",(0,d.jsx)(n.code,{children:"cluster"}),"/\u0440\u0435\u043f\u043b\u0438\u043a\u0438"]}),(0,d.jsx)(n.td,{children:"\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e CPU cores \u0438 \u0434\u0430\u0435\u0442 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0414\u043e\u043b\u0433\u0430\u044f \u0444\u043e\u043d\u043e\u0432\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0441 retry"}),(0,d.jsx)(n.td,{children:"queue + \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 worker service"}),(0,d.jsx)(n.td,{children:"\u043d\u0435 \u0434\u0435\u0440\u0436\u0438\u0442 HTTP request lifecycle"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"I/O-heavy \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a DB/API"}),(0,d.jsx)(n.td,{children:"\u043e\u0431\u044b\u0447\u043d\u044b\u0439 async I/O + limits"}),(0,d.jsx)(n.td,{children:"worker threads \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u041d\u0443\u0436\u043d\u0430 process isolation"}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"cluster"})," \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b"]}),(0,d.jsx)(n.td,{children:"\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043b\u0443\u0447\u0448\u0435"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:"\u041a\u0435\u0439\u0441: endpoint \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 PDF 2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b CPU \u0438 \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e p99 \u0432\u0441\u0435\u0433\u043e API \u0440\u0430\u0441\u0442\u0435\u0442. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b: \u0431\u044b\u0441\u0442\u0440\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c job id \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c; \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d sync-response, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c concurrency \u0438 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0432 worker pool. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430: event loop lag \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043f\u0430\u0434\u0430\u0435\u0442, p99 endpoint \u043d\u0435 \u0443\u0431\u0438\u0432\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b, \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0435 \u0440\u0430\u0441\u0442\u0435\u0442 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-4",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 decision matrix: CPU-bound, I/O-bound, isolation, memory sharing, deployment model."}),"\n",(0,d.jsx)(n.li,{children:"\u041e\u043f\u0438\u0448\u0438\u0442\u0435 worker pool \u0441 \u043b\u0438\u043c\u0438\u0442\u043e\u043c concurrency \u0438 backpressure \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0437\u0430\u0434\u0430\u0447."}),"\n",(0,d.jsxs)(n.li,{children:["\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435 \u043e\u0442\u0432\u0435\u0442, \u043f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"worker_threads"})," \u043d\u0435 \u043b\u0435\u0447\u0438\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445."]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-4",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 worker \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 request \u0431\u0435\u0437 pool \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 overhead/DoS \u043f\u043e CPU."}),"\n",(0,d.jsx)(n.li,{children:"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 workers \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e I/O \u0438 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u044e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0431\u0435\u0437 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0430."}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u0443\u0442\u0430\u044e\u0442 thread-level parallelism \u0438 process-level scaling."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u043f\u0440\u043e\u0434\u0443\u043c\u044b\u0432\u0430\u044e\u0442 graceful shutdown: \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u0432 worker \u043f\u0440\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-4",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u041f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"worker_threads"})," \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0434\u043b\u044f CPU-bound, \u043d\u043e \u043d\u0435 \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e I/O-bound?"]}
1),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0434\u0430\u0447 \u0432 worker pool?"}),"\n",(0,d.jsx)(n.li,{children:"\u0427\u0435\u043c \u043f\u0430\u0434\u0435\u043d\u0438\u0435 worker thread \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0430\u0434\u0435\u043d\u0438\u044f cluster worker process?"}),"\n",(0,d.jsxs)(n.li,{children:["\u041a\u043e\u0433\u0434\u0430 \u0432\u043c\u0435\u0441\u0442\u043e ",(0,d.jsx)(n.code,{children:"cluster"})," \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e container replicas?"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-4",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"worker_threads"}),": ",(0,d.jsx)(n.code,{children:"Worker"}),", ",(0,d.jsx)(n.code,{children:"workerData"}),", ",(0,d.jsx)(n.code,{children:"parentPort"}),", transfer/shared memory."]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"cluster"}),": primary/worker processes \u0438 shared server port."]}),"\n",(0,d.jsx)(n.li,{children:"CPU-bound vs I/O-bound, worker pool, queue, graceful shutdown."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-4",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-6",children:"6. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 CommonJS \u0438 ESM \u0432 Node.js?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-5",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsxs)(n.p,{children:["CommonJS - \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 Node.js \u0441 ",(0,d.jsx)(n.code,{children:"require"})," \u0438 ",(0,d.jsx)(n.code,{children:"module.exports"}),"; ESM - \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 ECMAScript \u0441 ",(0,d.jsx)(n.code,{children:"import"}),"/",(0,d.jsx)(n.code,{children:"export"}),". \u0412 Node.js \u0432\u044b\u0431\u043e\u0440 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 ",(0,d.jsx)(n.code,{children:"package.json"})," ",(0,d.jsx)(n.code,{children:"type"}),", \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 ",(0,d.jsx)(n.code,{children:".cjs/.mjs"}),", interop \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438."]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-5",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}
1),"\n",(0,d.jsxs)(n.p,{children:['\u042f \u0431\u044b \u043e\u0442\u0432\u0435\u0447\u0430\u043b \u043d\u0435 "ESM \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0435\u0435", \u0430 \u0447\u0435\u0440\u0435\u0437 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438. CommonJS \u0443\u0434\u043e\u0431\u0435\u043d \u0432 legacy Node-\u043a\u043e\u0434\u0435 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 ',(0,d.jsx)(n.code,{children:"require"}),". ESM \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e ",(0,d.jsx)(n.code,{children:"import/export"}),", top-level ",(0,d.jsx)(n.code,{children:"await"}),", browser/tooling compatibility \u0438 \u043d\u043e\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u0412 \u043f\u0440\u043e\u0434\u0435 \u0432\u0430\u0436\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0435 \u0441\u043c\u0435\u0448\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0445\u0430\u043e\u0442\u0438\u0447\u043d\u043e: \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c ",(0,d.jsx)(n.code,{children:"type"}),", \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ",(0,d.jsx)(n.code,{children:".cjs/.mjs"})," \u0434\u043b\u044f \u0433\u0440\u0430\u043d\u0438\u0446 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043a\u0430\u043a CJS \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 ESM-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-5",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"// CommonJS\nconst legacy = require('./lib.cjs');\n// ESM\nimport modern from './lib.mjs';\n"})}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"// \u0412 ESM \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c CJS \u043a\u0430\u043a default import.\nimport legacyPackage from './legacy.cjs';\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-5",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsxs)(n.p,{children:["Node.js \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u0432\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0424\u0430\u0439\u043b ",(0,d.jsx)(n.code,{children:".cjs"})," \u0442\u0440\u0430\u043a\u0442\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a CommonJS, ",(0,d.jsx)(n.code,{children:".mjs"})," - \u043a\u0430\u043a ESM, \u0430 ",(0,d.jsx)(n.code,{children:".js"})," \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e ",(0,d.jsx)(n.code,{children:"package.json"})," \u0441 \u043f\u043e\u043b\u0435\u043c ",(0,d.jsx)(n.code,{children:"type"}),". \u042d\u0442\u043e \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 source of bugs \u043f\u0440\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438: \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u0430 \u0432 CI \u043f\u0430\u043a\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u043c loader-\u043e\u043c."]}),"\n",(0,d.jsxs)(n.p,{children:["Interop \u0442\u043e\u0436\u0435 \u043d\u0435 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u043d. ESM \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c CommonJS, \u043d\u043e CJS \u0447\u0435\u0440\u0435\u0437 ",(0,d.jsx)(n.code,{children:"require"})," \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 ESM \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u0435\u0437 top-level ",(0,d.jsx)(n.code,{children:"await"}),"; \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043b\u044f CJS -> ESM \u0447\u0430\u0441\u0442\u043e ",(0,d.jsx)(n.code,{children:"await import(...)"}),'. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c migration plan, \u0430 \u043d\u0435 \u043b\u043e\u0437\u0443\u043d\u0433 "\u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0430 ESM".']}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-5",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0420\u0435\u0448\u0435\u043d\u0438\u0435"}),(0,d.jsx)(n.th,{children:"\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442"}),(0,d.jsx)(n.th,{children:"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0435\u0440\u0435\u0434 merge"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u041e\u0441\u0442\u0430\u0432\u0438\u0442\u044c CJS"}),(0,d.jsx)(n.td,{children:"legacy \u0441\u0435\u0440\u0432\u0438\u0441, \u043c\u043d\u043e\u0433\u043e CJS-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439"}),(0,d.jsx)(n.td,{children:"\u043d\u0435\u0442 ESM-only \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 critical path"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 ESM"}),(0,d.jsxs)(n.td,{children:["\u043d\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, modern tooling, top-level ",(0,d.jsx)(n.code,{children:"await"})]}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:'type: "module"'}),", \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u0435\u0441\u0442\u044b CI"]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0421\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c"}),(0,d.jsx)(n.td,{children:"\u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u0430\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f"}),(0,d.jsxs)(n.td,{children:["\u044f\u0432\u043d\u044b\u0435 ",(0,d.jsx)(n.code,{children:".cjs/.mjs"})," boundary files"]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:["Dynamic ",(0,d.jsx)(n.code,{children:"import()"})]}),(0,d.jsx)(n.td,{children:"CJS \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c ESM"}),(0,d.jsx)(n.td,{children:"\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c async boundary \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438"})]})]})]}),"\n",(0,d.jsxs)(n.p,{children:["\u041a\u0435\u0439\u0441: \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043e\u043d\u0430 \u0441\u0442\u0430\u043b\u0430 ESM-only, \u0430 \u0441\u0435\u0440\u0432\u0438\u0441 CommonJS \u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043b\u0430\u043d: \u043d\u0430\u0439\u0442\u0438 \u0442\u043e\u0447\u043a\u0443 \u0438\u043c\u043f\u043e\u0440\u0442\u0430, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 dynamic ",(0,d.jsx)(n.code,{children:"import()"})," \u0438\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c ESM boundary, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c cold start, \u0442\u0435\u0441\u0442\u044b \u0438 \u0441\u0431\u043e\u0440\u043a\u0443, \u0437\u0430\u0442\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c, \u043d\u0443\u0436\u043d\u0430 \u043b\u0438 \u043f\u043e\u043b\u043d\u0430\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-5",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 module interop decision table \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430: ",(0,d.jsx)(n.code,{children:"type"}),", entrypoint, test runner, build, CJS-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, ESM-only \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438."]}),"\n",(0,d.jsxs)(n.li,{children:["\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 2 \u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440\u0430: ESM \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 CJS; CJS \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 ESM \u0447\u0435\u0440\u0435\u0437 dynamic ",(0,d.jsx)(n.code,{children:"import()"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["\u041e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"__dirname"})," \u0432 ESM \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0432 CJS \u0438 \u0447\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c."]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-5",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u041c\u0435\u043d\u044f\u044e\u0442 ",(0,d.jsx)(n.code,{children:"type"})," \u0432 ",(0,d.jsx)(n.code,{children:"package.json"})," \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0441\u0435\u0445 entrypoints."]}),"\n",(0,d.jsxs)(n.li,{children:["\u0414\u0443\u043c\u0430\u044e\u0442, \u0447\u0442\u043e ",(0,d.jsx)(n.code,{children:"import"})," \u0438 ",(0,d.jsx)(n.code,{children:"require"})," \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c."]}
1),"\n",(0,d.jsxs)(n.li,{children:["\u041b\u043e\u043c\u0430\u044e\u0442 ",(0,d.jsx)(n.code,{children:"__dirname"}),", ",(0,d.jsx)(n.code,{children:"__filename"}),", JSON/native imports \u0438\u043b\u0438 test runner \u043f\u0440\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438."]}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 ESM-only \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-5",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u041a\u0430\u043a Node \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e ",(0,d.jsx)(n.code,{children:".js"})," \u0444\u0430\u0439\u043b \u043d\u0430\u0434\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u043a ESM \u0438\u043b\u0438 CJS?"]}),"\n",(0,d.jsxs)(n.li,{children:["\u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 CJS \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u0442 ",(0,d.jsx)(n.code,{children:"require"})," ESM-\u043c\u043e\u0434\u0443\u043b\u044c \u0441 top-level ",(0,d.jsx)(n.code,{children:"await"}),"?"]}),"\n",(0,d.jsxs)(n.li,{children:["\u041a\u0430\u043a \u0432 ESM \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433 ",(0,d.jsx)(n.code,{children:"__dirname"}),"?"]}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u0431\u044b \u0432\u044b \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 CJS-\u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u0435\u0437 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-5",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["Node.js module resolution: ",(0,d.jsx)(n.code,{children:".cjs"}),", ",(0,d.jsx)(n.code,{children:".mjs"}),", ",(0,d.jsx)(n.code,{children:"type"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["ESM/CommonJS interop \u0438 dynamic ",(0,d.jsx)(n.code,{children:"import()"}),"."]}),"\n",(0,d.jsx)(n.li,{children:"\u041e\u0442\u043b\u0438\u0447\u0438\u044f module scope \u0432 CJS \u0438 ESM."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-5",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-7",children:"7. \u041a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 error handling \u0432 Node API?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-6",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"\u0426\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 error handling \u0432 Node API \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0435\u0434\u0438\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, middleware/filter \u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0435 HTTP, \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e response envelope, \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 request/trace id \u0438 \u0437\u0430\u043f\u0440\u0435\u0442\u0430 \u0443\u0442\u0435\u0447\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u0443."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-6",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}
1),"\n",(0,d.jsxs)(n.p,{children:["\u042f \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0435 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0435, \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435, auth/permission, dependency failures \u0438 unexpected 500. \u041d\u0430 HTTP-\u0433\u0440\u0430\u043d\u0438\u0446\u0435 \u043c\u0430\u043f\u043b\u044e \u0438\u0445 \u0432 \u0441\u0442\u0430\u0442\u0443\u0441, \u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u0412 Express \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 error middleware, \u043a\u0443\u0434\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 ",(0,d.jsx)(n.code,{children:"next(err)"})," \u0438 rejected async handlers. \u0412\u0430\u0436\u043d\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c stack \u0438 context \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0431\u0435\u0437 stack trace \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-6",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"import express from 'express';\nconst app = express();\n\napp.get('/users/:id', async (req, res) => {\n  const user = await loadUser(req.params.id);\n  if (!user) throw new NotFoundError('USER_NOT_FOUND');\n  res.json(user);\n});\n\napp.use((err, req, res, _next) => {\n  const mapped = mapError(err);\n  req.log.error({ err, requestId: req.id }, 'request failed');\n  res.status(mapped.status).json({ error: mapped.body });\n});\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-6",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsx)(n.p,{children:'\u0426\u0435\u043b\u044c \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b "\u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438", \u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f \u0441\u0431\u043e\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u043b\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0434\u0430\u0442\u044c 400 \u0441 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043f\u043e\u043b\u0435\u043c, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 - 404, \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 - 409, \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 - \u0447\u0430\u0441\u0442\u043e 502/503, \u0430 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 bug - 500 \u0441 generic message.'}),"\n",(0,d.jsxs)(n.p,{children:["\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043b\u043e\u0432\u0443\u0448\u043a\u0430 - async errors. \u0412 Express 5 rejected Promise \u
10438\u0437 route handler \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0434\u0435\u0442 \u0432 ",(0,d.jsx)(n.code,{children:"next"}),", \u043d\u043e \u0432 \u0441\u0442\u0430\u0440\u043e\u043c \u043a\u043e\u0434\u0435 \u0438 callbacks \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 ",(0,d.jsx)(n.code,{children:"next(err)"}),". \u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u043b\u043e\u0432\u0443\u0448\u043a\u0430 - \u0434\u0432\u043e\u0439\u043d\u043e\u0439 response: \u0435\u0441\u043b\u0438 headers \u0443\u0436\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b, error middleware \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 JSON."]}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-6",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u041e\u0448\u0438\u0431\u043a\u0430"}),(0,d.jsx)(n.th,{children:"HTTP"}),(0,d.jsx)(n.th,{children:"\u0427\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0443"}),(0,d.jsx)(n.th,{children:"\u0427\u0442\u043e \u0432 \u043b\u043e\u0433"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Validation"}),(0,d.jsx)(n.td,{children:"400"}),(0,d.jsx)(n.td,{children:"field-level code/message"}),(0,d.jsx)(n.td,{children:"invalid fields \u0431\u0435\u0437 sensitive values"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"AuthN/AuthZ"}),(0,d.jsx)(n.td,{children:"401/403"}),(0,d.jsx)(n.td,{children:"stable error code"}),(0,d.jsx)(n.td,{children:"subject, route, policy result"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Not found"}),(0,d.jsx)(n.td,{children:"404"}),(0,d.jsx)(n.td,{children:"resource-specific code"}),(0,d.jsx)(n.td,{children:"lookup keys \u0431\u0435\u0437 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Conflict"}),(0,d.jsx)(n.td,{children:"409"}),(0,d.jsx)(n.td,{children:"retry/change input hint"}),(0,d.jsx)(n.td,{children:"version/idempotency context"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Dependency timeout"}),(0,d.jsx)(n.td,{children:"502/503/504"}),(0,d.jsx)(n.td,{children:"temporary failure code"}),(0,d.jsx)(n.td,{children:"dependency, timeout, attempt"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Unexpected bug"}),(0,d.jsx)(n.td,{children:"500"}),(0,d.jsx)(n.td,{children:"generic message"}),(0,d.jsx)(n.td,{children:"stack, request id, release version"})]})]})]}),"\n",(0,d.jsxs)(n.p,{children:["\u041a\u0435\u0439\u0441: \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 timeout. \u041f\u043b\u043e\u0445\u043e\u0439 \u043e\u0442\u0432\u0435\u0442 - \u0432\u0435\u0440\u043d\u0443\u0442\u044c ",(0,d.jsx)(n.code,{children:"500"})," \u0438 stack \u043d\u0430\u0440\u0443\u0436\u0443. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442 - timeout \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a dependency failure, \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434, retry policy \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0432 \u043b\u043e\u0433\u0430\u0445 \u0435\u0441\u0442\u044c trace id \u0438 dependency latency."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-6",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 API error envelope mapping: domain error -> status -> public code -> log context."}),"\n",(0,d.jsx)(n.li,{children:"\u0420\u0430\u0437\u0431\u0435\u0440\u0438\u0442\u0435 5 \u043e\u0448\u0438\u0431\u043e\u043a: validation, not found, duplicate, dependency timeout, unexpected throw."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e: \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u043b\u044f \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0438 \u043a\u0430\u043a\u0438\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u044b \u0432 \u043b\u043e\u0433\u0430\u0445."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-6",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u041e\u0442\u0434\u0430\u044e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 raw ",(0,d.jsx)(n.code,{children:"err.message"})," \u0438 stack trace."]}),"\n",(0,d.jsxs)(n.li,{children:["\u0412\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0432 ",(0,d.jsx)(n.code,{children:"500"}),", \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c."]}
1),"\n",(0,d.jsx)(n.li,{children:"\u041b\u043e\u0433\u0438\u0440\u0443\u044e\u0442 \u0431\u0435\u0437 request/trace id \u0438 \u043f\u043e\u0442\u043e\u043c \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c."}),"\n",(0,d.jsx)(n.li,{children:"\u0417\u0430\u0431\u044b\u0432\u0430\u044e\u0442 async/callback errors \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 unhandled rejection \u0438\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0448\u0438\u0439 request."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-6",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0427\u0435\u043c operational error \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 programmer error?"}),"\n",(0,d.jsx)(n.li,{children:"\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 headers?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c backward compatibility error envelope?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0436\u043d\u043e retry-\u0438\u0442\u044c, \u0430 \u043a\u0430\u043a\u0438\u0435 \u043d\u0435\u043b\u044c\u0437\u044f?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-6",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"Express error middleware \u0438 async handler behavior."}),"\n",(0,d.jsx)(n.li,{children:"HTTP status mapping: 400/401/403/404/409/429/5xx."}),"\n",(0,d.jsx)(n.li,{children:"Correlation id, trace id, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-6",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-8",children:"8. \u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c graceful shutdown \u0441\u0435\u0440\u0432\u0438\u0441\u0430?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-7",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"Graceful shutdown - \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435: \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b, \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0434\u0430\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 deadline, \u0437\u0430\u043a\u0440\u044b\u0442\u044c HTTP server, DB/broker/resources \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-7",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}
1),"\n",(0,d.jsxs)(n.p,{children:["\u042f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e shutdown \u043a\u0430\u043a drain protocol. \u041d\u0430 ",(0,d.jsx)(n.code,{children:"SIGTERM"})," \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 readiness \u0432 not ready, \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u0435\u043c \u043d\u043e\u0432\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 ",(0,d.jsx)(n.code,{children:"server.close"}),", \u0436\u0434\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u0444\u043e\u043d\u043e\u0432\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 DB/broker, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u0412 Node \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u043e keep-alive connections \u0438 upgraded sockets: \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u044b ",(0,d.jsx)(n.code,{children:"closeIdleConnections"})," \u0438\u043b\u0438 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b\u0439 ",(0,d.jsx)(n.code,{children:"closeAllConnections"})," \u043f\u043e\u0441\u043b\u0435 deadline."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-7",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"process.on('SIGTERM', async () => {\n  server.close(async () => {\n    await db.close();\n    process.exit(0);\n  });\n\n  setTimeout(() => {\n    server.closeAllConnections();\n    process.exit(1);\n  }, 30_000).unref();\n});\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-7",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"server.close"}),' \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445. \u042d\u0442\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e "\u0441\u0440\u0430\u0437\u0443 \u0443\u0431\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441". \u041d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e \u0432\u0430\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e shutdown \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u043c: ',(0,d.jsx)(n.code,{children:"SIGTERM"})," \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0439\u0442\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e, \u0430 cleanup \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b."]}),"\n",(0,d.jsxs)(n.p,{children:["\u0413\u043b\u0430\u0432\u043d\u044b\u0439 production-\u0440\u0438\u0441\u043a - \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c in-flight \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u043d\u0443\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u0435\u043d deadline: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 25-30 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u043e\u0434 orchestrator grace peri
1od. \u0414\u043b\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439 \u0438 \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0430\u044e\u0442, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c: \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u0432\u0435\u0440\u043d\u0443\u0442\u044c job \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c checkpoint \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 ",(0,d.jsx)(n.code,{children:"AbortController"}),"."]}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-7",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0428\u0430\u0433"}),(0,d.jsx)(n.th,{children:"\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c"}),(0,d.jsx)(n.th,{children:"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Signal"}),(0,d.jsxs)(n.td,{children:["\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c ",(0,d.jsx)(n.code,{children:"SIGTERM"}),"/",(0,d.jsx)(n.code,{children:"SIGINT"})," \u043e\u0434\u0438\u043d \u0440\u0430\u0437"]}),(0,d.jsx)(n.td,{children:"\u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u043d\u0435 \u043b\u043e\u043c\u0430\u0435\u0442 cleanup"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Readiness"}),(0,d.jsx)(n.td,{children:"\u0443\u0431\u0440\u0430\u0442\u044c instance \u0438\u0437 \u0442\u0440\u0430\u0444\u0438\u043a\u0430"}),(0,d.jsx)(n.td,{children:"\u043d\u043e\u0432\u044b\u0439 traffic \u043d\u0435 \u0438\u0434\u0435\u0442 \u043d\u0430 pod/process"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"HTTP drain"}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"server.close"}),", active requests \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442\u0441\u044f"]}),(0,d.jsx)(n.td,{children:"p99 \u043d\u0435 \u043e\u0431\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u043e\u0432\u043e"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Resources"}),(0,d.jsx)(n.td,{children:"\u0437\u0430\u043a\u0440\u044b\u0442\u044c DB, cache, broker, timers"}),(0,d.jsx)(n.td,{children:"\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0435 \u0432\u0438\u0441\u0438\u0442 \u0438\u0437-\u0437\u0430 handles"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Deadline"}),(0,d.jsx)(n.td,{children:"forced close/exit \u043f\u043e\u0441\u043b\u0435 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430"}),(0,d.jsx)(n.td,{children:"deploy \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:"\u041a\u0435\u0439\u0441: rolling deploy \u043e\u0431\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u044b\u0435 requests. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442: readiness \u0441\u043d\u0430\u0447\u0430\u043b\u0430, \u043f\u043e\u0442\u043e\u043c drain HTTP, \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 idempotency key, \u0444\u043e\u043d\u043e\u0432\u044b\u0435 job \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u043e ack, \u0432 \u043b\u043e\u0433\u0430\u0445 \u0435\u0441\u0442\u044c shutdown phase \u0438 counts \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-7",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 shutdown drain checklist \u0434\u043b\u044f HTTP + DB + queue."}),"\n",(0,d.jsx)(n.li,{children:"\u041e\u043f\u0438\u0448\u0438\u0442\u0435, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c keep-alive \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u0438 \u0434\u043e\u043b\u0433\u043e\u043c request."}),"\n",(0,d.jsxs)(n.li,{children:["\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 readiness-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f: ",(0,d.jsx)(n.code,{children:"ready"}),", ",(0,d.jsx)(n.code,{children:"draining"}),", ",(0,d.jsx)(n.code,{children:"stopped"}),"."]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-7",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0421\u0440\u0430\u0437\u0443 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 ",(0,d.jsx)(n.code,{children:"process.exit(0)"})," \u0438 \u0440\u0435\u0436\u0443\u0442 active requests."]}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u0441\u0442\u0430\u0432\u044f\u0442 \u043e\u0431\u0449\u0438\u0439 shutdown deadline."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0442 keep-alive/idle/upgraded connections."}),"\n",(0,d.jsx)(n.li,{children:"\u0417\u0430\u0431\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u043e \u0444\u043e\u043d\u043e\u0432\u044b\u0435 timers, consumers \u0438 DB pool."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-7",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0427\u0435\u043c readiness \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 liveness \u043f\u0440\u0438 shutdown?"}),"\n",(0,d.jsx)(n.li,{children:"\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 WebSocket \u0438\u043b\u0438 HTTP upgraded connections?"}),"\n",(0,d.jsxs)(n.li,{children:["\u041a\u0430\u043a \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e ",(0,d.jsx)(n.code,{children:"SIGTERM"}),"?"]}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c graceful shutdown \u0432 e2e \u0438\u043b\u0438 staging?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-7",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"Node.js signal events."}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"http.Server.close"}),", ",(0,d.jsx)(n.code,{children:"closeIdleConnections"}),", ",(0,d.jsx)(n.code,{children:"closeAllConnections"}),"."]}),"\n",(0,d.jsx)(n.li,{children:"Readiness/liveness \u0438 orchestrator grace peri
1od."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-7",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-9",children:"9. \u041a\u0430\u043a \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c API \u043e\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 (rate limit/backpressure)?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-8",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"\u0417\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 - \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u043d\u0430 \u0432\u0445\u043e\u0434, \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u0432\u044b\u0445\u043e\u0434: rate limit, timeouts, concurrency limits, queue/backpressure, payload limits, circuit breaker \u0438 \u0447\u0435\u0441\u0442\u043d\u0430\u044f \u0434\u0435\u0433\u0440\u0430\u0434\u0430\u0446\u0438\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-8",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}),"\n",(0,d.jsxs)(n.p,{children:["\u0412 Node API \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0440\u043e\u0441\u0442 event loop lag, memory RSS, pending requests \u0438 timeouts \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u042f \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0441\u044c \u0441\u043b\u043e\u044f\u043c\u0438: reverse proxy/WAF, rate limit \u043f\u043e \u043a\u043b\u044e\u0447\u0443, \u043b\u0438\u043c\u0438\u0442 payload, HTTP headers/request timeouts, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 concurrency \u043d\u0430 \u0434\u043e\u0440\u043e\u0433\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445, \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441 max length \u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 ",(0,d.jsx)(n.code,{children:"429/503"}),', \u0435\u0441\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u0443\u0441\u043f\u0435\u0432\u0430\u0435\u0442. Backpressure \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 "\u043f\u0440\u0438\u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442\u044c \u0438\u043b\u0438 \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c", \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c.']}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-8",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"const MAX_IN_FLIGHT = 50;\nlet inFlight = 0;\n\napp.use((req, res, next) => {\n  if (inFlight >= MAX_IN_FLIGHT) {\n    return res.status(503).json({ error: { code: 'OVERLOADED' } });\n  }\n  inFlight += 1;\n  res.on('finish', () => { inFlight -= 1; });\n  next();\n});\n"})}),"\n",(0,d.jsx)(n.p,{children:"\u042d\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 concurrency guard;
1 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u043b\u0438\u043c\u0438\u0442\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e route, user/key, dependency \u0438 worker pool."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-8",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsx)(n.p,{children:'Rate limit \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 "\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434". Backpressure \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 "\u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 downstream \u0438\u043b\u0438 \u0441\u0430\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0443\u0436\u0435 \u043d\u0435 \u0443\u0441\u043f\u0435\u0432\u0430\u0435\u0442". Timeouts \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 "\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0436\u0434\u0430\u0442\u044c". \u041d\u0443\u0436\u043d\u044b \u0432\u0441\u0435 \u0442\u0440\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e rate limit \u043d\u0435 \u0441\u043f\u0430\u0441\u0435\u0442 \u043e\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u044b, \u0430 timeout \u0431\u0435\u0437 concurrency limit \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0448\u0442\u043e\u0440\u043c \u0440\u0435\u0442\u0440\u0430\u0435\u0432.'}),"\n",(0,d.jsx)(n.p,{children:"Node.js \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u0435\u043d \u043a \u0442\u044f\u0436\u0435\u043b\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043d\u0430 Event Loop. \u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435: \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439. \u0415\u0441\u043b\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u043e\u0440\u043e\u0433\u043e\u0439 sync JSON parse, regex \u0438\u043b\u0438 CPU-heavy transform, \u043d\u0438\u043a\u0430\u043a\u043e\u0439 rate limit \u043d\u0435 \u0441\u043f\u0430\u0441\u0435\u0442 \u0431\u0435\u0437 \u0432\u044b\u043d\u043e\u0441\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u043b\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f concurrency."}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-8",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0420\u0438\u0441\u043a"}),(0,d.jsx)(n.th,{children:"\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c"}),(0,d.jsx)(n.th,{children:"\u0421\u0438\u0433\u043d\u0430\u043b"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432"}),(0,d.jsx)(n.td,{children:"rate limit, quota, auth key limits"}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"429"}),", requests per key"]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0414\u043e\u0440\u043e\u0433\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f"}),(0,d.jsx)(n.td,{children:"concurrency limit, worker pool, queue"}),(0,d.jsx)(n.td,{children:"in-flight, queue depth"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u041c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c"}),(0,d.jsx)(n.td,{children:"timeout, circuit breaker, fallback"}),(0,d.jsx)(n.td,{children:"dependency latency/error rate"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0411\u043e\u043b\u044c\u0448\u043e\u0439 payload"}),(0,d.jsx)(n.td,{children:"body size limit, stream, backpressure"}),(0,d.jsx)(n.td,{children:"RSS memory, rejected payloads"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Slowloris/\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435 headers"}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"headersTimeout"}),", proxy timeout"]}),(0,d.jsx)(n.td,{children:"open sockets, 408"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Retry storm"}),(0,d.jsx)(n.td,{children:"retry budget, jitter, idempotency"}),(0,d.jsx)(n.td,{children:"retry count, 503/504"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:"\u041a\u0435\u0439\u0441: \u0432\u043d\u0435\u0448\u043d\u0438\u0439 API \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043f\u043e 10 \u0441\u0435\u043a\u0443\u043d\u0434, \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u044b\u0441\u044f\u0447\u0438 pending requests \u0438 \u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438. \u
10425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442: outbound timeout, concurrency limit \u043d\u0430 dependency, circuit breaker, \u0431\u044b\u0441\u0442\u0440\u044b\u0439 fallback/503, \u043c\u0435\u0442\u0440\u0438\u043a\u0438 queue depth \u0438 saturation, \u043f\u043b\u044e\u0441 retry policy \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-8",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 overload control matrix: \u0432\u0445\u043e\u0434, route, dependency, queue, payload, socket."}),"\n",(0,d.jsxs)(n.li,{children:["\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u043e\u0442\u043a\u0430\u0437: ",(0,d.jsx)(n.code,{children:"429"}),", ",(0,d.jsx)(n.code,{children:"503"}),", timeout, fallback \u0438\u043b\u0438 enqueue."]}),"\n",(0,d.jsx)(n.li,{children:"\u041e\u043f\u0438\u0448\u0438\u0442\u0435, \u043a\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043f\u043e\u043a\u0430\u0436\u0443\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u0434\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-8",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u0442\u0430\u0432\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e rate limit \u0438 \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442 dependency/concurrency limits."}),"\n",(0,d.jsx)(n.li,{children:"\u0414\u0435\u043b\u0430\u044e\u0442 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438."}),"\n",(0,d.jsx)(n.li,{children:"\u0420\u0435\u0442\u0440\u0430\u044f\u0442 \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0431\u0435\u0437 jitter \u0438 idempotency."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442 body size \u0438 headers/request timeouts."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-8",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0427\u0435\u043c ",(0,d.jsx)(n.code,{children:"429"})," \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 ",(0,d.jsx)(n.code,{children:"503"})," \u0432 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0435?"]}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u043e\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0435 \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443, \u0447\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a timeout \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u0438\u043b\u0438\u0442\u044c retry storm?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043f\u043e\u043a\u0430\u0436\u0443\u0442 saturation Node-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-8",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:'Event loop lag \u0438 "do not block the event loop".'}),"\n",(0,d.jsx)(n.li,{children:"HTTP timeouts: headers/request/keep-alive."}),"\n",(0,d.jsx)(n.li,{children:"Backpressure, queue depth, concurrency limits."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-8",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-10",children:"10. \u041a\u0430\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-9",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}
1),"\n",(0,d.jsx)(n.p,{children:'\u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 "\u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e", \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 "\u043a\u0430\u043a\u043e\u0439 \u043f\u0443\u0442\u044c \u043f\u0440\u043e\u0448\u0435\u043b \u0437\u0430\u043f\u0440\u043e\u0441", \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 "\u043a\u0430\u043a \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438". \u0412 Node API \u043d\u0443\u0436\u043d\u044b structured logs, request/trace id, span context, latency/error fields \u0438 \u0437\u0430\u043f\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u044b/PII.'}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-9",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}),"\n",(0,d.jsx)(n.p,{children:"\u042f \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u044e observability \u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043f\u0440\u0438 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0435: \u043a\u0430\u043a\u043e\u0439 request \u0443\u043f\u0430\u043b, \u043a\u0430\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442, \u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442, \u043a\u0430\u043a\u043e\u0439 release \u044d\u0442\u043e \u043f\u0440\u0438\u043d\u0435\u0441. \u0412 \u043b\u043e\u0433\u0430\u0445 \u0445\u0440\u0430\u043d\u044e structured JSON \u0441 level, message, requestId/traceId, route, status, duration, error code. \u0412 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0435 span \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0438 \u0435\u0435 children: HTTP handler, DB query, external call, queue produce/consume. \u0421\u0435\u043a\u0440\u0435\u0442\u044b \u0438 raw payload \u043d\u0435 \u043b\u043e\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f."}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-9",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"req.log.info({\n  requestId: req.id,\n  traceId: req.traceId,\n  route: 'GET /users/:id',\n  statusCode: res.statusCode,\n  durationMs,\n}, 'request completed');\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-9",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsx)(n.p,{children:'\u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0435 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a "\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c Winston/Pino". \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u0430; \u0432\u0430\u0436\u043d\u0430 \u0441\u0445\u0435\u043c\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432. \u041b\u043e\u0433 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u043d\u043e-\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c \u0438 \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0441 trace. Trace \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443, \u0430 span - \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 start/end time, attributes \u0438 status. \u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u044b: RPS, p95/p99 latency, error rate, saturation, queue depth.'}),"\n",(0,d.jsx)(n.p,{children:"\u0412 Node-\u043a\u043e\u0434\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c - async context propagation. \u0415\u0441\u043b\u0438 request id \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 middleware, promise, 
1callback \u0438\u043b\u0438 queue, \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u044f\u0432\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0447\u0442\u043e request/trace id \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 async boundaries \u0438 external calls."}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-9",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0421\u0438\u0433\u043d\u0430\u043b"}),(0,d.jsx)(n.th,{children:"\u0427\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c"}),(0,d.jsx)(n.th,{children:"\u0417\u0430\u0447\u0435\u043c"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Log"}),(0,d.jsx)(n.td,{children:"event, level, requestId, route, error code"}),(0,d.jsx)(n.td,{children:"\u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Trace"}),(0,d.jsx)(n.td,{children:"trace id, spans, parent/child, status"}),(0,d.jsx)(n.td,{children:"\u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0443\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Metric"}),(0,d.jsx)(n.td,{children:"latency, error rate, saturation, throughput"}),(0,d.jsx)(n.td,{children:"\u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u0440\u0435\u043d\u0434 \u0438 \u0430\u043b\u0435\u0440\u0442"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Event"}),(0,d.jsx)(n.td,{children:"business milestone \u0431\u0435\u0437 PII"}),(0,d.jsx)(n.td,{children:"\u043f\u043e\u043d\u044f\u0442\u044c \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:"\u041a\u0435\u0439\u0441: \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0436\u0430\u043b\u0443\u044e\u0442\u0441\u044f \u043d\u0430 sporadic 5xx. \u0421\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442: \u043f\u043e error rate \u0430\u043b\u0435\u0440\u0442\u0438\u043c, \u043f\u043e trace id \u043d\u0430\u0445\u043e\u0434\u0438\u043c route, \u0432 span \u0432\u0438\u0434\u0438\u043c external call timeout, \u0432 \u043b\u043e\u0433\u0430\u0445 \u0435\u0441\u0442\u044c public error code \u0438 dependency attempt, \u0432 \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u0445 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u043c \u0440\u043e\u0441\u0442 p99 latency \u0438\u043c\u0435\u043d\u043d\u043e \u0443 dependency."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-9",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 logging/tracing signal map \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e endpoint: request start, DB call, external call, response, error."}),"\n",(0,d.jsx)(n.li,{children:"\u0423\u043a\u0430\u0436\u0438\u0442\u0435, \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u043b\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b, \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u044b, \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u044e\u0442 high-cardinality \u0440\u0438\u0441\u043a."}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435 60-\u0441\u0435\u043a\u0443\u043d\u0434\u043d\u044b\u0439 incident walkthrough \u043e\u0442 alert \u0434\u043e root cause."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-9",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u041f\u0438\u0448\u0443\u0442 plain text logs \u0431\u0435\u0437 request id \u0438 structured fields."}
1),"\n",(0,d.jsx)(n.li,{children:"\u041b\u043e\u0433\u0438\u0440\u0443\u044e\u0442 raw body, \u0442\u043e\u043a\u0435\u043d\u044b, cookies \u0438\u043b\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435."}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u0443\u0442\u0430\u044e\u0442 logs, metrics \u0438 traces \u0438 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435."}),"\n",(0,d.jsx)(n.li,{children:"\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 high-cardinality labels \u0432 \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 user id."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-9",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0427\u0435\u043c log \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 trace span?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a\u0438\u0435 \u043f\u043e\u043b\u044f \u043d\u0443\u0436\u043d\u044b \u0432 error log \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f?"}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u043e\u0447\u0435\u043c\u0443 user id \u043e\u043f\u0430\u0441\u0435\u043d \u043a\u0430\u043a metric label?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e trace id \u043d\u0435 \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432 async code?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-9",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"OpenTelemetry traces, spans, context propagation."}),"\n",(0,d.jsx)(n.li,{children:"Structured logging \u0438 redaction."}),"\n",(0,d.jsx)(n.li,{children:"RED/USE style metrics: rate, errors, duration, saturation."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-9",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-11",children:"11. \u041a\u0430\u043a \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 secrets?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-10",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 Node-\u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u0434\u0435\u0440\u0436\u0430\u0442 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0440\u0435\u0434\u0435, \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u044e\u0442 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0438 \u0447\u0438\u0442\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 config layer. Secrets \u043d\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u044f\u0442 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u043d\u0435 \u043b\u043e\u0433\u0438\u0440\u0443\u044e\u0442; \u0438\u0445 \u0445\u0440\u0430\u043d\u044f\u0442 \u0432 secret manager \u0438\u043b\u0438 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0439 runtime-\u0441\u0440\u0435\u0434\u0435 \u0441 \u0440\u043e\u0442\u0430\u0446\u0438\u0435\u0439."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-10",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}
1),"\n",(0,d.jsxs)(n.p,{children:["\u042f \u0431\u044b \u043d\u0430\u0447\u0430\u043b \u0441 fail-fast: \u0435\u0441\u043b\u0438 ",(0,d.jsx)(n.code,{children:"DATABASE_URL"}),", ",(0,d.jsx)(n.code,{children:"JWT_ISSUER"})," \u0438\u043b\u0438 timeout \u0437\u0430\u0434\u0430\u043d\u044b \u043d\u0435\u0432\u0435\u0440\u043d\u043e, \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043f\u0430\u0441\u0442\u044c \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435, \u0430 \u043d\u0435 \u043b\u043e\u043c\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434 \u043f\u0435\u0440\u0432\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c. ",(0,d.jsx)(n.code,{children:"process.env"})," \u0432 Node \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0430, boolean \u0438 \u0441\u043f\u0438\u0441\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0438 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c. Secrets \u043e\u0442\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 config flags: \u0443 \u043d\u0438\u0445 \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f, \u0430\u0443\u0434\u0438\u0442, \u0440\u043e\u0442\u0430\u0446\u0438\u044f \u0438 redaction \u0432 \u043b\u043e\u0433\u0430\u0445."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-10",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"const config = {\n  port: Number.parseInt(process.env.PORT ?? '', 10),\n  jwtIssuer: process.env.JWT_ISSUER,\n  requestTimeoutMs: Number.parseInt(process.env.REQUEST_TIMEOUT_MS ?? '', 10),\n};\n\nif (!Number.isInteger(config.port) || !config.jwtIssuer) {\n  throw new Error('Invalid runtime configuration');\n}\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-10",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsxs)(n.p,{children:["\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u043c\u044b\u0441\u043b\u044c: env - \u044d\u0442\u043e transport, \u0430 \u043d\u0435 \u0442\u0438\u043f\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430. \u0412\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u043e\u0439\u0442\u0438 schema validation. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 config layer \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u0436\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f: ",(0,d.jsx)(n.code,{children:"number"}),", ",(0,d.jsx)(n.code,{children:"boolean"}),", enum, URL, duration. \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043a\u043e\u0434 \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 ",(0,d.jsx)(n.code,{children:"process.env.X"})," \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0438 \u043d\u0435 \u0440\u0430\u0437\u043c\u0430\u0437\u044b\u0432\u0430\u0435\u0442 parsing bugs \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0443."]}),"\n",(0,d.jsxs)(n.p,{children:["Secrets - \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f. Access token, private key, DB password, webhook secret \u043d\u0435\u043b\u044c\u0437\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 ",(0,d.jsx)(n.code,{children:".env.example"}),", \u043b\u043e\u0433\u0430\u0445, \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u0445, client bundle \u0438\u043b\u0438 issue-\u0442\u0440\u0435\u043a\u0435\u0440\u0435. \u041d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c lifecycle: provision -> use -> rotate -> revoke -> audit."]}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-10",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0422\u0438\u043f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f"}),(0,d.jsx)(n.th,{children:"\u041f\u0440\u0438\u043c\u0435\u0440"}),(0,d.jsx)(n.th,{children:"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Required env"}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"DATABASE_URL"})}),(0,d.jsx)(n.td,{children:"\u0435\u0441\u0442\u044c, \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 URL"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Number"}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"PORT"}),", ",(0,d.jsx)(n.code,{children:"TIMEOUT_MS"})]}),(0,d.jsx)(n.td,{children:"integer, \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Enum"}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"NODE_ENV"}),", ",(0,d.jsx)(n.code,{children:"LOG_LEVEL"})]}),(0,d.jsx)(n.td,{children:"\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Boolean"}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"FEATURE_X_ENABLED"})}),(0,d.jsx)(n.td,{children:"\u044f\u0432\u043d\u044b\u0439 parser, \u043d\u0435 truthy string"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Secret"}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"JWT_PRIVATE_KEY"})}),(0,d.jsx)(n.td,{children:"\u043d\u0435 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0434\u043e\u0441\u0442\u0443\u043f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d, \u0435\u0441\u0442\u044c \u0440\u043e\u0442\u0430\u0446\u0438\u044f"})]})]})]}),"\n",(0,d.jsxs)(n.p,{children:["\u041a\u0435\u0439\u0441: ",(0,d.jsx)(n.code,{children:'CACHE_TTL_SECONDS="0"'})," \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0442\u0440\u0430\u043a\u0442\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a truthy string \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u044d\u0448 \u0431\u0435\u0437 TTL. \u0421\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442: config schema \u043f\u0430\u0440\u0441\u0438\u0442 number, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 ",(0,d.jsx)(n.code,{children:"min/max"}),", \u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0438 \u0438\u043c\u0435\u0435\u0442 \u0442\u0435\u0441\u0442 \u043d\u0430 production env sample."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-10",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 env validation checklist: required, type, range, default, secret/redaction, owner."}),"\n",(0,d.jsxs)(n.li,{children:["\u041e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"process.env.FEATURE_ENABLED === 'false'"})," \u043e\u043f\u0430\u0441\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u0430\u043a boolean."]}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435 runbook \u0440\u043e\u0442\u0430\u0446\u0438\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u0430: \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u044e\u0447, dual-read/dual-sign, rollout, revoke old."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-10",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0427\u0438\u0442\u0430\u044e\u0442 ",(0,d.jsx)(n.code,{children:"process.env"})," \u043f\u0440\u044f\u043c\u043e \u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435."]}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u044e\u0442 env \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 runtime-\u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442."}
1),"\n",(0,d.jsx)(n.li,{children:"\u041b\u043e\u0433\u0438\u0440\u0443\u044e\u0442 secrets \u0432 error context \u0438\u043b\u0438 config dump."}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u0443\u0442\u0430\u044e\u0442 public config \u0438 secret config."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-10",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u041f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"process.env"})," \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u0430\u043a config layer?"]}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0440\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c JWT signing key?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a\u0438\u0435 env \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u043c\u0435\u0442\u044c \u0441 default?"}),"\n",(0,d.jsxs)(n.li,{children:["\u0427\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432 ",(0,d.jsx)(n.code,{children:".env.example"}),", \u0430 \u0447\u0435\u0433\u043e \u0442\u0430\u043c \u0431\u044b\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e?"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-10",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["Node.js ",(0,d.jsx)(n.code,{children:"process.env"})," \u0438 env files."]}),"\n",(0,d.jsx)(n.li,{children:"12-factor config principle."}),"\n",(0,d.jsx)(n.li,{children:"Secret redaction, rotation, least privilege."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-10",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-12",children:"12. \u041a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 Node?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-11",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsxs)(n.p,{children:["\u0411\u043e\u043b\u044c\u0448\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 Node \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 streaming pipeline-\u043e\u043c \u0441 \u043b\u0438\u043c\u0438\u0442\u0430\u043c\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0442\u0438\u043f\u0430, \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0447\u0442\u0435\u043d\u0438\u044f. \u041d\u0435\u043b\u044c\u0437\u044f \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0444\u0430\u0439\u043b \u0432 ",(0,d.jsx)(n.code,{children:"Buffer"})," \u0438\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430: \u044d\u0442\u043e \u0432\u0435\u0434\u0435\u0442 \u043a OOM \u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432."]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-11",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}
1),"\n",(0,d.jsx)(n.p,{children:"\u042f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e upload \u043a\u0430\u043a pipeline: request stream -> size/type validation -> optional transform/virus scan -> object storage/temp file -> metadata commit. \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0435 \u043d\u0443\u0436\u043d\u044b abort handling, backpressure, cleanup temp files, \u043b\u0438\u043c\u0438\u0442 concurrency \u0438 timeout. \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f CPU-heavy \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0441\u0430\u043c upload \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0435\u0440\u0436\u0430\u0442\u044c HTTP request \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438: \u043b\u0443\u0447\u0448\u0435 \u0432\u0435\u0440\u043d\u0443\u0442\u044c job id \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432 \u0444\u043e\u043d\u0435."}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-11",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"import { pipeline } from 'node:stream/promises';\nimport { createWriteStream } from 'node:fs';\n\napp.post('/upload', async (req, res, next) => {\n  try {\n    await pipeline(req, createWriteStream('/tmp/upload.bin'));\n    res.status(201).json({ ok: true });\n  } catch (error) {\n    next(error);\n  }\n});\n"})}),"\n",(0,d.jsx)(n.p,{children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c, \u043d\u043e \u0432 production \u043a \u043d\u0435\u043c\u0443 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 size limit, type validation, auth, cleanup \u0438 storage policy."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-11",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsxs)(n.p,{children:["\u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c. \u0415\u0441\u0442\u044c slow client, upload abort, \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 ",(0,d.jsx)(n.code,{children:"Content-Type"}),', zip bomb, \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u043a, \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 storage \u0438 CPU-heavy post-processing. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0440\u0435\u043b\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c guards, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e "\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c streams".']}),"\n",(0,d.jsx)(n.p,{children:"Backpressure \u0432\u0430\u0436\u0435\u043d \u0438 \u0437\u0434\u0435\u0441\u044c: \u0435\u0441\u043b\u0438 storage \u043f\u0438\u0448\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442 \u0448\u043b\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, pipeline \u0434\u043e\u043b\u0436\u0435\u043d \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u0435. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u043b\u0438\u043c\u0438\u0442\u043e\u0432, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e."}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-11",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Guard"}),(0,d.jsx)(n.th,{children:"\u0427\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442"}),(0,d.jsx)(n.th,{children:"\u041e\u0448\u0438\u0431\u043a\u0430 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Auth/permission"}),(0,d.jsx)(n.td,{children:"\u043a\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0433\u0440\u0443\u0437\u0438\u0442\u044c"}),(0,d.jsx)(n.td,{children:"storage abuse"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Size limit"}),(0,d.jsx)(n.td,{children:"bytes \u0434\u043e/\u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0447\u0442\u0435\u043d\u0438\u044f"}),(0,d.jsx)(n.td,{children:"OOM, \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u0438\u0441\u043a\u0430"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Type/signature"}),(0,d.jsx)(n.td,{children:"MIME \u0438 magic bytes"}),(0,d.jsx)(n.td,{children:"\u0432\u0440\u0435\u0434\u043d\u044b\u0439 \u0438\u043b\u0438 \u0431\u0438\u0442\u044b\u0439 \u0444\u0430\u0439\u043b"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Timeout/rate"}),(0,d.jsx)(n.td,{children:"\u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442"}),(0,d.jsx)(n.td,{children:"\u0437\u0430\u043d\u044f\u0442\u044b\u0435 sockets"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Backpressure"}),(0,d.jsx)(n.td,{children:"\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c consumer"}),(0,d.jsx)(n.td,{children:"\u0440\u043e\u0441\u0442 \u043f\u0430\u043c\u044f\u0442\u0438"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Cleanup"}),(0,d.jsx)(n.td,{children:"temp file/object"}),(0,d.jsx)(n.td,{children:"\u043c\u0443\u0441\u043e\u0440 \u0438 cost leak"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Async processing"}),(0,d.jsx)(n.td,{children:"\u0442\u044f\u0436\u0435\u043b\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430"}),(0,d.jsx)(n.td,{children:"\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 request path"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:"\u041a\u0435\u0439\u0441: \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0433\u0440\u0443\u0437\u044f\u0442 \u0432\u0438\u0434\u0435\u043e, \u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u0444\u0430\u0439\u043b \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043f\u043e\u0442\u043e\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 storage. \u041f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 RSS \u0440\u0430\u0441\u0442\u0435\u0442 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0430\u0434\u0430\u0435\u0442. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442: streaming upload \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 storage/temp file, \u
1043b\u0438\u043c\u0438\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430, abort cleanup, \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 transcode, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 upload bytes/duration/errors."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-11",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 large-upload pipeline guard list: auth, size, type, timeout, storage, cleanup, async job."}),"\n",(0,d.jsxs)(n.li,{children:["\u041e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 ",(0,d.jsx)(n.code,{children:"aborted"})," request."]}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438: active uploads, bytes uploaded, duration, rejected by size/type, storage error rate."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-11",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 in-memory upload \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432."}),"\n",(0,d.jsxs)(n.li,{children:["\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e ",(0,d.jsx)(n.code,{children:"Content-Type"}),", \u043d\u043e \u043d\u0435 signature/\u0440\u0430\u0437\u043c\u0435\u0440."]}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u0443\u0434\u0430\u043b\u044f\u044e\u0442 temp file \u043f\u0440\u0438 abort/error."}),"\n",(0,d.jsx)(n.li,{children:"\u0414\u0435\u043b\u0430\u044e\u0442 CPU-heavy \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u044f\u043c\u043e \u0432 HTTP handler."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-11",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0427\u0435\u043c multipart upload \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 JSON base64 upload \u043f\u043e \u0440\u0438\u0441\u043a\u0430\u043c \u043f\u0430\u043c\u044f\u0442\u0438?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0442 slow upload \u043a\u043b\u0438\u0435\u043d\u0442\u0430?"}),"\n",(0,d.jsxs)(n.li,{children:["\u041f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"pipeline"})," \u043b\u0443\u0447\u0448\u0435 \u0440\u0443\u0447\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u043a\u0438 listeners?"]}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u0435\u043d pre-signed upload \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 object storage?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-11",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"stream.pipeline"})," \u0438 backpressure."]}),"\n",(0,d.jsx)(n.li,{children:"HTTP request timeouts \u0438 abort handling."}),"\n",(0,d.jsx)(n.li,{children:"File type validation, temp file cleanup, object storage flow."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-11",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-13",children:"13. \u0417\u0430\u0447\u0435\u043c \u0438 \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c healthcheck/readiness endpoints?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-12",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"Liveness/health \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442, \u0436\u0438\u0432 \u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441; readiness \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441. Readiness \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 startup, shutdown/draining \u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0430 health endpoint \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u043c \u0438 \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-12",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}
1),"\n",(0,d.jsxs)(n.p,{children:["\u042f \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e endpoints: ",(0,d.jsx)(n.code,{children:"live"})," - \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0449\u0435\u043d orchestrator-\u043e\u043c; ",(0,d.jsx)(n.code,{children:"ready"})," - instance \u0433\u043e\u0442\u043e\u0432 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c production traffic. \u0412\u043e \u0432\u0440\u0435\u043c\u044f startup readiness false, \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0433\u0440\u0435\u0432\u0430 true, \u043f\u0440\u0438 ",(0,d.jsx)(n.code,{children:"SIGTERM"})," \u0441\u043d\u043e\u0432\u0430 false \u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0443\u0445\u043e\u0434\u0438\u0442 \u0432 drain. \u0412 readiness \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u043c timeout; \u0438\u043d\u0430\u0447\u0435 healthcheck \u0441\u0430\u043c \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-12",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"let draining = false;\n\napp.get('/live', (_req, res) => res.sendStatus(200));\napp.get('/ready', async (_req, res) => {\n  if (draining) return res.sendStatus(503);\n  const dbOk = await checkDb({ timeoutMs: 200 });\n  res.sendStatus(dbOk ? 200 : 503);\n});\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-12",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsxs)(n.p,{children:["Health endpoints \u043d\u0443\u0436\u043d\u044b \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0438 on-call. \u041e\u0448\u0438\u0431\u043a\u0430 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 - \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u0438\u043d ",(0,d.jsx)(n.code,{children:"/health"}),", \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u0440\u0433\u0430\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u0435\u0437 timeout. \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0431\u0430\u0437\u044b healthcheck \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442."]}),"\n",(0,d.jsx)(n.p,{children:"Readiness \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0442\u0440\u0430\u0436\u0430\u0442\u044c routing decision: \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u044d\u0442\u043e\u0442 instance. Liveness \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0439: \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0442\u0440\u043e\u0433\u0430\u044f \u0438 \u043f\u0430\u0434\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b dependency, orchestrator \u043d\u0430\u0447\u043d\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0437\u0434\u043e\u0440\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438 \u0443\u0441\u0438\u043b\u0438\u0442 outage."}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-12",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Endpoint"}),(0,d.jsx)(n.th,{children:"\u041e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441"}),(0,d.jsx)(n.th,{children:"\u0427\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"/live"})}),(0,d.jsx)(n.td,{children:"\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0436\u0438\u0432?"}),(0,d.jsx)(n.td,{children:"event loop responsive, fatal state \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"/ready"})}),(0,d.jsx)(n.td,{children:"\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0430\u0442\u044c traffic?"}),(0,d.jsx)(n.td,{children:"startup done, not draining, critical deps ok"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"/startup"})}),(0,d.jsx)(n.td,{children:"\u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0433\u0440\u0435\u043b\u0441\u044f?"}),(0,d.jsx)(n.td,{children:"migrations/config/warmup \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"/metrics"})}),(0,d.jsx)(n.td,{children:"\u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0430?"}),(0,d.jsx)(n.td,{children:"\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 endpoint, \u043d\u0435 health"})]})]})]}),"\n",(0,d.jsxs)(n.p,{children:["\u041a\u0435\u0439\u0441: \u0431\u0430\u0437\u0430 \u0434\u0435\u0433\u0440\u0430\u0434\u0438\u0440\u0443\u0435\u0442, ",(0,d.jsx)(n.code,{children:"/live"})," \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0431\u0430\u0437\u0443 \u0438 \u043f\u0430\u0434\u0430\u0435\u0442, Kubernetes \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0438\u0442 \u0432\u0441\u0435 pods, cold starts \u0434\u043e\u0431\u0438\u0432\u0430\u044e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442: depen
1dency check \u0436\u0438\u0432\u0435\u0442 \u0432 readiness \u0441 timeout \u0438 cache/jitter, liveness \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0430 \u0430\u043b\u0435\u0440\u0442\u044b \u0438\u0434\u0443\u0442 \u043f\u043e \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c \u0438 error rate."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-12",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 health/readiness dependency matrix: DB, cache, broker, external API, local disk."}),"\n",(0,d.jsx)(n.li,{children:"\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0438\u0442\u0435: \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 readiness \u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0438."}),"\n",(0,d.jsx)(n.li,{children:"\u041e\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 endpoint \u0432\u043e \u0432\u0440\u0435\u043c\u044f startup, normal, dependency degraded, draining."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-12",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u041e\u0434\u0438\u043d endpoint \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f liveness, readiness \u0438 diagnostics."}),"\n",(0,d.jsx)(n.li,{children:"Healthcheck \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0435\u0437 timeout."}),"\n",(0,d.jsx)(n.li,{children:"Liveness \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0431\u0430\u0437\u044b \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 restart storm."}),"\n",(0,d.jsxs)(n.li,{children:["\u041f\u0440\u0438 shutdown readiness \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f ",(0,d.jsx)(n.code,{children:"200"}),", \u0438 traffic \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0438\u0434\u0442\u0438 \u043d\u0430 draining instance."]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-12",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u041f\u043e\u0447\u0435\u043c\u0443 readiness \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u0442\u0430\u0442\u044c false \u0434\u043e ",(0,d.jsx)(n.code,{children:"server.close"}),"?"]}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432 liveness?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c thundering herd \u043e\u0442 health checks?"}),"\n",(0,d.jsxs)(n.li,{children:["\u0427\u0435\u043c ",(0,d.jsx)(n.code,{children:"/metrics"})," \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 ",(0,d.jsx)(n.code,{children:"/ready"}),"?"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-12",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"Liveness, readiness, startup probes."}),"\n",(0,d.jsx)(n.li,{children:"Shutdown draining lifecycle."}),"\n",(0,d.jsx)(n.li,{children:"Dependency timeout, cached health status, alerting by metrics."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-12",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-14",children:"14. \u041a\u0430\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 JWT \u043d\u0430 backend?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),", ",(0,d.jsx)(n.code,{children:"security"}),", ",(0,d.jsx)(n.code,{children:"auth"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-13",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsxs)(n.p,{children:["JWT \u043d\u0430 backend \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0438, ",(0,d.jsx)(n.code,{children:"alg"}),", ",(0,d.jsx)(n.code,{children:"exp"}),", ",(0,d.jsx)(n.code,{children:"nbf"}),", ",(0,d.jsx)(n.code,{children:"iss"}),", ",(0,d.jsx)(n.code,{children:"aud"}),', subject/permissions \u0438 key rotation. \u0422\u043e\u043a\u0435\u043d \u043d\u0435\u043b\u044c\u0437\u044f "\u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u043e\u0432\u0435\u0440\u044f\u0442\u044c"; decode \u0431\u0435\u0437 verify - \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u0435\u043d\u0438\u0435 payload.']}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-13",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}
1),"\n",(0,d.jsxs)(n.p,{children:["\u042f \u043f\u0440\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u044e JWT \u043a\u0430\u043a signed claims, \u0430 \u043d\u0435 \u043a\u0430\u043a session storage. Backend \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 algorithms, \u043d\u0430\u0439\u0442\u0438 \u043a\u043b\u044e\u0447 \u043f\u043e ",(0,d.jsx)(n.code,{children:"kid"}),", \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 claims, \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c authorization \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. Access token \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0436\u0438\u0432\u0443\u0449\u0438\u0439, refresh/revoke \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f. \u041d\u0435\u043b\u044c\u0437\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0432 frontend, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c ",(0,d.jsx)(n.code,{children:"alg: none"}),", \u0434\u043e\u0432\u0435\u0440\u044f\u0442\u044c ",(0,d.jsx)(n.code,{children:"role"})," \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 issuer/audience \u0438\u043b\u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u044b."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-13",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"const payload = await verifyJwt(token, {\n  issuer: 'https://auth.example',\n  audience: 'api',\n  algorithms: ['RS256'],\n});\n\nif (!payload.sub) throw new AuthError('INVALID_SUBJECT');\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-13",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsxs)(n.p,{children:["JWT \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 header, payload \u0438 signature. Header \u0438 payload \u043b\u0435\u0433\u043a\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043b\u044e\u0431\u044b\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432. \u0411\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 payload \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0432\u0435\u0440\u0438\u044f. ",(0,d.jsx)(n.code,{children:"exp"})," \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u0441\u0440\u043e\u043a \u0436\u0438\u0437\u043d\u0438, ",(0,d.jsx)(n.code,{children:"iss"})," \u0438 ",(0,d.jsx)(n.code,{children:"aud"}),' \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0442 \u043e\u0442 \u0442\u043e\u043a\u0435\u043d\u0430 "\u043d\u0435 \u043e\u0442 \u0442\u043e\u0433\u043e issuer" \u0438\u043b\u0438 "\u043d\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e API".']}),"\n",(0,d.jsx)(n.p,{children:'Authentication \u0438 authorization - \u0440\u0430\u0437\u043d\u044b\u0435 \u0448\u0430\u0433\u0438. JWT \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438 \u043a\u0430\u043a\u0438\u0435 claims \u0432\u044b\u0434\u0430\u043b issuer, \u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 "\u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441" \u0434\u043e\u043b\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c policy, ownership, scopes/roles \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430.'}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-13",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430"}),(0,d.jsx)(n.th,{children:"\u0417\u0430\u0447\u0435\u043c"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"alg"})," allowlist"]}),(0,d.jsx)(n.td,{children:"\u043d\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0441\u043b\u0430\u0431\u044b\u0439/\u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Signature"}),(0,d.jsx)(n.td,{children:"\u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e claims \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u043b\u0430\u043d\u044b"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"exp"}),"/",(0,d.jsx)(n.code,{children:"nbf"})]}),(0,d.jsx)(n.td,{children:"\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"iss"})}),(0,d.jsx)(n.td,{children:"\u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0433\u043e issuer"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"aud"})}),(0,d.jsx)(n.td,{children:"\u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0442\u043e\u043a\u0435\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u044d\u0442\u043e\u043c\u0443 API"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"kid"})," + JWKS cache"]}
1),(0,d.jsx)(n.td,{children:"\u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c rotation"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"scopes/roles/policy"}),(0,d.jsx)(n.td,{children:"\u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c authn \u043e\u0442 authz"})]})]})]}),"\n",(0,d.jsxs)(n.p,{children:["\u041a\u0435\u0439\u0441: \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0442\u043e\u043b\u044c\u043a\u043e decode payload \u0438 \u0440\u043e\u043b\u044c ",(0,d.jsx)(n.code,{children:"admin"}),". \u0410\u0442\u0430\u043a\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u043d\u044f\u0435\u0442 payload \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f. \u0421\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442: always verify signature, issuer/audience, algorithm allowlist, \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 TTL, refresh token rotation, revoke strategy \u0434\u043b\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-13",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 JWT verification checklist: token source, alg, key, signature, exp, iss, aud, subject, scopes."}),"\n",(0,d.jsxs)(n.li,{children:["\u041e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 ",(0,d.jsx)(n.code,{children:"jwt.decode"})," \u043d\u0435 \u0440\u0430\u0432\u0435\u043d ",(0,d.jsx)(n.code,{children:"jwt.verify"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["\u0421\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 key rotation: ",(0,d.jsx)(n.code,{children:"kid"}),", JWKS cache TTL, old/new keys overlap, forced revoke."]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-13",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0414\u043e\u0432\u0435\u0440\u044f\u044e\u0442 decoded payload \u0431\u0435\u0437 signature verification."}),"\n",(0,d.jsxs)(n.li,{children:["\u041d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 ",(0,d.jsx)(n.code,{children:"aud"}),"/",(0,d.jsx)(n.code,{children:"iss"})," \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0447\u0443\u0436\u043e\u0439 \u0442\u043e\u043a\u0435\u043d."]}),"\n",(0,d.jsx)(n.li,{children:"\u0425\u0440\u0430\u043d\u044f\u0442 \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0438\u043b\u0438 PII \u0432\u043d\u0443\u0442\u0440\u0438 JWT payload."}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u0443\u0442\u0430\u044e\u0442 role claim \u0441 \u043f\u043e\u043b\u043d\u043e\u0439 authorization policy."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-13",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0427\u0435\u043c access token \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 refresh token?"}),"\n",(0,d.jsxs)(n.li,{children:["\u041a\u0430\u043a \u043e\u0442\u043e\u0437\u0432\u0430\u0442\u044c JWT \u0434\u043e ",(0,d.jsx)(n.code,{children:"exp"}),"?"]}),"\n",(0,d.jsxs)(n.li,{children:["\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 ",(0,d.jsx)(n.code,{children:"kid"})," \u0438 \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d JWKS cache?"]}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u043e\u0447\u0435\u043c\u0443 JWT payload \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-13",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"JWT structure: header, payload, signature."}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"iss"}),", ",(0,d.jsx)(n.code,{children:"aud"}),", ",(0,d.jsx)(n.code,{children:"exp"}),", ",(0,d.jsx)(n.code,{children:"nbf"}),", ",(0,d.jsx)(n.code,{children:"sub"}),", ",(0,d.jsx)(n.code,{children:"kid"}),"."]}),"\n",(0,d.jsx)(n.li,{children:"Access/refresh tokens, revoke, rotation, authn vs authz."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-13",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-15",children:"15. \u041a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 N
1ode-\u0441\u0435\u0440\u0432\u0438\u0441\u0430?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),", ",(0,d.jsx)(n.code,{children:"cache"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-14",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"\u041a\u044d\u0448 \u0432 Node-\u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 read-heavy path, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u044f\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438: cache-aside/read-through, TTL, invalidation, key design, serialization, stampede protection \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 hit/miss/stale/error."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-14",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}),"\n",(0,d.jsx)(n.p,{children:'\u042f \u043d\u0435 \u0441\u0442\u0430\u0432\u043b\u044e \u043a\u044d\u0448 "\u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439": \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u044e hot read path, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0443\u044e stale-ness \u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0438\u0441\u0442\u0438\u043d\u044b. \u041f\u043e\u0442\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e \u043a\u043b\u044e\u0447, TTL, invalidation event, \u0437\u0430\u0449\u0438\u0442\u0443 \u043e\u0442 stampede \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u043a\u044d\u0448\u0430. \u0414\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u043e\u0436\u043d\u043e in-memory LRU, \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 instances \u043d\u0443\u0436\u0435\u043d \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043a\u044d\u0448 \u0432\u0440\u043e\u0434\u0435 Redis; \u0438\u043d\u0430\u0447\u0435 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u043e\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.'}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-14",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"async function getUserProfile(userId) {\n  const key = `user-profile:${userId}`;\n  const cached = await cache.get(key);\n  if (cached) return JSON.parse(cached);\n\n  const profile = await db.userProfile.findById(userId);\n  await cache.set(key, JSON.stringify(profile), { ttl: 60 });\n  return profile;\n}\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-14",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsx)(n.p,{children:"\u041a\u044d\u0448 - \u044d\u0442\u043e \u043a\u043e\u043f\u0438\u044f, \u0430 \u043d\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0438\u0441\u0442\u0438\u043d\u044b. \u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e: \u043a\u0430\u043a\u0443\u044e \u043d\u0435\u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u0442\u0435\u0440\u043f\u0435\u0442\u044c? \u0414\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 TTL 5 \u043c\u0438\u043d\u0443\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u043e\u0440\u043c\u0430\u043b\u0435\u043d; \u0434\u043b\u044f \u0431\u0430\u043b\u0430\u043d\u0441\u0430 \u0441\u0447\u0435\u0442\u0430 stale data \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0432\u0435\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 data semantics."}),"\n",(0,d.jsx)(n.p,{children:'Stampede \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0438\u0441\u0442\u0435\u043a \u0438 \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438\u0434\u0435\u0442 \u0432 \u0431\u0430\u0437\u0443. \u0417\u0430\u0449\u0438\u0442\u0430: singleflight/lock, stale-while-revalidate, jitter \u
1043a TTL, prewarm, request coalescing. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432\u0430\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c negative caching: \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c "not found" \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u0441 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u043c TTL \u0438 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e.'}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-14",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0420\u0435\u0448\u0435\u043d\u0438\u0435"}),(0,d.jsx)(n.th,{children:"\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442"}),(0,d.jsx)(n.th,{children:"\u0420\u0438\u0441\u043a"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"In-memory LRU"}),(0,d.jsx)(n.td,{children:"\u043e\u0434\u0438\u043d process, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0438"}),(0,d.jsx)(n.td,{children:"\u0440\u0430\u0437\u043d\u044b\u0435 instances \u0432\u0438\u0434\u044f\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Redis/cache-aside"}),(0,d.jsx)(n.td,{children:"read-heavy \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0436\u0434\u0443 instances"}),(0,d.jsx)(n.td,{children:"stale data, network latency"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"TTL only"}),(0,d.jsx)(n.td,{children:"\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0430\u0442\u044c"}),(0,d.jsx)(n.td,{children:"stale window"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Explicit invalidation"}),(0,d.jsx)(n.td,{children:"\u0432\u0430\u0436\u043d\u0430 \u0441\u0432\u0435\u0436\u0435\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435 write"}),(0,d.jsx)(n.td,{children:"\u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438 race conditions"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Stale-while-revalidate"}),(0,d.jsx)(n.td,{children:"\u043b\u0443\u0447\u0448\u0435 latency \u043f\u0440\u0438 \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u0438"}),(0,d.jsx)(n.td,{children:"\u043d\u0430\u0434\u043e \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c stale"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Singleflight/lock"}),(0,d.jsx)(n.td,{children:"\u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 stampede"}),(0,d.jsx)(n.td,{children:"\u0440\u0438\u0441\u043a deadlock/lock timeout"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:"\u041a\u0435\u0439\u0441: \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430 \u0442\u043e\u0432\u0430\u0440\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430, TTL \u0438\u0441\u0442\u0435\u043a\u0430\u0435\u0442, 1000 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0431\u044c\u044e\u0442 \u0432 \u0431\u0430\u0437\u0443. \u0421\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442: TTL jitter, singleflight \u043d\u0430 \u043a\u043b\u044e\u0447, stale-while-revalidate, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 concurrency \u043a DB, \u043c\u0435\u0442\u0440\u0438\u043a\u0438 hit rate \u0438 backend fallback latency."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-14",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 cache invalidation/stampede matrix: key, TTL, invalidation trigger, stale tolerance, stampede guard."}),"\n",(0,d.jsx)(n.li,{children:"\u0420\u0430\u0437\u0431\u0435\u0440\u0438\u0442\u0435 3 \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445: \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a\u0430\u0442\u0430\u043b\u043e\u0433, permissions."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438: hit rate, miss rate, stale served, set/get errors, eviction, lock wait."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-14",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0438\u0441\u0442\u0438\u043d\u044b \u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0443\u044e stale-ness."}),"\n",(0,d.jsx)(n.li,{children:"\u0414\u0435\u043b\u0430\u044e\u0442 key \u0431\u0435\u0437 version/tenant/user scope \u0438 \u0441\u043c\u0435\u0448\u0438\u0432\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0442\u0441\u044f \u043e\u0442 cache stampede."}),"\n",(0,d.jsx)(n.li,{children:"\u0421\u0447\u0438\u0442\u0430\u044e\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043a\u044d\u0448 always available \u0438 \u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u044e\u0442 fallback."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-14",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0427\u0435\u043c cache-aside \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 read-through?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u043e\u0433\u0434\u0430 in-memory cache \u043e\u043f\u0430\u0441\u0435\u043d \u0432 multi-instance \u0441\u0435\u0440\u0432\u0438\u0441\u0435?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u044d\u0448 \u043f\u043e\u0441\u043b\u0435 write?"}),"\n",(0,d.jsx)(n.li,{children:"\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438 Redis: fail open \u0438\u043b\u0438 fail closed?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-14",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"Cache-aside, TTL, invalidation."}),"\n",(0,d.jsx)(n.li,{children:"Stampede protection: lock, singleflight, stale-while-revalidate, jitter."}),"\n",(0,d.jsx)(n.li,{children:"Cache key design, serialization, multi-instance consistency."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-14",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-16",children:"16. \u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c WebSocket \u0438 \u043a\u0430\u043a\u0438\u0435 \u0443 \u043d\u0435\u0433\u043e \u0440\u0438\u0441\u043a\u0438?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-15",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"WebSocket \u0434\u0430\u0435\u0442 \u0434\u043e\u043b\u0433\u043e\u0436\u0438\u0432\u0443\u0449\u0438\u0439 \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u043d\u0430\u043b \u043f\u043e\u0432\u0435\u0440\u0445 HTTP upgrade. \u0415\u0433\u043e \u0440\u0438\u0441\u043a\u0438: \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, heartbeat, reconnect, fan-out, \u043b\u0438\u043c\u0438\u0442\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, backpressure, order/idempotency \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u0438 \u0434\u0435\u043f\u043b\u043e\u0435."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-15",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}
1),"\n",(0,d.jsxs)(n.p,{children:['\u042f \u0431\u044b \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e WebSocket \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f server push \u0438 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u0433\u0434\u0435 polling \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u0438\u043b\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e "\u0431\u044b\u0441\u0442\u0440\u044b\u0439 REST": \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0436\u0438\u0432\u0435\u0442 \u0434\u043e\u043b\u0433\u043e, \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c heartbeat-\u043e\u043c, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e/IP, \u0443\u043c\u0435\u0442\u044c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 reconnect \u0438 \u043d\u0435 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c. \u0412 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u043e\u043c ',(0,d.jsx)(n.code,{children:"WebSocket"})," API \u043d\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e backpressure, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0430\u043c \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 buffered messages \u0438 slow clients."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-15",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"socket.on('message', async (raw) => {\n  const msg = parseAndValidate(raw);\n  if (!canPublish(socket.user, msg.channel)) {\n    return socket.close(1008, 'policy violation');\n  }\n  await publish(msg);\n});\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-15",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsx)(n.p,{children:"\u0421\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 lifecycle. Handshake \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 HTTP upgrade, \u0434\u0430\u043b\u044c\u0448\u0435 \u043a\u0430\u043d\u0430\u043b \u0436\u0438\u0432\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e request/response. \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 handshake \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 authorization \u043a\u0430\u0436\u0434\u043e\u0433\u043e action: \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d, \u043d\u043e \u043d\u0435 \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 room/channel."}),"\n",(0,d.jsx)(n.p,{children:"\u0415\u0449\u0435 \u0432\u0430\u0436\u043d\u0435\u0435 reliability. \u041a\u043b\u0438\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0441\u0432\u044f\u0437\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0434\u0432\u0430\u0436\u0434\u044b, \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443 instance. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u044b message id, ack/resume strategy, idempotent handlers \u0438 external pub/sub, \u0435\u0441\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 Node-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438."}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-15",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0420\u0438\u0441\u043a"}),(0,d.jsx)(n.th,{children:"\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c"}),(0,d.jsx)(n.th,{children:"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u041c\u0435\u0440\u0442\u0432\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f"}),(0,d.jsx)(n.td,{children:"ping/pong heartbeat"}),(0,d.jsx)(n.td,{children:"stale sockets \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Slow client"}),(0,d.jsx)(n.td,{children:"\u043b\u0438\u043c\u0438\u0442 buffered messages"}),(0,d.jsx)(n.td,{children:"\u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0435 \u0440\u0430\u0441\u0442\u0435\u0442 \u0431\u0435\u0437 \u043b\u0438\u043c\u0438\u0442\u0430"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Fan-out overload"}),(0,d.jsx)(n.td,{children:"rate limit, batching, pub/sub"}),(0,d.jsx)(n.td,{children:"broadcast \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 Event Loop"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u041f\u043e\u0442\u0435\u0440\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439"}),(0,d.jsx)(n.td,{children:"message id, ack, resume"}),(0,d.jsx)(n.td,{children:"reconnect \u043d\u0435 \u043b\u043e\u043c\u0430\u0435\u0442 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Multi-instance"}
1),(0,d.jsx)(n.td,{children:"sticky session \u0438\u043b\u0438 shared pub/sub"}),(0,d.jsx)(n.td,{children:"room state \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Deploy/shutdown"}),(0,d.jsx)(n.td,{children:"drain, close code, reconnect hint"}),(0,d.jsx)(n.td,{children:"\u043a\u043b\u0438\u0435\u043d\u0442\u044b \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:"\u041a\u0435\u0439\u0441: \u0447\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c instance, \u043f\u043e\u0442\u043e\u043c \u0435\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0434\u043e \u0442\u0440\u0435\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0438 \u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442: \u0432\u044b\u043d\u0435\u0441\u0442\u0438 room membership/pub-sub state \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0441\u043b\u043e\u0439, \u0440\u0435\u0448\u0438\u0442\u044c sticky sessions, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c message id/ack \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 active connections/fan-out lag."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-15",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 WebSocket reliability checklist: auth, heartbeat, limits, backpressure, reconnect, ordering, shutdown."}),"\n",(0,d.jsx)(n.li,{children:"\u041e\u043f\u0438\u0448\u0438\u0442\u0435 reconnect flow: last seen message id, resume, missed messages, duplicate handling."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438: active connections, messages/sec, buffered messages, reconnect rate, close codes."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-15",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0425\u0440\u0430\u043d\u044f\u0442 \u0432\u0435\u0441\u044c state rooms \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043c\u0435\u0440\u0442\u0432\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0443\u0442\u0435\u0447\u043a\u0443 sockets."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442 slow clients \u0438 buffered messages."}),"\n",(0,d.jsx)(n.li,{children:"\u0421\u0447\u0438\u0442\u0430\u044e\u0442 WebSocket \u0437\u0430\u043c\u0435\u043d\u043e\u0439 \u0432\u0441\u0435\u043c REST endpoints."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-15",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0440\u0430\u0442\u044c SSE \u0432\u043c\u0435\u0441\u0442\u043e WebSocket?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c rooms \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 Node instances?"}),"\n",(0,d.jsx)(n.li,{children:"\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f reconnect?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a graceful shutdown \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 WebSocket connections?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-15",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"WebSocket handshake, close codes, ping/pong."}),"\n",(0,d.jsx)(n.li,{children:"Backpressure/slow clients \u0438 message buffering."}
1),"\n",(0,d.jsx)(n.li,{children:"Pub/sub, sticky sessions, reconnect/resume."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-15",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-17",children:"17. \u041a\u0430\u043a \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 Node \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-16",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"\u0423\u0442\u0435\u0447\u043a\u0443 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 Node \u0438\u0449\u0443\u0442 \u043f\u043e \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u043c\u0443 \u0440\u043e\u0441\u0442\u0443 heap/RSS \u043f\u043e\u0441\u043b\u0435 GC, \u0430 \u043d\u0435 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u0443. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b: \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, heap snapshots, allocation profiling, GC traces, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 snapshot-\u043e\u0432 \u0438 \u043f\u043e\u0438\u0441\u043a retaining paths."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-16",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}),"\n",(0,d.jsx)(n.p,{children:"\u042f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u044e leak \u043e\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u043e\u0441\u0442\u0430 \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439: \u0441\u043c\u043e\u0442\u0440\u044e heap used \u043f\u043e\u0441\u043b\u0435 GC, RSS, old space, event loop lag \u0438 restart/OOM history. \u041f\u043e\u0442\u043e\u043c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0436\u0443 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439, \u0431\u0435\u0440\u0443 baseline heap snapshot, \u0433\u043e\u043d\u044f\u044e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 flow, \u0431\u0435\u0440\u0443 \u0432\u0442\u043e\u0440\u043e\u0439 snapshot \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e retained objects. Heap snapshot \u0432 production \u043e\u043f\u0430\u0441\u0435\u043d: \u043e\u043d \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 main thread \u0438 \u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0437\u043a\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u043d\u0430 disposable instance \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 runbook."}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-16",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"const sessions = new Map();\n\napp.post('/login', (req, res) => {\n  sessions.set(req.user.id, { user: req.user, createdAt: Date.now() });\n  res.sendStatus(204);\n});\n"})}),"\n",(0,d.jsxs)(n.p,{children:["\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 leak: ",(0,d.jsx)(n.code,{children:"Map"})," \u0440\u0430\u0441\u0442\u0435\u0442 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 TTL, logout cleanup \u0438\u043b\u0438 \u043b\u0438\u043c\u0438\u0442\u0430."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-16",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsx)(n.p,{children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b: \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 caches \u0431\u0435\u0437 TTL, listeners \u0431\u0435\u0437 remove, timers, \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0431\u0435\u0437 max size, WebSocket/session maps, \u043d\u0435\u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u043d\u044b\u0435 native resources. \u041d\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u043e\u0441\u0442 \u043f\u0430\u043c\u044f\u0442\u0438 - leak: V8 \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044c heap \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0439, \u0430 RSS \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u0442\u0438 \u0438\u0437-\u0437\u0430 native buffers."}),"\n",(0,d.jsx)(n.p,{children:'\u0421\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438: \u043c\u0435\u0442\u0440\u0438\u043a\u0438 -> \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 -> \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 -> snapshot diff -> retaining path -> fix -> regression guard. \u0415\u0441\u043b\u0438 \u0441\u0440\u0430\u0437\u0443 "\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u043c\u044f\u0442\u0438", \u044d\u0442\u043e \u043d\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0430.'}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-16",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0421\u0438\u0433\u043d\u0430\u043b"}),(0,d.jsx)(n.th,{children:"\u0427\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442"}),(0,d.jsx)(n.th,{children:"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Heap \u043f\u043e\u0441\u043b\u0435 GC \u0440\u0430\u0441\u0442\u0435\u0442"}),(0,d.jsx)(n.td,{children:"\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0439 JS object leak"}),(0,d.jsx)(n.td,{children:"heap snapshot diff"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"RSS \u0440\u0430\u0441\u0442\u0435\u0442, heap \u043d\u0435\u0442"}),(0,d.jsx)(n.td,{children:"Buffer/native/addon/file handles"}),(0,d.jsx)(n.td,{children:"\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c external memory"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"GC pause \u0440\u0430\u0441\u0442\u0435\u0442"}),(0,d.jsx)(n.td,{children:"pressure \u0432 old space"}),(0,d.jsx)(n.td,{children:"allocation profiling"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Listener warning"}),(0,d.jsx)(n.td,{children:"possible EventEmitter leak"}),(0,d.jsx)(n.td,{children:"\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438/cleanup"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Queue length \u0440\u0430\u0441\u0442\u0435\u0442"}),(0,d.jsx)(n.td,{children:"backlog \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b"}),(0,d.jsx)(n.td,{children:"\u043b\u0438\u043c\u0438\u0442/\u0434\u0440\u0435\u043d\u0430\u0436/TTL"})]})]})]}),"\n",(0,d.jsxs)(n.p,{children:["\u041a\u0435\u0439\u0441: \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e WebSocket reconnect \u043f\u0430\u043c\u044f\u0442\u044c \u0440\u0430\u0441\u0442\u0435\u0442. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442: \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0438 socket listeners \u0438 entries \u0432 connection map \u043f\u0440\u0438 ",(0,d.jsx)(n.code,{children:"close"}),", \u0432\u0437\u044f\u0442\u044c snapshot \u0434\u043e/\u043f\u043e\u0441\u043b\u0435 reconnect storm, \u043d\u0430\u0439\u0442\u0438 retaining path \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c cleanup test."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-16",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 memory leak investigation plan: \u043c\u0435\u0442\u0440\u0438\u043a\u0438, repro, snapshot 1, load, snapshot 2, comparison, retaining path, fix."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 5 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432-\u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u043e\u0432: Map/cache, listeners, timers, queue, Buffer."}),"\n",(0,d.jsx)(n.li,{children:"\u041e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 heap snapshot \u0432 production \u043c\u043e\u0436\u0435\u0442 \u0443\u0440\u043e\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-16",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043c\u043e\u0442\u0440\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e RSS \u0438 \u0441\u0440\u0430\u0437\u0443 \u0434\u0435\u043b\u0430\u044e\u0442 \u0432\u044b\u0432\u043e\u0434 \u043f\u0440\u043e JS leak."}),"\n",(0,d.jsx)(n.li,{children:"\u0411\u0435\u0440\u0443\u0442 \u043e\u0434\u0438\u043d snapshot \u0431\u0435\u0437 baseline \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f."}),"\n",(0,d.jsx)(n.li,{children:"\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 endpoint \u0434\u043b\u044f heap snapshot."}
1),"\n",(0,d.jsx)(n.li,{children:"\u041b\u0435\u0447\u0430\u0442 leak \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0431\u0435\u0437 \u043f\u043e\u0438\u0441\u043a\u0430 retaining path."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-16",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0427\u0435\u043c heap used \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 RSS?"}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u043e\u0447\u0435\u043c\u0443 snapshot \u043c\u043e\u0436\u0435\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c main thread?"}),"\n",(0,d.jsxs)(n.li,{children:["\u041a\u0430\u043a\u043e\u0439 leak \u0434\u0430\u0441\u0442 ",(0,d.jsx)(n.code,{children:"EventEmitter memory leak warning"}),"?"]}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e fix \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0431\u0440\u0430\u043b leak?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-16",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"Node heap snapshots \u0438 allocation profiler."}),"\n",(0,d.jsx)(n.li,{children:"V8 heap, RSS, external memory, GC."}),"\n",(0,d.jsx)(n.li,{children:"Retaining path, cleanup, TTL, listener lifecycle."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-16",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-18",children:"18. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c ORM, \u0430 \u043a\u043e\u0433\u0434\u0430 query builder?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-17",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"ORM \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432\u043e\u0433\u043e CRUD, relation mapping, migrations \u0438 type-safety. Query builder \u0438\u043b\u0438 raw SQL \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u0436\u043d\u044b \u0442\u043e\u0447\u043d\u044b\u0439 SQL, \u0441\u043b\u043e\u0436\u043d\u044b\u0435 joins/window functions, performance tuning, vendor-specific features \u0438\u043b\u0438 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c query plan."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-17",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}
1),"\n",(0,d.jsx)(n.p,{children:"\u042f \u043d\u0435 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e ORM \u0438 SQL \u0440\u0435\u043b\u0438\u0433\u0438\u043e\u0437\u043d\u043e. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 ORM \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 boilerplate. \u041d\u043e \u0434\u043b\u044f \u043e\u0442\u0447\u0435\u0442\u043e\u0432, \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438, bulk operations \u0438 performance-critical queries \u044f \u0445\u043e\u0447\u0443 \u0432\u0438\u0434\u0435\u0442\u044c SQL, explain plan, \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0435\u0439. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 - ORM \u043a\u0430\u043a default, query builder/raw SQL \u043a\u0430\u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 observability."}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-17",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"// ORM-style: \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e CRUD.\nconst user = await db.user.findUnique({ where: { id } });\n\n// Query-builder/raw-style: \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u0436\u0435\u043d \u0442\u043e\u0447\u043d\u044b\u0439 SQL shape.\nconst rows = await db.raw(sql`\n  SELECT account_id, sum(amount) AS total\n  FROM payments\n  WHERE created_at >= ${from}\n  GROUP BY account_id\n`);\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-17",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsx)(n.p,{children:"\u0418\u043d\u0442\u0435\u0440\u0432\u044c\u044e\u0435\u0440 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b \u0441\u043a\u0440\u044b\u0442\u0443\u044e \u0446\u0435\u043d\u0443 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438. ORM \u043c\u043e\u0436\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, over-fetching, \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 join \u0438\u043b\u0438 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u0443\u044e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443. Query builder \u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c, \u043d\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430: SQL injection safety, \u0442\u0438\u043f\u044b, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0442\u0435\u0441\u0442\u044b."}),"\n",(0,d.jsx)(n.p,{children:"\u0421\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 measurement: query count, duration, rows scanned, query plan, indexes, connection pool. \u0411\u0435\u0437 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u043a\u0443\u0441\u043e\u0432\u0449\u0438\u043d\u0443."}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-17",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439"}),(0,d.jsx)(n.th,{children:"ORM"}),(0,d.jsx)(n.th,{children:"Query builder/raw SQL"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"CRUD \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c"}),(0,d.jsx)(n.td,{children:"\u0441\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430"}),(0,d.jsx)(n.td,{children:"\u0431\u043e\u043b\u044c\u0448\u0435 boilerplate"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Type-safety"}),(0,d.jsx)(n.td,{children:"\u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430"}),(0,d.jsx)(n.td,{children:"\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 tooling"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0421\u043b\u043e\u0436\u043d\u044b\u0435 joins/reporting"}),(0,d.jsx)(n.td,{children:"\u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c SQL"}),(0,d.jsx)(n.td,{children:"\u0441\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Performance tuning"}),(0,d.jsx)(n.td,{children:"\u043d\u0443\u0436\u0435\u043d visibility"}),(0,d.jsx)(n.td,{children:"\u0442\u043e\u0447\u043d\u044b\u0439 control"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Vendor-specific feature"}),(0,d.jsx)(n.td,{children:"\u0447\u0430\u0441\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e"}),(0,d.jsx)(n.td,{children:"\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u041a\u043e\u043c\u0430\u043d\u0434\u0430"}),(0,d.jsx)(n.td,{children:"\u043f\u0440\u043e\u0449\u0435 \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433"}),(0,d.jsx)(n.td,{children:"\u043d\u0443\u0436\u0435\u043d SQL skill"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:"\u041a\u0435\u0439\u0441: endpoint \u043e\u0442\u0447\u0435\u0442\u0430 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 ORM include \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0441\u0442\u0440\u043e\u043a. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442: \u0441\u043d\u044f\u0442\u044c query plan, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043e\u0442\u0447\u0435\u0442 \u043d\u0430 query builder/raw SQL, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0438 regression test \u043f\u043e query count/latency, \u043d\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u0432\u0435\u0441\u044c data layer."}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-17",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 ORM/query-builder decision matrix \u0434\u043b\u044f \u0442\u0440\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432: CRUD profile, report aggregation, bulk update."}),"\n",(0,d.jsx)(n.li,{children:"\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u043a\u0430\u0436\u0438\u0442\u0435: query count, expected rows, index, transaction boundary, test."}),"\n",(0,d.jsx)(n.li,{children:"\u041e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u0435, \u043a\u0430\u043a \u0437\u0430\u0449\u0438\u0449\u0430\u0442\u044c\u0441\u044f \u043e\u0442 SQL injection \u043f\u0440\u0438 raw SQL."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-17",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u0447\u0438\u0442\u0430\u044e\u0442 ORM \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0435\u0439 \u0438 \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f\u0442 SQL."}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u044f\u0442 \u043d\u0430 raw SQL \u0431\u0435\u0437 parameterization."}),"\n",(0,d.jsx)(n.li,{children:"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0434\u0438\u043d giant repository method \u0434\u043b\u044f \u0432\u0441\u0435\u0445 query shapes."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e\u0442 transaction boundary \u0438 query count."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-17",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u0443\u0432\u0438\u0434\u0435\u0442\u044c SQL, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 ORM?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u043e\u0433\u0434\u0430 raw SQL \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d \u0432 production-\u043a\u043e\u0434\u0435?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c type-safety \u0432 query builder?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a connection pool \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0432\u044b\u0431\u043e\u0440 data-access \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-17",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"Query plan, indexes, rows scanned."}),"\n",(0,d.jsx)(n.li,{children:"ORM relation loading, transactions, connection pool."}),"\n",(0,d.jsx)(n.li,{children:"Parameterized queries \u0438 SQL injection prevention."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-17",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-19",children:"19. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 N+1 \u043d\u0430 backend \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-18",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"N+1 - \u044d\u0442\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d, \u0433\u0434\u0435 \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a, \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441. \u041b\u
10435\u0447\u0430\u0442 \u0435\u0433\u043e batching, joins/eager loading, DataLoader-style aggregation, relation loading strategy \u0438 \u0442\u0435\u0441\u0442\u043e\u043c \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-18",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}),"\n",(0,d.jsxs)(n.p,{children:["\u042f \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435: \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438 100 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0434\u043d\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u043f\u043e\u0442\u043e\u043c \u0432 \u0446\u0438\u043a\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b\u0438 posts \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f - \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 101 \u0437\u0430\u043f\u0440\u043e\u0441. \u041d\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u044d\u0442\u043e \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e, \u0430 \u043d\u0430 production-list \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 latency \u0438 overload \u0431\u0430\u0437\u044b. \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430: join/eager loading \u0434\u043b\u044f REST list, DataLoader \u0434\u043b\u044f GraphQL resolvers, bulk ",(0,d.jsx)(n.code,{children:"WHERE id IN (...)"})," \u0434\u043b\u044f service layer."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-18",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:"const users = await db.user.findMany();\n\n// N+1: \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 users \u0438 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u043d\u0430 posts \u043a\u0430\u0436\u0434\u043e\u0433\u043e user.\nfor (const user of users) {\n  user.posts = await db.post.findMany({ where: { authorId: user.id } });\n}\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-18",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsx)(n.p,{children:"N+1 \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435, \u0430 \u0432 serializer, resolver, template \u0438\u043b\u0438 computed field. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c query count \u043d\u0430 \u043e\u0434\u0438\u043d API call. \u0415\u0441\u043b\u0438 endpoint \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 20 items, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e SQL queries \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0441\u0442\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u043e\u0442 \u0447\u0438\u0441\u043b\u0430 items \u0431\u0435\u0437 \u043f\u0440\u0438\u0447\u0438\u043d\u044b."}),"\n",(0,d.jsx)(n.p,{children:'\u0421\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 "\u0432\u0441\u0435\u0433\u0434\u0430 join". Join \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0437\u0434\u0443\u0442\u044c result set, eager loading \u043c\u043e\u0436\u0435\u0442 over-fetch-\u0438\u0442\u044c, batching \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c cache/invalidation. \u041d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u0434 \u0444\u043e\u0440\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u043b\u0430\u043d \u0437\u0430\u043f\u0440\u043e\u0441\u0430.'}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-18",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439"}),(0,d.jsx)(n.th,{children:"\u0421\u0438\u043c\u043f\u0442\u043e\u043c"}),(0,d.jsx)(n.th,{children:"\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"REST list + nested relation"}),(0,d.jsx)(n.td,{children:"query count \u0440\u0430\u0441\u0442\u0435\u0442 \u0441 page size"}),(0,d.jsx)(n.td,{children:"eager loading/join"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"GraphQL nested resolvers"}),(0,d.jsx)(n.td,{children:"resolver \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 DB \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 parent"}),(0,d.jsx)(n.td,{children:"DataLoader/batching"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Service loop"}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"await"})," \u0432\u043d\u0443\u0442\u0440\u0438 loop"]}),(0,d.jsxs)(n.td,{children:["bulk query ",(0,d.jsx)(n.code,{children:"WHERE id IN (...)"})]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"ORM include over-fetch"}),(0,d.jsx)(n.td,{children:"\u043c\u0430\u043b\u043e queries, \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u043e\u043a"}),(0,d.jsx)(n.td,{children:"selective fields/projection"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"Large join duplicates"}),(0,d.jsx)(n.td,{children:"huge result set"}),(0,d.jsx)(n.td,{children:"split query + batching"})]})]})]}),"\n",(0,d.jsxs)(n.p,{children:["\u041a\u0435\u0439\u0441: ",(0,d.jsx)(n.code,{children:"/u
1sers?include=posts"})," \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 10 users \u0438 \u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 500. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442: \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c SQL logging/query count, \u0443\u0432\u0438\u0434\u0435\u0442\u044c ",(0,d.jsx)(n.code,{children:"1 + N"}),", \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 batched posts query \u043f\u043e ",(0,d.jsx)(n.code,{children:"authorId IN (...)"}),', \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c regression test "\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 2 SQL queries \u0434\u043b\u044f page".']}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-18",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u041f\u0440\u043e\u0432\u0435\u0434\u0438\u0442\u0435 N+1 query audit: endpoint, list size, query count, rows scanned, p95 latency."}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 bulk query \u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u043e foreign key."}),"\n",(0,d.jsx)(n.li,{children:"\u0421\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u0443\u0439\u0442\u0435 readiness: \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c query count \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-18",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f query count."}),"\n",(0,d.jsx)(n.li,{children:"\u0417\u0430\u043c\u0435\u043d\u044f\u044e\u0442 N+1 \u043d\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 join, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u043e\u043a."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u0441\u0442\u0430\u0432\u044f\u0442 test/guardrail \u043d\u0430 query count."}),"\n",(0,d.jsx)(n.li,{children:"\u041f\u0443\u0442\u0430\u044e\u0442 latency \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e API \u0441 N+1 \u0432 \u0431\u0430\u0437\u0435."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-18",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u041f\u043e\u0447\u0435\u043c\u0443 GraphQL \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u043e\u0446\u0438\u0440\u0443\u0435\u0442 N+1?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u043e\u0433\u0434\u0430 batching \u043b\u0443\u0447\u0448\u0435 join?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c N+1 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0442\u0435\u0441\u0442\u0435?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0431\u0430\u0437\u044b \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c N+1?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-18",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"Eager loading, joins, batching, DataLoader."}),"\n",(0,d.jsx)(n.li,{children:"SQL logging, query count, query plan."}),"\n",(0,d.jsx)(n.li,{children:"Projection/selective fields \u0438 pagination."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-18",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"q-20",children:"20. \u041a\u0430\u043a \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c backward compatibility API?"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u0422\u0435\u0433\u0438:"})," ",(0,d.jsx)(n.code,{children:"nodejs"}),", ",(0,d.jsx)(n.code,{children:"backend"}),"\n",(0,d.jsx)(n.strong,{children:"\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c:"})," ",(0,d.jsx)(n.code,{children:"Middle/Senior"})]}),"\n",(0,d.jsx)(n.h3,{id:"\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439-\u043e\u0442\u0432\u0435\u0442-19",children:"\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442"}),"\n",(0,d.jsx)(n.p,{children:"Backward compatibility \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u043e\u0432\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0414\u043b\u044f API \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f additive changes, \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c\u0438 response/error shapes, deprecation window, versioning \u043f\u0440\u0438 breaking changes \u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438."}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u0441\u043a\u0430\u0437\u0430\u0442\u044c-\u043d\u0430-\u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e-30-60-\u0441\u0435\u043a\u0443\u043d\u0434-19",children:"\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e (30-60 \u0441\u0435\u043a\u0443\u043d\u0434)"}
1),"\n",(0,d.jsx)(n.p,{children:"\u042f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e API \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442. \u041e\u0431\u044b\u0447\u043d\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 optional response fields, \u043d\u043e\u0432\u044b\u0439 endpoint, \u043d\u043e\u0432\u044b\u0439 enum \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0443\u043c\u0435\u044e\u0442 unknown values. \u041e\u043f\u0430\u0441\u043d\u044b \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435/\u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044f, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 default behavior, \u0443\u0436\u0435\u0441\u0442\u043e\u0447\u0435\u043d\u0438\u0435 validation \u0438 \u0441\u043c\u0435\u043d\u0430 error shape. \u041f\u0435\u0440\u0435\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043d\u0443\u0436\u0435\u043d consumer impact analysis, \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b, observability \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 deprecation plan."}),"\n",(0,d.jsx)(n.h3,{id:"\u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440-19",children:"\u041c\u0438\u043d\u0438-\u043f\u0440\u0438\u043c\u0435\u0440"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-js",children:'// Compatible: \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 optional field, \u0441\u0442\u0430\u0440\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0435\u0433\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c.\n{\n  "id": "u1",\n  "name": "Ada",\n  "avatarUrl": "https://cdn.example/u1.png"\n}\n'})}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435-19",children:"\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435"}),"\n",(0,d.jsx)(n.p,{children:"Compatibility \u0431\u044b\u0432\u0430\u0435\u0442 source, wire \u0438 semantic. \u0412 REST/JSON \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043b\u043e\u043c\u0430\u044e\u0442 wire/semantic compatibility: \u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c JSON, \u043d\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u0435 \u0441\u0442\u0430\u043b\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437-\u0437\u0430 \u043d\u043e\u0432\u043e\u0433\u043e default pagination, enum \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0430 \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 exhaustive switch."}),"\n",(0,d.jsx)(n.p,{children:"\u0421\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 rollout. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435/endpoint, \u043f\u043e\u0442\u043e\u043c \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0442\u043e\u043c \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c usage \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c deprecation, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432 \u043d\u043e\u0432\u043e\u0439 major/versioned surface."}),"\n",(0,d.jsx)(n.h3,{id:"\u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435-2-3-\u043c\u0438\u043d\u0443\u0442\u044b-19",children:"\u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 (2-3 \u043c\u0438\u043d\u0443\u0442\u044b)"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435"}),(0,d.jsx)(n.th,{children:"\u041e\u0431\u044b\u0447\u043d\u043e compatible?"}),(0,d.jsx)(n.th,{children:"\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c optional response field"}),(0,d.jsx)(n.td,{children:"\u0434\u0430"}),(0,d.jsx)(n.td,{children:"\u0435\u0441\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044e\u0442 unknown fields"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c required request field"}),(0,d.jsx)(n.td,{children:"\u043d\u0435\u0442"}),(0,d.jsx)(n.td,{children:"\u0441\u0442\u0430\u0440\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0435"}),(0,d.jsx)(n.td,{children:"\u043d\u0435\u0442"}),(0,d.jsx)(n.td,{children:"remove + add"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0438\u043f \u043f\u043e\u043b\u044f"}),(0,d.jsx)(n.td,{children:"\u043d\u0435\u0442"}),(0,d.jsx)(n.td,{children:"\u043b\u043e\u043c\u0430\u0435\u0442 \u043f\u0430\u0440\u0441\u0438\u043d\u0433/\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c enum value"}),(0,d.jsx)(n.td,{children:"\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e"}),(0,d.jsx)(n.td,{children:"\u043a\u043b\u0438\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c unknown"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c default pagination"}),(0,d.jsx)(n.td,{children:"\u043d\u0435\u0442/\u0440\u0438\u0441\u043a"}),(0,d.jsx)(n.td,{children:"\u0441\u0442\u0430\u0440\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c error envelope"}),(0,d.jsx)(n.td,{children:"\u043d\u0435\u0442"}),(0,d.jsx)(n.td,{children:"\u043b\u043e\u043c\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a"})]})]})]}),"\n",(0,d.jsxs)(n.p,{children:["\u041a\u0435\u0439\u0441: API \u0445\u043e\u0447\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c ",(0,d.jsx)(n.code,{children:"fullName"})," \u043d\u0430 ",(0,d.jsx)(n.code,{children:"displayName"}),". \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043b\u0430\u043d: \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c ",(0,d.jsx)(n.code,{children:"displayName"}),", \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c ",(0,d.jsx)(n.code,{children:"fullName"}),", \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c docs/clients, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c telemetry \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f ",(0,d.jsx)(n.code,{children:"fullName"}),", \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c deprecation, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 v2 \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430."]}),"\n",(0,d.jsx)(n.h3,{id:"\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430-19",children:"\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u0421\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 API compatibility/deprecation plan: change type, consumers, additive path, telemetry, docs, deadline, removal version."}),"\n",(0,d.jsx)(n.li,{children:"\u0414\u043b\u044f 8 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043e\u0442\u043c\u0435\u0442\u044c\u0442\u0435 compatible/breaking \u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u0435 \u043f\u043e\u0447\u0435\u043c\u0443."}),"\n",(0,d.jsx)(n.li,{children:"\u041e\u043f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u0442\u0435\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0440\u044b\u0439 client fixture."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435-\u043e\u0448\u0438\u0431\u043a\u0438-19",children:"\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:'\u0423\u0434\u0430\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e "\u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0443\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f".'}),"\n",(0,d.jsx)(n.li,{children:"\u041c\u0435\u043d\u044f\u044e\u0442 enum/default/error shape \u0431\u0435\u0437 \u0432\u0435\u0440\u0441\u0438\u0438."}),"\n",(0,d.jsx)(n.li,{children:"\u041d\u0435 \u0437\u043d\u0430\u044e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 consumers \u0438 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 usage telemetry."}),"\n",(0,d.jsx)(n.li,{children:"\u0421\u0447\u0438\u0442\u0430\u044e\u0442 OpenAPI diff \u0437\u0430\u043c\u0435\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 fixtures."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"follow-up-\u0432\u043e\u043f\u0440\u043e\u0441\u044b-19",children:"Follow-up \u0432\u043e\u043f\u0440\u043e\u0441\u044b"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"\u041f\u043e\u0447\u0435\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 enum value \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c breaking?"}),"\n",(0,d.jsx)(n.li,{children:"\u0427\u0435\u043c additive change \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 semantic change?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u0430 \u043d\u043e\u0432\u0430\u044f API version?"}),"\n",(0,d.jsx)(n.li,{children:"\u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u0430\u0440\u043e\u0435 \u043f\u043e\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c?"}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0447\u0442\u043e-\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c-19",children:"\u0427\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:"Additive vs breaking API changes."}),"\n",(0,d.jsx)(n.li,{children:"Deprecation window, versioning, consumer telemetry."}),"\n",(0,d.jsx)(n.li,{children:"Contract tests, OpenAPI diff, backward-compatible rollout."}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435-\u043c\u043e\u0434\u0443\u043b\u0438-\u0438-\u043a\u0430\u0440\u0442\u0430-19",children:"\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u0430\u0440\u0442\u0430"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Node.js"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/learning/foundations/web-network",children:"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435: Web \u0438 \u0441\u0435\u0442\u044c"})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"\u041a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: Node.js"})}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"\u043a\u0443\u0434\u0430-\u0434\u0430\u043b\u044c\u0448\u0435",children:"\u041a\u0443\u0434\u0430 \u0434\u0430\u043b\u044c\u0448\u0435"}),"\n",(0,d.jsxs)(n.ol,{children:["\n",(0,d.jsxs)(n.li,{children:["\u0412\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c: ",(0,d.jsx)(n.a,{href:"/docs/learning/backend-fullstack/nodejs",children:"Node.js"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["\u0421\u0432\u0435\u0440\u044c\u0442\u0435\u0441\u044c \u0441 \u043a\u0430\u0440\u0442\u043e\u0439 \u0442\u0435\u043c\u044b: ",(0,d.jsx)(n.a,{href:"/docs/preparation-map/nodejs",children:"Node.js"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["\u0414\u043b\u044f data-access \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 q-18..q-19 \u043f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 bridge: ",(0,d.jsx)(n.a,{href:"/docs/tracks/practice-bridges#backend--data-access-integration",children:"Backend / Data Access Integration"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["\u0417\u0430\u043a\u0440\u0435\u043f\u0438\u0442\u0435 N+1 \u0438 join cardinality \u0432 ",(0,d.jsx)(n.a,{href:"/sql-sandbox?challenge=sql-join-duplicate-orders",children:"SQL-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0435: \u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043a\u0430\u0437\u044b \u0431\u0435\u0437 \u0434\u0443\u0431\u043b\u0435\u0439"}),"."]}),"\n",(0,d.jsxs)(n.li,{children:["\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0439\u0442\u0435 \u043f\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0443: ",(0,d.jsx)(n.a,{href:"/docs/tracks/middle",children:"Middle \u0442\u0440\u0435\u043a"}),"."]}),"\n"]})]})}function a(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(t,{...e})}):t(e)}},8453(e,n,l){l.d(n,{R:()=>r,x:()=>c});var s=l(6540);const d={},i=s.createContext(d);function r(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:r(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.