![Search icon](https://hackernoon.imgix.net/search-new.png?w=19&h=19)
Kwihangana muri software bivuga ubushobozi bwa porogaramu kugirango ikomeze gukora neza kandi yizewe, kabone niyo haba hari ibibazo bitunguranye cyangwa gutsindwa. Muri Fintech imishinga kwihangana bifite akamaro kanini cyane kubera impamvu nyinshi. Ubwa mbere, amasosiyete ategetswe kubahiriza ibisabwa nubuyobozi kandi abashinzwe imari bashimangira imbaraga zo gukomeza kubungabunga umutekano muri sisitemu. Byongeye kandi, ikwirakwizwa ryibikoresho bya digitale no kwishingikiriza kubatanga serivisi zindi zitanga ubucuruzi bwa Fintech kugirango umutekano uhungabanye. Kwihangana bifasha kandi kugabanya ingaruka ziterwa n’umuriro uterwa nimpamvu zitandukanye nko gutera ubwoba kuri interineti, ibyorezo by’ibyorezo, cyangwa ibintu bya geopolitiki, kurinda ibikorwa by’ubucuruzi n’umutungo ukomeye.
Muburyo bwo kwihangana, twumva urutonde rwibikorwa byiza ningamba zagenewe kwemeza ko software ishobora kwihanganira ihungabana no gukomeza ibikorwa byayo. Ubu buryo bukora nkurushundura rwumutekano, rutanga uburyo bwo gukemura amakosa, gucunga imitwaro, no gukira kunanirwa, bityo bigatuma porogaramu zikomeza gukomera kandi ziringirwa mubihe bibi.
Ingamba zisanzwe zo kwihangana zirimo bulkhead, cache, gusubira inyuma, kongera kugerageza, hamwe no kumena inzitizi. Muri iki kiganiro, nzabiganiraho muburyo burambuye, hamwe nurugero rwibibazo bashobora gufasha kubikemura.
Reka turebere hamwe ibice byavuzwe haruguru. Dufite porogaramu isanzwe cyane hamwe ninyuma zinyuma inyuma kugirango tubone amakuru amwe. Hano hari abakiriya benshi ba HTTP bahujwe ninyuma. Biragaragara ko bose basangiye pisine imwe! Kandi nibindi bikoresho nka CPU na RAM.
Bizagenda bite, Niba umwe mubari inyuma bahuye nibibazo bimwe na bimwe bivamo gutinda cyane? Bitewe nigihe kinini cyo gusubiza, pisine yose ihuza izaba yuzuye kubisabwa gutegereza ibisubizo bivuye inyuma1. Nkigisubizo, ibyifuzo bigenewe umugongo muzima2 na backend3 ntibishobora gukomeza kuko pisine yarashize. Ibi bivuze ko kunanirwa murimwe inyuma yacu bishobora gutera kunanirwa murwego rwose. Byiza, turashaka gusa imikorere ijyanye no kunanirwa inyuma kugirango tubone kwangirika, mugihe ibindi bisigaye bikomeza gukora mubisanzwe.
Icyitegererezo cya Bulkhead ni iki?
Ijambo, Bulkhead ishusho, rikomoka mubwubatsi, bikubiyemo gukora ibice byinshi byitaruye mubwato. Niba kumeneka bibaye mugice kimwe, cyuzura amazi, ariko ibindi bice bikomeza kutagira ingaruka. Uku kwigunga kubuza ubwato bwose kurohama kubera kutubahiriza kimwe.
Igishushanyo cya Bulkhead kirashobora gukoreshwa mugutandukanya ubwoko butandukanye bwibikoresho muri porogaramu, bikarinda kunanirwa mugice kimwe kutagira ingaruka kuri sisitemu yose. Dore uko dushobora kubishyira mubibazo byacu:
Reka tuvuge ko sisitemu yinyuma yacu ifite amahirwe make yo guhura namakosa kugiti cye. Ariko, mugihe igikorwa kirimo kubaza inyuma yinyuma zose, buriwese arashobora kwigenga kugarura ikosa. Kuberako aya makosa abaho yigenga, muri rusange amahirwe yikosa muri porogaramu yacu ararenze ikosa rishobora kuba ryinyuma imwe. Ikosa ryuzuye rishobora kubarwa ukoresheje formula P_total = 1− (1 - p) ^ n, aho n numubare wa sisitemu yinyuma.
Kurugero, niba dufite inyuma yinyuma, buriwese ufite ikosa rishobora kuba p = 0.001 (bihuye na SLA ya 99.9%), ibisubizo bivamo amakosa ni:
P_total = 1− (1−0.001) ^ 10 = 0.009955
Ibi bivuze ko SLA duhujwe igabanuka kugera kuri 99%, byerekana uburyo ubwizerwe muri rusange bugabanuka mugihe ubajije imigongo myinshi murwego rumwe. Kugira ngo iki kibazo kigabanuke, turashobora gushyira mubikorwa in-kwibuka.
Ubwihisho bwibikoresho bukora nkibintu byihuta byamakuru byihuta, kubika amakuru yinjira kenshi kandi bikuraho gukenera kuyakura mubishobora gutinda buri gihe. Kubera ko cashe zibitswe murwibutso zifite amahirwe 0% yamakosa ugereranije no kuzana amakuru kurubuga, byongera cyane kwizerwa kwa porogaramu yacu. Byongeye kandi, cishing igabanya traffic traffic, irusheho kugabanya amahirwe yamakosa. Kubwibyo, dukoresheje cache-yibuka, turashobora kugera ku kigero cyo hasi cyamakosa muri porogaramu yacu ugereranije na sisitemu yinyuma. Ikigeretse kuri ibyo, muri cache yibuka itanga amakuru yihuse kuruta gushakisha imiyoboro ishingiye kumurongo, bityo bikagabanya ubukererwe bwa porogaramu - inyungu igaragara.
Kumakuru yihariye, nkumwirondoro wabakoresha cyangwa ibyifuzo, ukoresheje in-cache cache nayo irashobora kuba nziza cyane. Ariko dukeneye kwemeza ibyifuzo byose byumukoresha uhora ujya murwego rumwe rwo gusaba gukoresha amakuru yabitswe kuri bo, bisaba amasomo akomeye. Gushyira mubikorwa amasomo akomeye birashobora kugorana, ariko kubwiki gihe, ntidukeneye uburyo bukomeye. Kuringaniza ibinyabiziga bito biremewe, kubwibyo umutwaro uhamye uringaniza algorithm nko guhora uhoraho bizaba bihagije.
Niki kirenzeho, mugihe habaye kunanirwa kwi node, guhubuka guhoraho byemeza ko gusa abakoresha bafitanye isano na node yananiwe guhinduka, bikagabanya guhungabana kuri sisitemu. Ubu buryo bworoshya imiyoborere ya cache yihariye kandi ikazamura muri rusange gutuza no gukora mubikorwa byacu.
Niba amakuru dushaka kubika ari ingenzi kandi agakoreshwa mubisabwa byose sisitemu ikora, nka politiki yo kwinjira, gahunda yo kwiyandikisha, cyangwa izindi nzego zingenzi muri domaine yacu - inkomoko yaya makuru irashobora gutera ingingo ikomeye yo kunanirwa muri sisitemu. Kugira ngo iki kibazo gikemuke, inzira imwe ni ukwigana byimazeyo aya makuru muburyo bwo kwibuka kwa porogaramu.
Muri iki gihe, niba ingano yamakuru yatanzwe mu isoko ashobora gucungwa, turashobora gutangiza inzira mugukuramo ifoto yerekana aya makuru mugitangira gusaba. Ibikurikira, turashobora kwakira ibyagezweho kugirango tumenye neza ko amakuru yihishe akomeza guhuzwa ninkomoko. Mugukoresha ubu buryo, tuzamura ubwizerwe bwo kubona aya makuru yingenzi, nkuko buri kugarura bibaho biturutse kumutwe hamwe nibibazo 0% bishoboka. Byongeye kandi, gukura amakuru mububiko byihuta cyane, bityo ugahindura imikorere ya progaramu yacu. Izi ngamba zigabanya neza ingaruka zijyanye no kwishingikiriza kumasoko yo hanze, bigatuma habaho amakuru yizewe kandi yizewe kumakuru yingenzi kubikorwa byacu.
Ariko, gukenera gukuramo amakuru kubyerekeranye no gutangira gusaba, bityo bigatinda inzira yo gutangira, binyuranyije nimwe mumahame ya '12 -ibikorwa bifatika 'byunganira gutangira byihuse. Ariko, ntidushaka gutakaza inyungu zo gukoresha cishing. Kugira ngo iki kibazo gikemuke, reka dushakishe ibisubizo bishoboka.
Gutangira byihuse ni ngombwa, cyane cyane kuri platform nka Kubernetes, zishingiye ku kwimuka byihuse kwimuka kumubiri utandukanye. Kubwamahirwe, Kubernetes irashobora kuyobora buhoro-gutangira porogaramu ukoresheje ibintu nka startup probe.
Indi mbogamizi dushobora guhura nazo ni uguhindura iboneza mugihe porogaramu ikora. Akenshi, guhindura cache ibihe cyangwa gusaba igihe cyateganijwe birakenewe kugirango ibibazo bikemuke. Nubwo dushobora kwihutira kohereza dosiye iboneza ivugururwa mubisabwa, gukoresha izi mpinduka mubisanzwe bisaba gutangira. Hamwe na buri porogaramu yongerewe igihe cyo gutangira, gutangira gutangira birashobora gutinza cyane kohereza ibyakosowe kubakoresha.
Kugira ngo iki kibazo gikemuke, igisubizo kimwe ni ukubika ibishushanyo muburyo buhinduka kandi bikagira umurongo winyuma ukajya ubisubiramo. Nyamara, ibipimo bimwe na bimwe, nka HTTP isaba igihe cyateganijwe, birashobora gusaba gutangira HTTP cyangwa abakiriya ba data base mugihe iboneza bihuye bihinduka, bigatera ikibazo. Nyamara, abakiriya bamwe, nkumushoferi wa Cassandra kuri Java, bashyigikira gusubiramo byikora byimiterere, koroshya iki gikorwa.
Gushyira mubikorwa ibishushanyo bisubirwamo birashobora kugabanya ingaruka mbi zigihe kirekire cyo gutangira no gutanga inyungu zinyongera, nko koroshya ibiranga gushyira mubikorwa. Ubu buryo budushoboza gukomeza kwizerwa no kwishura mugihe dukoresha neza ivugurura ryiboneza.
Noneho reka turebe ikindi kibazo: muri sisitemu yacu, mugihe icyifuzo cyumukoresha cyakiriwe kandi kigatunganywa no kohereza ikibazo kuri backend cyangwa data base, rimwe na rimwe, igisubizo cyamakosa cyakiriwe aho kuba amakuru ateganijwe. Ibikurikira, sisitemu yacu isubiza uyikoresha hamwe n '' ikosa '.
Ariko, mubihe byinshi, birashobora kuba byiza cyane kwerekana amakuru yataye igihe hamwe nubutumwa bwerekana ko hari gutinda kwa data gutinda, aho gusiga umukoresha ubutumwa bunini butukura.
Kugira ngo iki kibazo gikemuke kandi tunoze imyitwarire ya sisitemu, turashobora gushyira mubikorwa uburyo bwo gusubira inyuma. Igitekerezo kiri inyuma yiki gishushanyo kirimo kugira amakuru yinyongera yamakuru, ashobora kuba arimo amakuru yubwiza buke cyangwa bushya ugereranije nisoko yambere. Niba amakuru yambere yibanze ataboneka cyangwa agasubiza ikosa, sisitemu irashobora gusubira inyuma kugirango ikure amakuru muriyi soko ya kabiri, ikemeza ko uburyo bumwe bwamakuru bwerekanwa kubakoresha aho kwerekana ubutumwa bwamakosa.
Niba urebye ku ishusho hejuru, uzabona isano iri hagati yikibazo duhura nacyo nubu twahuye nurugero rwa cache.
Kugira ngo tubikemure, dushobora gutekereza gushyira mubikorwa bizwi nka retry. Aho kwishingikiriza kuri cashe, sisitemu irashobora gushirwaho kugirango ihite yohereza ibyifuzo mugihe habaye ikosa. Ubu buryo bwo gusubiramo butanga ubundi buryo bworoshye kandi burashobora kugabanya neza amahirwe yo kwibeshya mubyo dusaba. Bitandukanye na cishing, akenshi bisaba uburyo bworoshye bwo gutesha agaciro uburyo bwo gukemura amakuru, kugerageza ibyifuzo byananiranye biroroshye kubishyira mubikorwa. Nkuko cache itesha agaciro ifatwa nkimwe mubikorwa bitoroshye mubuhanga bwa software, gufata ingamba zo kugerageza birashobora koroshya gukemura amakosa no kunoza sisitemu.
Ariko, gufata ingamba zo kongera gusuzuma utabanje gusuzuma ingaruka zishobora gutera izindi ngorane.
Reka tekereza imwe mumugongo yacu yiboneye kunanirwa. Mu bihe nk'ibi, gutangira gusubiramo inyuma byananiranye bishobora kuvamo kwiyongera cyane mubunini bwumuhanda. Uku kwiyongera gutunguranye kwimodoka gushobora kurenga inyuma, byongera kunanirwa kandi birashobora gutera ingaruka za casade muri sisitemu.
Kugira ngo uhangane n'iki kibazo, ni ngombwa kuzuza uburyo bwo gusubiramo uburyo bwo kumena ibizunguruka. Inzira yamashanyarazi ikora nkuburyo bwo kurinda ikurikirana igipimo cyamakosa ya serivisi zo hasi. Iyo igipimo cyamakosa kirenze igipimo cyateganijwe mbere, icyuma cyumuzunguruko gihagarika ibyifuzo kuri serivisi yibasiwe nigihe cyagenwe. Muri iki gihe, sisitemu yirinda kohereza ibyifuzo byinyongera kugirango igihe cya serivisi cyananiranye gikire. Nyuma yigihe cyagenwe, icyuma cyumuzunguruko cyitondewe cyemerera umubare muto wibisabwa kunyuramo, ukareba niba serivisi ihagaze neza. Niba serivisi yarakize, traffic isanzwe isubizwa buhoro buhoro; bitabaye ibyo, umuzenguruko ukomeza gufungura, gukomeza guhagarika ibyifuzo kugeza serivisi isubukuye imikorere isanzwe. Muguhuza ibizunguruka byumuzingi hamwe na retry logic, turashobora gucunga neza ibibazo byamakosa no gukumira sisitemu irenze mugihe cyananiranye.
Mu gusoza, mugushira mubikorwa ubu buryo bwo kwihangana, turashobora gushimangira ibyifuzo byacu kurwanya ibyihutirwa, gukomeza kuboneka cyane, no gutanga ubunararibonye kubakoresha. Byongeye kandi, ndashaka gushimangira ko telemetrie ari ikindi gikoresho kitagomba kwirengagizwa mugihe utanga umushinga. Ibiti byiza na metrics birashobora kuzamura cyane ireme rya serivisi kandi bigatanga ubushishozi mubikorwa byabo, bifasha gufata ibyemezo byuzuye kugirango bitezimbere kurushaho.