{"id":30908,"date":"2019-10-31T21:38:07","date_gmt":"2019-10-31T18:38:07","guid":{"rendered":"https:\/\/prohoster.info\/blog\/stroitelnye-bloki-raspredelennyh-prilozhenij-pervoe-priblizhenie\/"},"modified":"2019-10-31T21:38:07","modified_gmt":"2019-10-31T18:38:07","slug":"stroitelnye-bloki-raspredelennyh-prilozhenij-pervoe-priblizhenie","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/stroitelnye-bloki-raspredelennyh-prilozhenij-pervoe-priblizhenie","title":{"rendered":"Blloqet nd\u00ebrtuese t\u00eb aplikacioneve t\u00eb shp\u00ebrndara. Afrohet e par\u00eb","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Blloqet nd\u00ebrtuese t\u00eb aplikacioneve t\u00eb shp\u00ebrndara. Afrohet e par\u00eb\" src=\"\/wp-content\/uploads\/2019\/04\/7ef485e452075775ce317b557671274c.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>N\u00eb t\u00eb kaluar\u00ebn <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/446028\/\">artikullin<\/a><\/noindex> Ne shqyrtuam bazat teorike t\u00eb arkitektur\u00ebs reaktive. \u00cbsht\u00eb koha t\u00eb flasim p\u00ebr fluxet e t\u00eb dh\u00ebnave, m\u00ebnyrat e realizimit t\u00eb sistemeve reaktive Erlang\/Elixir dhe modelet e shk\u00ebmbimit t\u00eb mesazheve n\u00eb to:<\/p>\n<p><\/p>\n<ul>\n<li>Request-response<\/li>\n<li>Request-Chunked Response<\/li>\n<li>Response with Request<\/li>\n<li>Publish-subscribe<\/li>\n<li>Inverted Publish-subscribe<\/li>\n<li>Shp\u00ebrndarja e detyrave<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/li>\n<\/ul>\n<p><\/p>\n<h2 id=\"soa-msa-i-obmen-soobscheniyami\">SOA, MSA dhe shk\u00ebmbimi i mesazheve<\/h2>\n<p><\/p>\n<p>SOA, MSA \u2013 arkitektura sistemore q\u00eb p\u00ebrcaktojn\u00eb rregullat e nd\u00ebrtimit t\u00eb sistemeve, nd\u00ebrsa messaging ofron primitive p\u00ebr realizimin e tyre.<\/p>\n<p><\/p>\n<p>Nuk d\u00ebshiroj t\u00eb propagandoj nj\u00eb arkitektur\u00eb t\u00eb caktuar t\u00eb nd\u00ebrtimit t\u00eb sistemeve. Un\u00eb jam p\u00ebr aplikimin e praktikave q\u00eb jan\u00eb m\u00eb efikase dhe t\u00eb dobishme p\u00ebr projektin dhe biznesin specifik. \u00c7far\u00ebdo paradigme t\u00eb zgjedhim, \u00ebsht\u00eb m\u00eb mir\u00eb t\u00eb krijojm\u00eb blloqe sistemore me orientim n\u00eb metod\u00ebn Unix: komponente me lidhje minimale, p\u00ebrgjegj\u00ebse p\u00ebr entitete t\u00eb ve\u00e7anta. Metodat API kryejn\u00eb veprime sa m\u00eb t\u00eb thjeshta me entitetet.<\/p>\n<p><\/p>\n<p>Mesazhi \u2012 si\u00e7 e tregon emri \u2012 \u00ebsht\u00eb nj\u00eb broker mesazhesh. Q\u00ebllimi i tij kryesor \u00ebsht\u00eb t\u00eb pranoj\u00eb dhe d\u00ebrgoj\u00eb mesazhe. Ai \u00ebsht\u00eb p\u00ebrgjegj\u00ebs p\u00ebr nd\u00ebrfaqet e d\u00ebrgimit t\u00eb informacionit, formimin e kanaleve logjik\u00eb t\u00eb transmetimit t\u00eb informacionit brenda sistemit, ruterimin dhe balancimin, si dhe trajtimin e d\u00ebshtimeve n\u00eb nivel sistemik.<br \/>\nMessaging q\u00eb po zhvillohet nuk p\u00ebrpiqet t\u00eb konkurroj\u00eb me rabbitmq ose ta z\u00ebvend\u00ebsoj\u00eb at\u00eb. Karakteristikat e tij kryesore jan\u00eb:<\/p>\n<p><\/p>\n<ul>\n<li>Shp\u00ebrndarja.<br \/>\nPikat e shk\u00ebmbimit mund t\u00eb krijohen n\u00eb t\u00eb gjitha nyjat e klasterit, sa m\u00eb af\u00ebr kodit q\u00eb i p\u00ebrdor ato.<\/li>\n<li>Thjesht\u00ebsia.<br \/>\nOrientimi drejt minimalizimit t\u00eb kodit t\u00eb shablloneve dhe leht\u00ebsis\u00eb s\u00eb p\u00ebrdorimit.<\/li>\n<li>Performanca m\u00eb e mir\u00eb.<br \/>\nNe nuk p\u00ebrpiqemi t\u00eb p\u00ebrs\u00ebrisim funksionalitetin e rabbitmq, por theksojm\u00eb vet\u00ebm shtres\u00ebn arkitekturore dhe transportuese, t\u00eb cil\u00ebn e inkorporojm\u00eb sa m\u00eb thjesht\u00eb n\u00eb OTP, duke minimizuar kostot.<\/li>\n<li>Fleksibiliteti.<br \/>\n\u00c7do sh\u00ebrbim mund t\u00eb kombinonte shum\u00eb shabllone shk\u00ebmbimi.<\/li>\n<li>Q\u00ebndrueshm\u00ebria, e vendosur n\u00eb dizajn.<\/li>\n<li>Shkall\u00ebzueshm\u00ebria.<br \/>\nMessaging rritet s\u00eb bashku me aplikacionin. Kur rritet ngarkesa, mund t\u00eb nxjerrim pikat e shk\u00ebmbimit n\u00eb makina t\u00eb ve\u00e7anta.<\/li>\n<\/ul>\n<p><\/p>\n<p><em>V\u00ebrejtje.<\/em> Nga pik\u00ebpamja e organizimit t\u00eb kodit, p\u00ebr sistemet e komplikuara n\u00eb Erlang\/Elixir, projektet meta jan\u00eb mjaft t\u00eb p\u00ebrshtatshme. E gjith\u00eb kodi i projektit ndodhet n\u00eb nj\u00eb deposh - nj\u00eb projekt mbulues. N\u00eb t\u00eb nj\u00ebjt\u00ebn koh\u00eb, mikroserviset jan\u00eb maksimalisht t\u00eb izoluar dhe kryejn\u00eb operacione t\u00eb thjeshta, duke u p\u00ebrgjigjur p\u00ebr nj\u00eb entitet t\u00eb ve\u00e7ant\u00eb. Me k\u00ebt\u00eb qasje, \u00ebsht\u00eb e leht\u00eb t\u00eb mbash API-n\u00eb e sistemit t\u00eb t\u00ebr\u00eb, t\u00eb b\u00ebsh ndryshime leht\u00ebsisht dhe t\u00eb shkruash teste nj\u00ebsie dhe integrimi me leht\u00ebsi.<\/p>\n<p><\/p>\n<p>KompONENTET e sistemit nd\u00ebrveprojn\u00eb drejtp\u00ebrdrejt ose p\u00ebrmes nj\u00eb brokeri. Nga pozita e mesazheve, \u00e7do sh\u00ebrbim ka disa faza jet\u00ebsore:<\/p>\n<p><\/p>\n<ul>\n<li>Inicimi i sh\u00ebrbimit.<br \/>\nN\u00eb k\u00ebt\u00eb faz\u00eb, konfigurohet dhe niset procesi ekzekutiv t\u00eb sh\u00ebrbimit dhe var\u00ebsive.<\/li>\n<li>Krijimi i nj\u00eb pike shk\u00ebmbimi.<br \/>\nSh\u00ebrbimi mund t\u00eb p\u00ebrdor\u00eb nj\u00eb pik\u00eb shk\u00ebmbimi statike, t\u00eb caktuar n\u00eb konfigurimin e nodit, ose t\u00eb krijoj\u00eb pika shk\u00ebmbimi n\u00eb m\u00ebnyr\u00eb dynamike. <\/li>\n<li>Regjistrimi i sh\u00ebrbimit.<br \/>\nP\u00ebr t'i sh\u00ebrbyer k\u00ebrkesave, sh\u00ebrbimi duhet t\u00eb regjistrohet n\u00eb pik\u00ebn e shk\u00ebmbimit.<\/li>\n<li>Funksionimi normal.<br \/>\nSh\u00ebrbimi kryen pun\u00eb t\u00eb dobishme.<\/li>\n<li>Mbyllja e pun\u00ebs.<br \/>\nJan\u00eb t\u00eb mundshme 2 lloje t\u00eb p\u00ebrfundimeve: normale dhe emergjente. N\u00eb rastin normal, sh\u00ebrbimi nd\u00ebrpritet nga pika e shk\u00ebmbimit dhe ndalet. N\u00eb raste emergjente, messaging realizon nj\u00eb nga skenar\u00ebt e trajtimit t\u00eb d\u00ebshtimeve.<\/li>\n<\/ul>\n<p><\/p>\n<p>Duket mjaft e komplikuar, por n\u00eb kod nuk \u00ebsht\u00eb aq friksh\u00ebm. Shembujt e kodit me komente do t\u00eb paraqiten n\u00eb shqyrtimin e shablloneve pak m\u00eb von\u00eb.<\/p>\n<p><\/p>\n<h2 id=\"exchanges\">Shk\u00ebmbimet<\/h2>\n<p><\/p>\n<p>Pika e shk\u00ebmbimit \u00ebsht\u00eb procesi messaging q\u00eb implementon logjik\u00ebn e bashk\u00ebpunimit me komponent\u00ebt brenda shabllonit t\u00eb shk\u00ebmbimit t\u00eb mesazheve. N\u00eb t\u00eb gjitha shembujt e dh\u00ebn\u00eb m\u00eb posht\u00eb, komponent\u00ebt bashk\u00ebpunojn\u00eb p\u00ebrmes pikave t\u00eb shk\u00ebmbimit, kombinimi i t\u00eb cilave formon messaging.<\/p>\n<p><\/p>\n<h2 id=\"message-exchange-patterns-meps\">Modelet e shk\u00ebmbimit t\u00eb mesazheve (MEPs)<\/h2>\n<p><\/p>\n<p>N\u00eb m\u00ebnyr\u00eb globale, modelet e shk\u00ebmbimit mund t\u00eb ndahen n\u00eb dy-kah\u00ebshe dhe nj\u00eb-kah\u00ebshe. T\u00eb parat n\u00ebnkuptojn\u00eb nj\u00eb p\u00ebrgjigje ndaj mesazhit t\u00eb marr\u00eb, p\u00ebrdorimi i t\u00eb dyt\u00ebve nuk e k\u00ebrkon k\u00ebt\u00eb. Nj\u00eb shembull klasik i modelit dy-kah\u00ebsh n\u00eb arkitektur\u00ebn klient-server \u00ebsht\u00eb modeli Request-response. Le t\u00eb shqyrtojm\u00eb modelin dhe modifikimet e tij.<\/p>\n<p><\/p>\n<h3 id=\"requestresponse-ili-rpc\">Request\u2013response ose RPC<\/h3>\n<p><\/p>\n<p>RPC p\u00ebrdoret kur na nevojitet nj\u00eb p\u00ebrgjigje nga nj\u00eb proces tjet\u00ebr. Ky proces mund t\u00eb jet\u00eb i aktivizuar n\u00eb t\u00eb nj\u00ebjtin nyje ose ndodhet n\u00eb nj\u00eb kontinent tjet\u00ebr. M\u00eb posht\u00eb paraqitet skema e bashk\u00ebpunimit t\u00eb klientit dhe <a class=\"wpil_keyword_link\" href=\"https:\/\/prohoster.info\/sq\/server\/dts-los-angeles\/\"   title=\"server\" data-wpil-keyword-link=\"linked\"  data-wpil-monitor-id=\"3483\">server<\/a> p\u00ebrmes messaging.<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"Blloqet nd\u00ebrtuese t\u00eb aplikacioneve t\u00eb shp\u00ebrndara. Afrohet e par\u00eb\" src=\"\/wp-content\/uploads\/2019\/04\/091725fc108d6ce1a5fc9ae866e2c395.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>Duke qen\u00eb q\u00eb messaging \u00ebsht\u00eb plot\u00ebsisht asinkron, komunikimi p\u00ebr klientin ndahet n\u00eb 2 faza:<\/p>\n<p><\/p>\n<ol>\n<li>\n<p>D\u00ebrgimi i k\u00ebrkes\u00ebs<\/p>\n<p><\/p>\n<pre><code class=\"erlang\">messaging:request(Exchange, ResponseMatchingTag, RequestDefinition, HandlerProcess).<\/code><\/pre>\n<p><\/p>\n<p><em>Exchange<\/em> \u2012 emri unik i pik\u00ebs s\u00eb shk\u00ebmbimit<br \/>\n<em>ResponseMatchingTag<\/em> \u2012 etiket\u00eb lokale p\u00ebr trajtimin e p\u00ebrgjigjes. P.sh n\u00eb rastin e d\u00ebrgimit t\u00eb disa k\u00ebrkesave t\u00eb nj\u00ebjta, q\u00eb i p\u00ebrkasin p\u00ebrdoruesve t\u00eb ndrysh\u00ebm.<br \/>\n<em>RequestDefinition<\/em> \u2012 trupi i k\u00ebrkes\u00ebs<br \/>\n<em>HandlerProcess<\/em> \u2012 PID i trajtuesit. Ky proces do t\u00eb marr\u00eb p\u00ebrgjigjen nga serveri.<\/p>\n<p>\n<\/li>\n<li>\n<p>Trajtimi i p\u00ebrgjigjes<\/p>\n<p><\/p>\n<pre><code class=\"erlang\">handle_info(#'$msg'{exchange = EXCHANGE, tag = ResponseMatchingTag,message = ResponsePayload}, State)<\/code><\/pre>\n<p><\/p>\n<p><em>ResponsePayload<\/em> \u2012 p\u00ebrgjigja e serverit.<\/p>\n<p>\n<\/li>\n<\/ol>\n<p><\/p>\n<p>P\u00ebr serverin, procesi gjithashtu p\u00ebrb\u00ebhet nga 2 faza:<\/p>\n<p><\/p>\n<ol>\n<li>Inicializimi i pik\u00ebs s\u00eb shk\u00ebmbimit<\/li>\n<li>Trajtimi i k\u00ebrkesave t\u00eb pranuara<\/li>\n<\/ol>\n<p><\/p>\n<p>Le t\u00eb ilustrojm\u00eb k\u00ebt\u00eb model me kod. Supozoni se na nevojitet t\u00eb implementojm\u00eb nj\u00eb sh\u00ebrbim t\u00eb thjesht\u00eb q\u00eb ofron metod\u00ebn e vetme t\u00eb koh\u00ebs s\u00eb sakt\u00eb.<\/p>\n<p><\/p>\n<h4 id=\"kod-servera\">Kodi i serverit<\/h4>\n<p><\/p>\n<p>Le t\u00eb nxjerrim p\u00ebrkufizimin e API-s\u00eb s\u00eb sh\u00ebrbimit n\u00eb api.hrl:<\/p>\n<p><\/p>\n<pre><code class=\"erlang\">%% =====================================================\n%%  entitete\n%% =====================================================\n-record(time, {\n  unixtime :: non_neg_integer(),\n  datetime :: binary()\n}).\n\n-record(time_error, {\n  code :: non_neg_integer(),\n  error :: term()\n}).\n\n%% =====================================================\n%%  metoda\n%% =====================================================\n-record(time_req, {\n  opts :: term()\n}).\n-record(time_resp, {\n  result :: #time{} | #time_error{}\n}).<\/code><\/pre>\n<p><\/p>\n<p>Definojm\u00eb kontrolerin e sh\u00ebrbimit n\u00eb time_controller.erl<\/p>\n<p><\/p>\n<pre><code class=\"erlang\">%% N\u00eb shembull tregohet vet\u00ebm kodi i r\u00ebnd\u00ebsish\u00ebm. Duke e futur n\u00eb modelin gen_server mund t\u00eb marr\u00ebsh nj\u00eb sh\u00ebrbim n\u00eb pun\u00eb.\n\n%% inicializimi i gen_server\ninit(Args) -&gt;\n  %% lidhja me pik\u00ebn e shk\u00ebmbimit\n  messaging:monitor_exchange(req_resp, ?EXCHANGE, default, self())\n  {ok, #{}}.\n\n%% trajtimi i ngjarjes s\u00eb humbjes s\u00eb lidhjes me pik\u00ebn e shk\u00ebmbimit. Kjo ngjarje vjen gjithashtu n\u00ebse pika e shk\u00ebmbimit nuk ka filluar ende.\nhandle_info(#exchange_die{exchange = ?EXCHANGE}, State) -&gt;\n  erlang:send(self(), monitor_exchange),\n  {noreply, State};\n\n%% trajtimi i API\nhandle_info(#time_req{opts = _Opts}, State) -&gt;\n  messaging:response_once(Client, #time_resp{\nresult = #time{ unixtime = time_utils:unixtime(now()), datetime = time_utils:iso8601_fmt(now())}\n  });\n  {noreply, State};\n\n%% p\u00ebrfundimi i pun\u00ebs s\u00eb gen_server\nterminate(_Reason, _State) -&gt;\n  messaging:demonitor_exchange(req_resp, ?EXCHANGE, default, self()),\n  ok.<\/code><\/pre>\n<p><\/p>\n<h4 id=\"kod-klienta\">Kodi i klientit<\/h4>\n<p><\/p>\n<p>P\u00ebr t\u00eb d\u00ebrguar nj\u00eb k\u00ebrkes\u00eb n\u00eb sh\u00ebrbim, n\u00eb \u00e7do vend t\u00eb klientit mund t\u00eb th\u00ebrras\u00ebsh API-n e k\u00ebrkesave t\u00eb mesazheve:<\/p>\n<p><\/p>\n<pre><code class=\"erlang\">mesazhi i rastit: k\u00ebrkes\u00eb(?EXCHANGE, tag, #time_req{opts = #{}}, vet\u00eb()) e\n    ok -&gt; ok;\n    _ -&gt; %% logjika e p\u00ebrs\u00ebritjes apo d\u00ebshtimit\nfund<\/code><\/pre>\n<p><\/p>\n<p>N\u00eb nj\u00eb sistem t\u00eb shp\u00ebrndar\u00eb, konfigurimi i komponent\u00ebve mund t\u00eb jet\u00eb shum\u00eb i ndrysh\u00ebm dhe n\u00eb momentin e k\u00ebrkes\u00ebs p\u00ebr mesazhimin, ai mund t\u00eb mos ket\u00eb filluar akoma, ose kontrolluesi i sh\u00ebrbimit nuk mund t\u00eb jet\u00eb i gatsh\u00ebm p\u00ebr t\u00eb sh\u00ebrbyer k\u00ebrkes\u00ebn. Prandaj, \u00ebsht\u00eb e nevojshme t\u00eb kontrollojm\u00eb p\u00ebrgjigjen e mesazhimit dhe t\u00eb p\u00ebrpunojm\u00eb rastin e d\u00ebshtimit.<br \/>\nPas d\u00ebrgimit t\u00eb suksessh\u00ebm, klienti do t\u00eb marr\u00eb nj\u00eb p\u00ebrgjigje ose nj\u00eb gabim nga sh\u00ebrbimi.<br \/>\nDo t\u00eb p\u00ebrpunojm\u00eb t\u00eb dy rastet n\u00eb handle_info:<\/p>\n<p><\/p>\n<pre><code class=\"erlang\">handle_info(#'$msg'{exchange = ?EXCHANGE, tag = tag, message = #time_resp{result = #time{unixtime = Utime}}}, Shteti) -&gt;\n  ?debugVal(Utime),\n  {noreply, Shteti};\n\nhandle_info(#'$msg'{exchange = ?EXCHANGE, tag = tag, message = #time_resp{result = #time_error{code = ErrorCode}}}, Shteti) -&gt;\n  ?debugVal({error, ErrorCode}),\n  {noreply, Shteti};<\/code><\/pre>\n<p><\/p>\n<h3 id=\"request-chunked-response\">Request-Chunked Response<\/h3>\n<p><\/p>\n<p>\u00cbsht\u00eb m\u00eb mir\u00eb t\u00eb mos lejoni transferimin e mesazheve t\u00eb m\u00ebdha. Kjo ndikon n\u00eb reagueshm\u00ebrin\u00eb dhe stabilitetin e gjith\u00eb sistemit. N\u00ebse p\u00ebrgjigjja n\u00eb k\u00ebrkes\u00eb merr shum\u00eb memorie, ndarja n\u00eb pjes\u00eb \u00ebsht\u00eb e detyrueshme.<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"Blloqet nd\u00ebrtuese t\u00eb aplikacioneve t\u00eb shp\u00ebrndara. Afrohet e par\u00eb\" src=\"\/wp-content\/uploads\/2019\/04\/bd60742a933a8e4e3eeaf7f4adf00f2a.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>Do t\u00eb jap disa shembuj t\u00eb till\u00eb:<\/p>\n<p><\/p>\n<ul>\n<li>Komponent\u00ebt shk\u00ebmbejn\u00eb t\u00eb dh\u00ebna binar\u00eb, p\u00ebr shembull skedar\u00eb. Ndarja e p\u00ebrgjigjes n\u00eb pjes\u00eb t\u00eb vogla ndihmon n\u00eb pun\u00ebn efektive me skedar\u00eb t\u00eb \u00e7do madh\u00ebsie dhe parandalon mbingarkes\u00ebn e memories.<\/li>\n<li>Listing. P\u00ebr shembull, na nevojitet t\u00eb zgjedhim t\u00eb gjitha rekordet nga nj\u00eb tabel\u00eb t\u00eb madhe n\u00eb baz\u00ebn e t\u00eb dh\u00ebnave dhe t'i kalojm\u00eb nj\u00eb komponenti tjet\u00ebr.<\/li>\n<\/ul>\n<p><\/p>\n<p>Un\u00eb i quaj k\u00ebto p\u00ebrgjigje locomotiva. Sidoqoft\u00eb, 1024 mesazhe me nga 1 MB jan\u00eb m\u00eb mir\u00eb se nj\u00eb mesazh i vet\u00ebm me madh\u00ebsi 1 GB. <\/p>\n<p><\/p>\n<p>N\u00eb klasterin Erlang, ne fitojm\u00eb nj\u00eb p\u00ebrfitim shtes\u00eb \u2012 ulje t\u00eb ngarkes\u00ebs n\u00eb pik\u00ebn e exchange dhe rrjet, pasi p\u00ebrgjigjet d\u00ebrgohen direkt te marr\u00ebsi, duke anashkaluar pik\u00ebn e exchange.<\/p>\n<p><\/p>\n<h3 id=\"response-with-request\">Response with Request<\/h3>\n<p><\/p>\n<p>Ky \u00ebsht\u00eb nj\u00eb modifikim mjaft i rrall\u00eb i modelit RPC p\u00ebr nd\u00ebrtimin e sistemeve dialoguese.<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"Blloqet nd\u00ebrtuese t\u00eb aplikacioneve t\u00eb shp\u00ebrndara. Afrohet e par\u00eb\" src=\"\/wp-content\/uploads\/2019\/04\/9b350a0b48ca8acdca973da2f7eadb76.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<h3 id=\"publish-subscribe-data-distribution-tree\">Publish-subscribe (pem\u00eb shp\u00ebrndarjeje t\u00eb t\u00eb dh\u00ebnave)<\/h3>\n<p><\/p>\n<p>Sistemet e orientuara nga ngjarjet i d\u00ebrgojn\u00eb t\u00eb dh\u00ebnat konsumator\u00ebve sipas gatishm\u00ebris\u00eb. K\u00ebshtu, sistemet jan\u00eb m\u00eb prone ndaj modelit push sesa ndaj pull ose poll. Kjo ve\u00e7ori parandalon harxhuar burimet duke k\u00ebrkuar vazhdimisht dhe duke pritur t\u00eb dh\u00ebna.<br \/>\nN\u00eb figur\u00eb paraqitet procesi i shp\u00ebrndarjes s\u00eb nj\u00eb mesazhi p\u00ebr konsumator\u00ebt e regjistruar n\u00eb nj\u00eb tem\u00eb t\u00eb caktuar.<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"Blloqet nd\u00ebrtuese t\u00eb aplikacioneve t\u00eb shp\u00ebrndara. Afrohet e par\u00eb\" src=\"\/wp-content\/uploads\/2019\/04\/e211d5dcfeb5ce8513699eac8e3b6d84.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>Shembujt klasik\u00eb t\u00eb p\u00ebrdorimit t\u00eb k\u00ebtij modeli jan\u00eb shp\u00ebrndarja e gjendjes: bot\u00ebs loj\u00ebra n\u00eb loj\u00ebrat kompjuterike, t\u00eb dh\u00ebnave t\u00eb tregut n\u00eb burs\u00eb, informacioneve t\u00eb dobishme n\u00eb data feeds.<\/p>\n<p><\/p>\n<p>Le t\u00eb shqyrtojm\u00eb kodin e regjistruesit:<\/p>\n<p><\/p>\n<pre><code class=\"erlang\">init(_Args) -&gt;\n  %% abonehemi n\u00eb treguesin, \u00e7el\u00ebsi = key\n  messaging:subscribe(?SUBSCRIPTION, key, tag, self()),\n  {ok, #{}}.\n\nhandle_info(#exchange_die{exchange = ?SUBSCRIPTION}, State) -&gt;\n  %% n\u00ebse pika e tregut nuk \u00ebsht\u00eb e qasshme, provojm\u00eb t\u00eb rishk\u00ebllehemi\n  messaging:subscribe(?SUBSCRIPTION, key, tag, self()),\n  {noreply, State};\n\n%% p\u00ebrpunojm\u00eb mesazhet e ardhura\nhandle_info(#'$msg'{exchange = ?SUBSCRIPTION, message = Msg}, State) -&gt;\n  ?debugVal(Msg),\n  {noreply, State};\n\n%% kur ndalon konsumatori - shk\u00ebputemi nga pika e tregut\nterminate(_Reason, _State) -&gt;\n  messaging:unsubscribe(?SUBSCRIPTION, key, tag, self()),\n  ok.<\/code><\/pre>\n<p><\/p>\n<p>Burimi mund t\u00eb th\u00ebrras\u00eb funksionin e publikimit t\u00eb mesazheve n\u00eb \u00e7do vend t\u00eb p\u00ebrshtatsh\u00ebm:<\/p>\n<p><\/p>\n<pre><code class=\"erlang\">messaging:publish_message(Exchange, Key, Message).<\/code><\/pre>\n<p><\/p>\n<p><em>Exchange<\/em> \u2012 emri i treguesit,<br \/>\n<em>Key<\/em> \u2012 \u00e7el\u00ebsi i ruterit<br \/>\n<em>Mesazh<\/em> \u2012 ngarkesa e dobishme<\/p>\n<p><\/p>\n<h2 id=\"inverted-publish-subscribe\">Inverted Publish-subscribe<\/h2>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"Blloqet nd\u00ebrtuese t\u00eb aplikacioneve t\u00eb shp\u00ebrndara. Afrohet e par\u00eb\" src=\"\/wp-content\/uploads\/2019\/04\/2ef7cd7de459455937bdcfa8a11fd028.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>Duke e rregulluar pub-sub, mund t\u00eb marrim nj\u00eb model t\u00eb p\u00ebrshtatsh\u00ebm p\u00ebr regjistrim. Grupi i burimeve dhe konsumator\u00ebve mund t\u00eb jet\u00eb krejt\u00ebsisht i ndrysh\u00ebm. N\u00eb ilustrim paraqitet rasti me nj\u00eb konsumator dhe shum\u00eb burime.<\/p>\n<p><\/p>\n<h2 id=\"task-distribution-pattern\">Modeli i shp\u00ebrndarjes s\u00eb detyrave<\/h2>\n<p><\/p>\n<p>N\u00eb pothuajse \u00e7do projekt ndodhin detyra t\u00eb p\u00ebrpunimit t\u00eb vonuar, t\u00eb tilla si formimi i raport\u00ebve, d\u00ebrgimi i njoftimeve, marrja e t\u00eb dh\u00ebnave nga sisteme t\u00eb jashtme. Kapaciteti i sistemit q\u00eb ekzekuton k\u00ebto detyra \u00ebsht\u00eb leht\u00ebsisht i shkall\u00ebzuesh\u00ebm duke shtuar p\u00ebrpunues. E gjith\u00eb \u00e7far\u00eb na mbetet \u00ebsht\u00eb t\u00eb formojm\u00eb nj\u00eb grup prej p\u00ebrpunuesish dhe t\u00eb shp\u00ebrndajm\u00eb detyrat midis tyre n\u00eb m\u00ebnyr\u00eb t\u00eb barabart\u00eb.<\/p>\n<p><\/p>\n<p>Le t\u00eb shqyrtojm\u00eb situatat q\u00eb lindin, duke p\u00ebrdorur shembullin e 3 p\u00ebrpunuesve. Q\u00eb n\u00eb faz\u00ebn e shp\u00ebrndarjes s\u00eb detyrave lind pyetja e drejt\u00ebsis\u00eb s\u00eb shp\u00ebrndarjes dhe mbingarkes\u00ebs s\u00eb p\u00ebrpunuesve. Drejt\u00ebsia do t\u00eb p\u00ebrballohet nga shp\u00ebrndarja round-robin, dhe p\u00ebr t\u00eb parandaluar situatat e mbingarkes\u00ebs s\u00eb p\u00ebrpunuesve, do t\u00eb vendosim nj\u00eb kufizim <em>prefetch_limit<\/em>. N\u00eb modet kalimtare <em>prefetch_limit<\/em> nuk do t'i lejoj\u00eb nj\u00eb p\u00ebrpunuesi t\u00eb marr\u00eb t\u00eb gjitha detyrat.<\/p>\n<p><\/p>\n<p>Messaging menaxhon radh\u00ebt dhe prioritetin e p\u00ebrpunimit. P\u00ebrpunuesit marrin detyrat sipas renditjes s\u00eb tyre. Ekzekutimi i nj\u00eb detyre mund t\u00eb p\u00ebrfundoj\u00eb me sukses ose me d\u00ebshtim:<\/p>\n<p><\/p>\n<ul>\n<li><code>messaging:ack(Tack)<\/code> \u2012 thirret n\u00eb rastin e p\u00ebrpunimit t\u00eb suksessh\u00ebm t\u00eb mesazhit<\/li>\n<li><code>messaging:nack(Tack)<\/code> \u2012 thirret n\u00eb t\u00eb gjitha situatat e jashtzakonshme. Pas kthimit t\u00eb detyr\u00ebs, messaging do ta transferoj\u00eb at\u00eb te nj\u00eb trajtues tjet\u00ebr.<\/li>\n<\/ul>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"Blloqet nd\u00ebrtuese t\u00eb aplikacioneve t\u00eb shp\u00ebrndara. Afrohet e par\u00eb\" src=\"\/wp-content\/uploads\/2019\/04\/c2c632b6411247ee8b0dcfb3250a4503.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>Supozoni se gjat\u00eb p\u00ebrpunimit t\u00eb tre detyrave ndodhi nj\u00eb d\u00ebshtim kompleks: trajtuesi 1 ra pas marrjes s\u00eb detyr\u00ebs, pa arritur t\u00eb njoftoj\u00eb ndonj\u00eb informacion te pika e shk\u00ebmbimit. N\u00eb k\u00ebt\u00eb rast, pika e shk\u00ebmbimit, pas skadimit t\u00eb koh\u00ebs s\u00eb ack, do t\u00eb kaloj\u00eb detyr\u00ebn te nj\u00eb trajtues tjet\u00ebr. Trajtuesi 3, p\u00ebr nj\u00eb arsye, refuzoi detyr\u00ebn dhe d\u00ebrgoi nack, p\u00ebrfundimisht detyra kaloi te nj\u00eb trajtues tjet\u00ebr q\u00eb e realizoi me sukses.<\/p>\n<p><\/p>\n<h2 id=\"predvaritelnyy-itog\">Rezultati paraprak<\/h2>\n<p><\/p>\n<p>Ne shqyrtuam komponent\u00ebt baz\u00eb t\u00eb sistemeve t\u00eb shp\u00ebrndara dhe fituam nj\u00eb kuptim t\u00eb baz\u00ebs s\u00eb p\u00ebrdorimit t\u00eb tyre n\u00eb Erlang\/Elixir.<\/p>\n<p><\/p>\n<p>Duke kombinuar modelet baz\u00eb, mund t\u00eb nd\u00ebrtosh paradigmat komplekse p\u00ebr t\u00eb zgjidhur detyrat q\u00eb lindin.<\/p>\n<p><\/p>\n<p>N\u00eb pjes\u00ebn p\u00ebrfundimtare t\u00eb ciklit, do t\u00eb diskutojm\u00eb pyetje t\u00eb zakonshme mbi organizimin e sh\u00ebrbimeve, routing-un dhe balancimin, si dhe do t\u00eb flasim p\u00ebr aspektin praktik t\u00eb shkall\u00ebzueshm\u00ebris\u00eb dhe q\u00ebndrueshm\u00ebris\u00eb s\u00eb sistemeve.<\/p>\n<p><\/p>\n<p>Fundi i pjes\u00ebs s\u00eb dyt\u00eb.<\/p>\n<p><\/p>\n<p>Foto <noindex>Marius Christensen<\/noindex><br \/>\nIlustrimet jan\u00eb p\u00ebrgatitur me ndihm\u00ebn e websequencediagrams.com<\/p>\n<p>Burimi: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/446108\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043f\u043e\u0442\u043e\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0443\u0442\u044f\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 Erlang\/Elixir \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u043e\u0431\u043c\u0435\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043d\u0438\u0445: Request-response Request-Chunked Response Response with Request Publish-subscribe Inverted Publish-subscribe Task distribution SOA, MSA \u0438 \u043e\u0431\u043c\u0435\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 SOA, MSA \u2013 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":22886,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-30908","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043f\u043e\u0442\u043e\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0443\u0442\u044f\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 Erlang\/Elixir \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u043e\u0431\u043c\u0435\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043d\u0438\u0445: Request-response Request-Chunked Response Response with Request Publish-subscribe Inverted Publish-subscribe Task distribution SOA, MSA \u0438 \u043e\u0431\u043c\u0435\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 SOA, MSA \u2013 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/stroitelnye-bloki-raspredelennyh-prilozhenij-pervoe-priblizhenie\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0421\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041f\u0435\u0440\u0432\u043e\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0435 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043f\u043e\u0442\u043e\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0443\u0442\u044f\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 Erlang\/Elixir \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u043e\u0431\u043c\u0435\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043d\u0438\u0445: Request-response Request-Chunked Response Response with Request Publish-subscribe Inverted Publish-subscribe Task distribution SOA, MSA \u0438 \u043e\u0431\u043c\u0435\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 SOA, MSA \u2013 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/stroitelnye-bloki-raspredelennyh-prilozhenij-pervoe-priblizhenie\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T18:38:07+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T18:38:07+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Blloqet nd\u00ebrtuese t\u00eb aplikacioneve t\u00eb shp\u00ebrndara. Nj\u00eb afrim i par\u00eb | ProHoster","description":"N\u00eb artikullin e kaluar, ne shqyrtuam bazat teorike t\u00eb arkitektur\u00ebs reaktive. Tani \u00ebsht\u00eb koha t\u00eb flasim p\u00ebr rrjedhjet e t\u00eb dh\u00ebnave, m\u00ebnyrat e implementimit t\u00eb sistemeve reaktive Erlang\/Elixir dhe modelet e shk\u00ebmbimit t\u00eb mesazheve n\u00eb to: K\u00ebrkes\u00eb- p\u00ebrgjigje K\u00ebrkes\u00eb- pjes\u00eb p\u00ebrgjigje P\u00ebrgjigje me K\u00ebrkes\u00eb Publikim-abonim Publikim-abonim i p\u00ebrmbysur Shp\u00ebrndarja e detyrave SOA, MSA dhe shk\u00ebmbimi i mesazheve SOA, MSA \u2013 arkitektura sistemore q\u00eb p\u00ebrcaktojn\u00eb rregullat e nd\u00ebrtimit t\u00eb sistemeve, nd\u00ebrsa","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/stroitelnye-bloki-raspredelennyh-prilozhenij-pervoe-priblizhenie","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0421\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041f\u0435\u0440\u0432\u043e\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0435 | ProHoster","og:description":"\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043f\u043e\u0442\u043e\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0443\u0442\u044f\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 Erlang\/Elixir \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u043e\u0431\u043c\u0435\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043d\u0438\u0445: Request-response Request-Chunked Response Response with Request Publish-subscribe Inverted Publish-subscribe Task distribution SOA, MSA \u0438 \u043e\u0431\u043c\u0435\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 SOA, MSA \u2013 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a","og:url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/stroitelnye-bloki-raspredelennyh-prilozhenij-pervoe-priblizhenie","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T18:38:07+00:00","article:modified_time":"2019-10-31T18:38:07+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"30908","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-02-22 15:33:36","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 03:27:06","updated":"2026-02-22 15:33:36","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/30908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=30908"}],"version-history":[{"count":1,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/30908\/revisions"}],"predecessor-version":[{"id":162009,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/30908\/revisions\/162009"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media\/22886"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=30908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=30908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=30908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}