{"id":377785,"date":"2024-06-01T15:09:23","date_gmt":"2024-06-01T15:09:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=377785"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=377785","title":{"rendered":"<span>\u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 DWH \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Data Vault<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><strong><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/em><\/strong><\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f Data Vault \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0414\u044d\u043d\u043e\u043c \u041b\u0438\u043d\u0441\u0442\u0435\u0434\u043e\u043c \u0432 \u043a\u043e\u043d\u0446\u0435 1990-\u0445 \u0433\u043e\u0434\u043e\u0432 \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u0438\u0439, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438. Data Vault \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u0430\u043c\u044b\u0435 \u043b\u0443\u0447\u0448\u0438\u0435 \u0447\u0435\u0440\u0442\u044b \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0437\u0432\u0435\u0437\u0434\u043d\u044b\u0445 \u0441\u0445\u0435\u043c.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044e \u0438 \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c DWH \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/h2>\n<h4>Hubs (\u0445\u0430\u0431\u044b)<\/h4>\n<p>Hubs \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442 <em>\u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0438<\/em>. \u0411\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u0442\u0438\u043f\u043e \u043a\u0430\u043a \u043a\u043b\u0438\u0435\u043d\u0442\u044b, \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0438\u043b\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u041a\u0430\u0436\u0434\u044b\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438.<\/p>\n<p>\u0425\u0430\u0431\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437:<\/p>\n<ul>\n<li>\n<p><strong>\u0411\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447<\/strong> \u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0443\u0440\u0440\u043e\u0433\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447<\/strong>  \u2014 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u0445\u0430\u0431\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0438<\/strong> \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0445\u0430\u0431\u0430 &#8212; \u0442\u0430\u0431\u043b\u0438\u0446\u0430 &#171;Customer&#187; <code>H_Customer<\/code>, \u0433\u0434\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 <code>Customer_ID<\/code>, \u0430 \u0441\u0443\u0440\u0440\u043e\u0433\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0432\u044f\u0437\u0435\u0439.  <\/p>\n<h4>Links (\u0441\u0441\u044b\u043b\u043a\u0438)<\/h4>\n<p>Links \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0445\u0430\u0431\u0430\u043c\u0438. \u0422.\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u044e\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u043b\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0430\u043c\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b links:<\/p>\n<ul>\n<li>\n<p><strong>\u0411\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0438<\/strong> \u2014 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0438\u0437 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0445\u0430\u0431\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0443\u0440\u0440\u043e\u0433\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447<\/strong>  \u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/strong> \u2014 \u043c\u0435\u0442\u043a\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u044b\u043b\u0430 \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0438<\/strong> \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u0441\u0432\u044f\u0437\u044c\u200b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0441\u044b\u043b\u043a\u0438 \u0434\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0445\u0430\u0431\u0430\u043c\u0438 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0441\u044b\u043b\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 &#171;Customer&#187; \u0438 &#171;Product&#187; \u043c\u043e\u0436\u0435\u0442 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u043f\u043e\u043a\u0443\u043f\u043a\u0438.  <\/p>\n<h4>Satellites (\u0441\u0430\u0442\u0435\u043b\u043b\u0438\u0442\u044b)<\/h4>\n<p><strong>\u0421\u043f\u0443\u0442\u043d\u0438\u043a\u0438<\/strong> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u0438\u0432\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0438\u043b\u0438 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0445\u0430\u0431\u0430\u0445 \u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u0445. \u0421\u043f\u0443\u0442\u043d\u0438\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><strong>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0445\u0430\u0431\u0430 \u0438\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0438<\/strong> \u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u0445\u0430\u0431\u043e\u043c \u0438\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u043e\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/strong> \u2014 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u0438\u0432\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0438\u043c\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0430\u0434\u0440\u0435\u0441, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u0438 \u0442.\u0434.<\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f<\/strong> \u2014 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043a\u0438, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0438\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0438<\/strong> \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435\u200b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043f\u0443\u0442\u043d\u0438\u043a \u0434\u043b\u044f \u0445\u0430\u0431\u0430 &#171;Customer&#187; \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043a\u0430\u043a \u0438\u043c\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0430\u0434\u0440\u0435\u0441 \u0438 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430.<\/p>\n<h2>\u042d\u0442\u0430\u043f\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Data Vault \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/h2>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u0440\u0446\u0438\u0435\u0439 \u0438 \u043e\u043d\u0430 \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0430\u0441\u0430\u043c\u0438.<\/p>\n<p><strong>\u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433<\/strong> &#8212; <strong>\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/strong> \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0445\u0430\u0431\u043e\u0432. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0443\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u044b, \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0438 \u0437\u0430\u043a\u0430\u0437\u044b. \u0425\u0430\u0431\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0445\u0430\u0431\u044b \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"sql\">CREATE TABLE dv.H_Customer (     Customer_HK VARCHAR(64) PRIMARY KEY, -- Hash Key     Customer_ID VARCHAR(64) NOT NULL,    -- Business Key     Load_DTS TIMESTAMP NOT NULL,         -- Load Timestamp     Record_Source VARCHAR(64) NOT NULL   -- Record Source );<\/code><\/pre>\n<p><code>Customer_HK<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u044d\u0448-\u043a\u043b\u044e\u0447\u043e\u043c, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0430 <code>Customer_ID<\/code>.<\/p>\n<p><strong>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433<\/strong> \u2014 <strong>\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043e\u043a \u0434\u043b\u044f \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0438 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0439<\/strong> \u043c\u0435\u0436\u0434\u0443 \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0441\u044b\u043b\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u0437\u0430\u043a\u0430\u0437\u0430\u043c\u0438.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u0437\u0430\u043a\u0430\u0437\u0430\u043c\u0438:<\/p>\n<pre><code class=\"sql\">CREATE TABLE dv.L_Customer_Order (     Customer_Order_HK VARCHAR(64) PRIMARY KEY, -- Hash Key     Customer_HK VARCHAR(64) NOT NULL,          -- Foreign Key to H_Customer     Order_HK VARCHAR(64) NOT NULL,             -- Foreign Key to H_Order     Load_DTS TIMESTAMP NOT NULL,               -- Load Timestamp     Record_Source VARCHAR(64) NOT NULL         -- Record Source );<\/code><\/pre>\n<p><code>Customer_Order_HK<\/code> \u2014 \u0445\u044d\u0448-\u043a\u043b\u044e\u0447, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u043a\u043b\u044e\u0447\u0435\u0439 <code>Customer_HK<\/code> \u0438 <code>Order_HK<\/code>.<\/p>\n<p>\u0421\u043f\u0443\u0442\u043d\u0438\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u0438\u0432\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u0438 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445:<\/p>\n<pre><code class=\"sql\">CREATE TABLE dv.S_Customer (     Customer_HK VARCHAR(64) NOT NULL,    -- Foreign Key to H_Customer     Load_DTS TIMESTAMP NOT NULL,         -- Load Timestamp     End_DTS TIMESTAMP,                   -- End Timestamp     Record_Source VARCHAR(64) NOT NULL,  -- Record Source     Customer_Name VARCHAR(255),          -- Customer Name     Customer_Email VARCHAR(255),         -- Customer Email     Customer_Phone VARCHAR(20)           -- Customer Phone );<\/code><\/pre>\n<p><code>Customer_HK<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u0441\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0445\u0430\u0431\u043e\u043c, \u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u044b <code>Customer_Name<\/code>, <code>Customer_Email<\/code> \u0438 <code>Customer_Phone<\/code> \u0445\u0440\u0430\u043d\u044f\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u0438\u0432\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <strong>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0445\u0430\u0431\u044b<\/strong>, <strong>\u0441\u0441\u044b\u043b\u043a\u0438<\/strong> \u0438 <strong>\u0441\u043f\u0443\u0442\u043d\u0438\u043a\u0438<\/strong>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441 ETL.<\/p>\n<p>ETL-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0430\u0431 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"sql\">INSERT INTO dv.H_Customer (Customer_HK, Customer_ID, Load_DTS, Record_Source) SELECT      MD5(CONCAT(Customer_ID, Record_Source)) AS Customer_HK, -- Creating the Hash Key     Customer_ID,     NOW() AS Load_DTS,     'SourceSystem1' AS Record_Source FROM      staging.Customer WHERE      NOT EXISTS (         SELECT 1          FROM dv.H_Customer          WHERE dv.H_Customer.Customer_ID = staging.Customer.Customer_ID     );<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u044b <code>Load_DTS<\/code> \u0438 <code>End_DTS<\/code> \u0432 \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u0430\u0445.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u0430 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445:<\/p>\n<pre><code class=\"sql\">UPDATE dv.S_Customer SET End_DTS = NOW() WHERE Customer_HK = :Customer_HK   AND End_DTS IS NULL;  INSERT INTO dv.S_Customer (Customer_HK, Load_DTS, Record_Source, Customer_Name, Customer_Email, Customer_Phone) VALUES (:Customer_HK, NOW(), 'SourceSystem1', :Customer_Name, :Customer_Email, :Customer_Phone);<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 <code>End_DTS<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p><strong>\u0411\u0438\u0437\u043d\u0435\u0441-\u0441\u043b\u043e\u0439<\/strong> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0440\u0445 \u0441\u044b\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b, \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432. \u0441\u043b\u043e\u0439 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0438 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0438 \u043e\u0442\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u043b\u043e\u044f \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0439 \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"sql\">CREATE TABLE dv.B_Customer_CLV (     Customer_HK VARCHAR(64) NOT NULL,    -- Foreign Key to H_Customer     CLV DECIMAL(18, 2),                  -- Calculated Lifetime Value     Load_DTS TIMESTAMP NOT NULL,         -- Load Timestamp     Record_Source VARCHAR(64) NOT NULL   -- Record Source );  INSERT INTO dv.B_Customer_CLV (Customer_HK, CLV, Load_DTS, Record_Source) SELECT      H_Customer.Customer_HK,     SUM(O.Order_Amount) AS CLV,        -- Summing the order amounts to calculate CLV     NOW() AS Load_DTS,     'BusinessCalculation' AS Record_Source FROM      dv.H_Customer AS H_Customer JOIN      dv.L_Customer_Order AS L_Customer_Order     ON H_Customer.Customer_HK = L_Customer_Order.Customer_HK JOIN      dv.S_Order AS S_Order     ON L_Customer_Order.Order_HK = S_Order.Order_HK GROUP BY      H_Customer.Customer_HK;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u043e\u0432\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u043b\u043e\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0438 \u0445\u0440\u0430\u043d\u0438\u0442 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u0443\u044e \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0437\u0430\u043a\u0430\u0437\u0430\u0445.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b ETL, \u0447\u0442\u043e\u0431\u044b \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0443\u0447\u043d\u043e\u0439 \u0442\u0440\u0443\u0434. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Apache Airflow:<\/p>\n<pre><code class=\"python\">from airflow import DAG from airflow.operators.dummy_operator import DummyOperator from airflow.operators.python_operator import PythonOperator from datetime import datetime  def load_customer_data(**kwargs): # \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0430\u0431 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432     import psycopg2     from psycopg2 import sql     import hashlib      conn = psycopg2.connect(         dbname=\"your_db\",         user=\"your_user\",         password=\"your_password\",         host=\"your_host\",         port=\"your_port\"     )     cursor = conn.cursor()      # SQL \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0430\u0431 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432     load_customer_sql = \"\"\"     INSERT INTO dv.H_Customer (Customer_HK, Customer_ID, Load_DTS, Record_Source)     SELECT          MD5(CONCAT(Customer_ID, Record_Source)) AS Customer_HK,          Customer_ID,         NOW() AS Load_DTS,         'SourceSystem1' AS Record_Source     FROM          staging.Customer     WHERE          NOT EXISTS (             SELECT 1              FROM dv.H_Customer              WHERE dv.H_Customer.Customer_ID = staging.Customer.Customer_ID         );     \"\"\"      cursor.execute(load_customer_sql)     conn.commit()     cursor.close()     conn.close()  def load_order_data(**kwargs):  # \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0430\u0431 \u0437\u0430\u043a\u0430\u0437\u043e\u0432     import psycopg2     from psycopg2 import sql     import hashlib      conn = psycopg2.connect(         dbname=\"your_db\",         user=\"your_user\",         password=\"your_password\",         host=\"your_host\",         port=\"your_port\"     )     cursor = conn.cursor()      # SQL \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0430\u0431 \u0437\u0430\u043a\u0430\u0437\u043e\u0432     load_order_sql = \"\"\"     INSERT INTO dv.H_Order (Order_HK, Order_ID, Load_DTS, Record_Source)     SELECT          MD5(CONCAT(Order_ID, Record_Source)) AS Order_HK,          Order_ID,         NOW() AS Load_DTS,         'SourceSystem1' AS Record_Source     FROM          staging.Order     WHERE          NOT EXISTS (             SELECT 1              FROM dv.H_Order              WHERE dv.H_Order.Order_ID = staging.Order.Order_ID         );     \"\"\"      cursor.execute(load_order_sql)     conn.commit()     cursor.close()     conn.close()   default_args = {     'owner': 'airflow',     'depends_on_past': False,     'start_date': datetime(2024, 5, 21),     'email_on_failure': False,     'email_on_retry': False, }  dag = DAG('data_vault_etl', default_args=default_args, schedule_interval='@daily')  start = DummyOperator(task_id='start', dag=dag)  load_customers = PythonOperator(     task_id='load_customer_data',     provide_context=True,     python_callable=load_customer_data,     dag=dag )  load_orders = PythonOperator(     task_id='load_order_data',     provide_context=True,     python_callable=load_order_data,     dag=dag )  end = DummyOperator(task_id='end', dag=dag)  start >> load_customers >> load_orders >> end<\/code><\/pre>\n<p><strong>\u041c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Grafana \u0438 Prometheus.<\/strong><\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Grafana \u0438 Prometheus:<\/p>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Prometheus<\/strong> \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043c\u0435\u0442\u0440\u0438\u043a:<\/p>\n<pre><code class=\"yaml\">global:   scrape_interval: 15s  scrape_configs:   - job_name: 'airflow'     static_configs:       - targets: ['localhost:8080']<\/code><\/pre>\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Grafana<\/strong> \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 Prometheus:<\/p>\n<pre><code class=\"json\">{   \"datasource\": \"Prometheus\",   \"query\": \"sum(rate(airflow_task_duration_seconds_sum[1m])) by (task)\" }<\/code><\/pre>\n<p>\u0412 \u043e\u0431\u0449\u0438\u0445 \u0447\u0435\u0440\u0442\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a.<\/p>\n<hr\/>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b.<\/p>\n<p><strong><em>\u0410 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e<\/em><\/strong><a href=\"https:\/\/otus.pw\/JRAE\/\"><strong><em> \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b<\/em><\/strong><\/a><strong><em> \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u043e\u0432. <\/em><\/strong><a href=\"https:\/\/otus.pw\/JRAE\/\"><strong><em>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435<\/em><\/strong><\/a><strong><em>.<\/em><\/strong><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/816219\/\"> https:\/\/habr.com\/ru\/articles\/816219\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><strong><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/em><\/strong><\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f Data Vault \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0414\u044d\u043d\u043e\u043c \u041b\u0438\u043d\u0441\u0442\u0435\u0434\u043e\u043c \u0432 \u043a\u043e\u043d\u0446\u0435 1990-\u0445 \u0433\u043e\u0434\u043e\u0432 \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u0438\u0439, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438. Data Vault \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u0430\u043c\u044b\u0435 \u043b\u0443\u0447\u0448\u0438\u0435 \u0447\u0435\u0440\u0442\u044b \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0437\u0432\u0435\u0437\u0434\u043d\u044b\u0445 \u0441\u0445\u0435\u043c.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044e \u0438 \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c DWH \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/h2>\n<h4>Hubs (\u0445\u0430\u0431\u044b)<\/h4>\n<p>Hubs \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442 <em>\u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0438<\/em>. \u0411\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u0442\u0438\u043f\u043e \u043a\u0430\u043a \u043a\u043b\u0438\u0435\u043d\u0442\u044b, \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0438\u043b\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u041a\u0430\u0436\u0434\u044b\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438.<\/p>\n<p>\u0425\u0430\u0431\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437:<\/p>\n<ul>\n<li>\n<p><strong>\u0411\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447<\/strong> \u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0443\u0440\u0440\u043e\u0433\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447<\/strong>  \u2014 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u0445\u0430\u0431\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0438<\/strong> \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0445\u0430\u0431\u0430 &#8212; \u0442\u0430\u0431\u043b\u0438\u0446\u0430 &#171;Customer&#187; <code>H_Customer<\/code>, \u0433\u0434\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 <code>Customer_ID<\/code>, \u0430 \u0441\u0443\u0440\u0440\u043e\u0433\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0432\u044f\u0437\u0435\u0439.  <\/p>\n<h4>Links (\u0441\u0441\u044b\u043b\u043a\u0438)<\/h4>\n<p>Links \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0445\u0430\u0431\u0430\u043c\u0438. \u0422.\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u044e\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u043b\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0430\u043c\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b links:<\/p>\n<ul>\n<li>\n<p><strong>\u0411\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0438<\/strong> \u2014 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0438\u0437 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0445\u0430\u0431\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0443\u0440\u0440\u043e\u0433\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447<\/strong>  \u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/strong> \u2014 \u043c\u0435\u0442\u043a\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u044b\u043b\u0430 \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0438<\/strong> \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u0441\u0432\u044f\u0437\u044c\u200b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0441\u044b\u043b\u043a\u0438 \u0434\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0445\u0430\u0431\u0430\u043c\u0438 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0441\u044b\u043b\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 &#171;Customer&#187; \u0438 &#171;Product&#187; \u043c\u043e\u0436\u0435\u0442 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u043f\u043e\u043a\u0443\u043f\u043a\u0438.  <\/p>\n<h4>Satellites (\u0441\u0430\u0442\u0435\u043b\u043b\u0438\u0442\u044b)<\/h4>\n<p><strong>\u0421\u043f\u0443\u0442\u043d\u0438\u043a\u0438<\/strong> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u0438\u0432\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0438\u043b\u0438 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0445\u0430\u0431\u0430\u0445 \u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u0445. \u0421\u043f\u0443\u0442\u043d\u0438\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><strong>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0445\u0430\u0431\u0430 \u0438\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0438<\/strong> \u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u0445\u0430\u0431\u043e\u043c \u0438\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u043e\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/strong> \u2014 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u0438\u0432\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0438\u043c\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0430\u0434\u0440\u0435\u0441, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u0438 \u0442.\u0434.<\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f<\/strong> \u2014 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043a\u0438, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0438\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0438<\/strong> \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435\u200b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043f\u0443\u0442\u043d\u0438\u043a \u0434\u043b\u044f \u0445\u0430\u0431\u0430 &#171;Customer&#187; \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043a\u0430\u043a \u0438\u043c\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0430\u0434\u0440\u0435\u0441 \u0438 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430.<\/p>\n<h2>\u042d\u0442\u0430\u043f\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Data Vault \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/h2>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u0440\u0446\u0438\u0435\u0439 \u0438 \u043e\u043d\u0430 \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0430\u0441\u0430\u043c\u0438.<\/p>\n<p><strong>\u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433<\/strong> &#8212; <strong>\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/strong> \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0445\u0430\u0431\u043e\u0432. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0443\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u044b, \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0438 \u0437\u0430\u043a\u0430\u0437\u044b. \u0425\u0430\u0431\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0445\u0430\u0431\u044b \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"sql\">CREATE TABLE dv.H_Customer (     Customer_HK VARCHAR(64) PRIMARY KEY, -- Hash Key     Customer_ID VARCHAR(64) NOT NULL,    -- Business Key     Load_DTS TIMESTAMP NOT NULL,         -- Load Timestamp     Record_Source VARCHAR(64) NOT NULL   -- Record Source );<\/code><\/pre>\n<p><code>Customer_HK<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u044d\u0448-\u043a\u043b\u044e\u0447\u043e\u043c, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u044e\u0447\u0430 <code>Customer_ID<\/code>.<\/p>\n<p><strong>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433<\/strong> \u2014 <strong>\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043e\u043a \u0434\u043b\u044f \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0438 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0439<\/strong> \u043c\u0435\u0436\u0434\u0443 \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0441\u044b\u043b\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u0437\u0430\u043a\u0430\u0437\u0430\u043c\u0438.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u0437\u0430\u043a\u0430\u0437\u0430\u043c\u0438:<\/p>\n<pre><code class=\"sql\">CREATE TABLE dv.L_Customer_Order (     Customer_Order_HK VARCHAR(64) PRIMARY KEY, -- Hash Key     Customer_HK VARCHAR(64) NOT NULL,          -- Foreign Key to H_Customer     Order_HK VARCHAR(64) NOT NULL,             -- Foreign Key to H_Order     Load_DTS TIMESTAMP NOT NULL,               -- Load Timestamp     Record_Source VARCHAR(64) NOT NULL         -- Record Source );<\/code><\/pre>\n<p><code>Customer_Order_HK<\/code> \u2014 \u0445\u044d\u0448-\u043a\u043b\u044e\u0447, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u043a\u043b\u044e\u0447\u0435\u0439 <code>Customer_HK<\/code> \u0438 <code>Order_HK<\/code>.<\/p>\n<p>\u0421\u043f\u0443\u0442\u043d\u0438\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u0438\u0432\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u0438 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445:<\/p>\n<pre><code class=\"sql\">CREATE TABLE dv.S_Customer (     Customer_HK VARCHAR(64) NOT NULL,    -- Foreign Key to H_Customer     Load_DTS TIMESTAMP NOT NULL,         -- Load Timestamp     End_DTS TIMESTAMP,                   -- End Timestamp     Record_Source VARCHAR(64) NOT NULL,  -- Record Source     Customer_Name VARCHAR(255),          -- Customer Name     Customer_Email VARCHAR(255),         -- Customer Email     Customer_Phone VARCHAR(20)           -- Customer Phone );<\/code><\/pre>\n<p><code>Customer_HK<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u0441\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0445\u0430\u0431\u043e\u043c, \u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u044b <code>Customer_Name<\/code>, <code>Customer_Email<\/code> \u0438 <code>Customer_Phone<\/code> \u0445\u0440\u0430\u043d\u044f\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u0438\u0432\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <strong>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0445\u0430\u0431\u044b<\/strong>, <strong>\u0441\u0441\u044b\u043b\u043a\u0438<\/strong> \u0438 <strong>\u0441\u043f\u0443\u0442\u043d\u0438\u043a\u0438<\/strong>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441 ETL.<\/p>\n<p>ETL-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0430\u0431 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"sql\">INSERT INTO dv.H_Customer (Customer_HK, Customer_ID, Load_DTS, Record_Source) SELECT      MD5(CONCAT(Customer_ID, Record_Source)) AS Customer_HK, -- Creating the Hash Key     Customer_ID,     NOW() AS Load_DTS,     'SourceSystem1' AS Record_Source FROM      staging.Customer WHERE      NOT EXISTS (         SELECT 1          FROM dv.H_Customer          WHERE dv.H_Customer.Customer_ID = staging.Customer.Customer_ID     );<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u044b <code>Load_DTS<\/code> \u0438 <code>End_DTS<\/code> \u0432 \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u0430\u0445.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u0430 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445:<\/p>\n<pre><code class=\"sql\">UPDATE dv.S_Customer SET End_DTS = NOW() WHERE Customer_HK = :Customer_HK   AND End_DTS IS NULL;  INSERT INTO dv.S_Customer (Customer_HK, Load_DTS, Record_Source, Customer_Name, Customer_Email, Customer_Phone) VALUES (:Customer_HK, NOW(), 'SourceSystem1', :Customer_Name, :Customer_Email, :Customer_Phone);<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 <code>End_DTS<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p><strong>\u0411\u0438\u0437\u043d\u0435\u0441-\u0441\u043b\u043e\u0439<\/strong> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0440\u0445 \u0441\u044b\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b, \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432. \u0441\u043b\u043e\u0439 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0438 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0438 \u043e\u0442\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u043b\u043e\u044f \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0439 \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"sql\">CREATE TABLE dv.B_Customer_CLV (     Customer_HK VARCHAR(64) NOT NULL,    -- Foreign Key to H_Customer     CLV DECIMAL(18, 2),                  -- Calculated Lifetime Value     Load_DTS TIMESTAMP NOT NULL,         -- Load Timestamp     Record_Source VARCHAR(64) NOT NULL   -- Record Source );  INSERT INTO dv.B_Customer_CLV (Customer_HK, CLV, Load_DTS, Record_Source) SELECT      H_Customer.Customer_HK,     SUM(O.Order_Amount) AS CLV,        -- Summing the order amounts to calculate CLV     NOW() AS Load_DTS,     'BusinessCalculation' AS Record_Source FROM      dv.H_Customer AS H_Customer JOIN      dv.L_Customer_Order AS L_Customer_Order     ON H_Customer.Customer_HK = L_Customer_Order.Customer_HK JOIN      dv.S_Order AS S_Order     ON L_Customer_Order.Order_HK = S_Order.Order_HK GROUP BY      H_Customer.Customer_HK;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u043e\u0432\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u043b\u043e\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0438 \u0445\u0440\u0430\u043d\u0438\u0442 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u0443\u044e \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0437\u0430\u043a\u0430\u0437\u0430\u0445.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b ETL, \u0447\u0442\u043e\u0431\u044b \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0443\u0447\u043d\u043e\u0439 \u0442\u0440\u0443\u0434. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Apache Airflow:<\/p>\n<pre><code class=\"python\">from airflow import DAG from airflow.operators.dummy_operator import DummyOperator from airflow.operators.python_operator import PythonOperator from datetime import datetime  def load_customer_data(**kwargs): # \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0430\u0431 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432     import psycopg2     from psycopg2 import sql     import hashlib      conn = psycopg2.connect(         dbname=\"your_db\",         user=\"your_user\",         password=\"your_password\",         host=\"your_host\",         port=\"your_port\"     )     cursor = conn.cursor()      # SQL \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0430\u0431 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432     load_customer_sql = \"\"\"     INSERT INTO dv.H_Customer (Customer_HK, Customer_ID, Load_DTS, Record_Source)     SELECT          MD5(CONCAT(Customer_ID, Record_Source)) AS Customer_HK,          Customer_ID,         NOW() AS Load_DTS,         'SourceSystem1' AS Record_Source     FROM          staging.Customer     WHERE          NOT EXISTS (             SELECT 1              FROM dv.H_Customer              WHERE dv.H_Customer.Customer_ID = staging.Customer.Customer_ID         );     \"\"\"      cursor.execute(load_customer_sql)     conn.commit()     cursor.close()     conn.close()  def load_order_data(**kwargs):  # \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0430\u0431 \u0437\u0430\u043a\u0430\u0437\u043e\u0432     import psycopg2     from psycopg2 import sql     import hashlib      conn = psycopg2.connect(         dbname=\"your_db\",         user=\"your_user\",         password=\"your_password\",         host=\"your_host\",         port=\"your_port\"     )     cursor = conn.cursor()      # SQL \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0430\u0431 \u0437\u0430\u043a\u0430\u0437\u043e\u0432     load_order_sql = \"\"\"     INSERT INTO dv.H_Order (Order_HK, Order_ID, Load_DTS, Record_Source)     SELECT          MD5(CONCAT(Order_ID, Record_Source)) AS Order_HK,          Order_ID,         NOW() AS Load_DTS,         'SourceSystem1' AS Record_Source     FROM          staging.Order     WHERE          NOT EXISTS (             SELECT 1              FROM dv.H_Order              WHERE dv.H_Order.Order_ID = staging.Order.Order_ID         );     \"\"\"      cursor.execute(load_order_sql)     conn.commit()     cursor.close()     conn.close()   default_args = {     'owner': 'airflow',     'depends_on_past': False,     'start_date': datetime(2024, 5, 21),     'email_on_failure': False,     'email_on_retry': False, }  dag = DAG('data_vault_etl', default_args=default_args, schedule_interval='@daily')  start = DummyOperator(task_id='start', dag=dag)  load_customers = PythonOperator(     task_id='load_customer_data',     provide_context=True,     python_callable=load_customer_data,     dag=dag )  load_orders = PythonOperator(     task_id='load_order_data',     provide_context=True,     python_callable=load_order_data,     dag=dag )  end = DummyOperator(task_id='end', dag=dag)  start >> load_customers >> load_orders >> end<\/code><\/pre>\n<p><strong>\u041c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Grafana \u0438 Prometheus.<\/strong><\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Grafana \u0438 Prometheus:<\/p>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Prometheus<\/strong> \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043c\u0435\u0442\u0440\u0438\u043a:<\/p>\n<pre><code class=\"yaml\">global:<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-377785","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/377785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=377785"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/377785\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=377785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=377785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=377785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}