![Search icon](https://hackernoon.imgix.net/search-new.png?w=19&h=19)
Mazuva ese, nguva yega yega panguva yebasa redu reinjiniya, tinosangana nematambudziko mazhinji akasiyana ezvakasiyana uye mamiriro atinofanirwa kuita sarudzo kana kuimisa nekuda kwekushaya data. Pese patinovaka masevhisi matsva, kuvaka zvivakwa, kana kunyange kugadzira maitiro ebudiriro, tinobata nyika yakakura yezvinetso zvakasiyana.
Zvakaoma, uye zvichida kunyange hazvibviri, kunyora matambudziko ose. Iwe uchasangana nezvimwe zveizvi nyaya chete kana iwe ukashanda mune chaiyo niche. Kune rimwe divi, kune akawanda atinofanirwa kunzwisisa tese magadzirisiro, sezvo akakosha pakuvaka IT masisitimu. Neine mukana wepamusoro, iwe uchasangana navo mumapurojekiti ese.
Muchinyorwa chino, ini ndichagovera zvakaitika kwandiri nemamwe matambudziko andakasangana nawo ndichigadzira mapurogiramu esoftware.
Kana tikatarisa muWikipedia, tinowana tsanangudzo inotevera
Muchikamu-chakatarisana nekuvandudza software, kuyambuka-kunetsekana kuri maficha echirongwa anobata akati wandei mamodule, pasina mukana wekuvharirwa mune chero iwo. Izvi zvinonetsa kazhinji hazvigone kuoreswa zvakachena kubva kune yese sisitimu mune zvese dhizaini nekuita, uye zvinogona kuguma nekuparadzira (kudzokorodza kwekodhi), kusanganisa (kwakakosha kutsamira pakati pehurongwa), kana zvese zviri zviviri.
Inotsanangura zvakanyanya kuti chii, asi ini ndinoda kuwedzera nekurerutsa zvishoma:
Muchinjikwa-chekunetseka ipfungwa kana chikamu cheiyo system/sangano inobata (kana 'kucheka mhiri') zvimwe zvikamu zvakawanda.
Mienzaniso yakanakisa yezvinetswa zvakadaro ndeyekuvaka system, kutema matanda, chengetedzo, transaction manejimendi, telemetry, dhizaini dhizaini uye kune zvimwe zvakawanda. Tichazotaura pamusoro pevazhinji vavo gare gare muchinyorwa chino.
Padanho rekodhi, zvinonetsa zvekucheka-cheka zvinowanzoitwa uchishandisa matekiniki akaita seAspect -Oriented Programming (AOP) , uko zvinonetsa izvi zvinogadziriswa kuita zvikamu zvakasiyana zvinogona kushandiswa mukati mekushandisa. Izvi zvinoita kuti bhizinesi rirambe rakaparadzaniswa kubva kune izvi zvinonetsa, zvichiita kuti kodhi iverengeke uye inochengeteka.
Kune dzakawanda nzira dzinogoneka dzekuisa zvimiro nekuzvipatsanura neakasiyana zvivakwa senge chiyero, saizi, mashandiro, kukosha, chinangwa, uye zvimwe, asi mune ino chinyorwa, ini ndichashandisa yakapusa scope classification. Neizvi, ndinoreva painongedzerwa chikamu ichi, ingave iyo sangano rese, imwe hurongwa, kana chimwe chinhu cheiyo system.
Saka, ndiri kuzopatsanura zvinhu kuita Macro uye Micro .
NeMacro aspect ndinoreva kunyanya kufunga kwatinoteedzerera sisitimu yese seyakasarudzwa masisitimu edhizaini uye dhizaini yayo (monolithic, microservices, sevhisi-yakatarisana architecture), tekinoroji stack, sangano rehurongwa, nezvimwe. Macro maficha ane hukama zvakanyanya nehurongwa uye hwepamusoro-nhanho. zvisarudzo.
Zvichakadaro, iyo Micro chikamu chiri padyo zvakanyanya neiyo kodhi nhanho uye kusimudzira. Semuyenzaniso, ndeupi hurongwa hunoshandiswa kudyidzana nedhatabhesi, chimiro chepurojekiti yemaforodha nemakirasi, kana kunyange chaiwo magadzirirwo echinhu.
Kunyange zvazvo kupatsanurwa uku kusina kunaka, kunobatsira kugadzira kunzwisisa kwezvingangoitika matambudziko uye kukosha uye kukanganisa kwemhinduro dzatinoshandisa kwavari.
Muchinyorwa ichi, yangu yekutanga kutarisa ichave pane macro maficha.
Pandakangotanga kudzidza nezve magadzirirwo esoftware, ndakaverenga zvinyorwa zvakawanda zvinonakidza nezve mutemo waConway uye nemhedzisiro yawo pakuumbwa kwesangano. Kunyanya iyi . Saka, mutemo uyu unoti
Chero sangano rinogadzira masisitimu (inotsanangurwa zvakafara) rinoburitsa dhizaini ine chimiro chiri kopi yehurongwa hwekutaurirana hwesangano.
Ndagara ndichitenda kuti pfungwa iyi ndeyepasi rose uye inomiririra Mutemo Wekuda.
Ipapo ndakatanga kudzidza Eric Evans's Domain-Driven Dhizaini (DDD) maitiro ekuenzanisira masisitimu. Eric Evans anosimbisa kukosha kwekuzivikanwa kwe Bounded Context. Pfungwa iyi inosanganisira kupatsanura chimiro chedomeine chakaoma kuita zvikamu zvidiki, zvinodzoreka, chimwe nechimwe chine ruzivo rwayo rwakaganhurirwa. Iyi nzira inobatsira mukukurukurirana kwechikwata kunobudirira, sezvo ichideredza kudiwa kweruzivo rwakakura rwedunhu rose uye inoderedza shanduko yemamiriro ezvinhu, nokudaro kuita kuti nhaurirano dzinyanye kushanda. Context switching ndiyo yakaipisisa uye inonyanya kushandisa zviwanikwa. Kunyange makombiyuta ari kunetseka nazvo. Kunyangwe zvisingaite kuwana kusavapo kwakakwana kwekuchinja kwemamiriro ezvinhu, ndinofunga kuti ndizvo zvatinofanira kuedza.
Kudzokera kuMutemo waConway, ndawana nyaya dzinoverengeka nawo.
Nyaya yekutanga yandakasangana nayo neConway's Law, iyo inoratidza kuti dhizaini yedhizaini inoratidzira chimiro chesangano, ndiyo mukana wekugadzira yakaoma uye yakazara Bounded Contexts. Kuoma uku kunomuka kana chimiro chesangano chisina kurongeka nemiganhu yedomeini, zvinotungamira kune Yakasungwa Contexts inodyidzana zvakanyanya uye yakatakura ruzivo. Iyo inotungamira kune inowanzoitika-kuchinja kwechikwata chekusimudzira.
Imwe nyaya ndeyekuti izwi resangano rinodonha kusvika padanho rekodhi. Kana zvimiro zvesangano zvachinja, zvinoda kugadziriswa kwecodebase, zvichidya zviwanikwa zvakakosha.
Saka, kutevera Inverse Conway Maneuver kunobatsira kuvaka sisitimu uye sangano rinokurudzira inodiwa software yekuvaka. Nekudaro, zvakakosha kutaura kuti nzira iyi haizoshanda zvakanaka mukuvaka-kwakatoumbwa uye zvimiro sezvo shanduko padanho rino dzarebesa, asi iri kuita zvakanyanya mukutanga sezvo ivo vanokurumidza kuunza chero shanduko.
Iyi pateni kana "anti-pattern" inotyaira kuvaka sisitimu isina chero dhizaini. Iko hakuna mitemo, hapana miganhu, uye hapana zano rekudzora kusingadzivisike kukura kuoma. Complexity ndiye muvengi anotyisa kwazvo murwendo rwekuvaka software masisitimu.
Kuti tidzivise kugadzira rudzi rwakadaro rwegadziriro, tinofanira kutevera mitemo chaiyo uye zvipingaidzo.
Kune zviuru zvinotsanangurwa zveSoftware Architecture. Ini ndinoda vazhinji vavo nekuti vanobata akasiyana maficha acho. Nekudaro, kuti tikwanise kufunga nezvezvivakwa, isu tinofanirwa kuumba mamwe acho mupfungwa dzedu. Uye zvakakosha kutaura kuti tsananguro iyi inogona kushanduka. Saka, pari zvino, ndine tsananguro inotevera pachangu.
Software Architecture ndeye sarudzo uye sarudzo dzaunoita mazuva ese dzinokanganisa iyo yakavakirwa sisitimu.
Kuita sarudzo dzaunofanirwa kuve nazvo mu "bhegi" misimboti uye mapatani ekugadzirisa matambudziko arikumuka, zvakakoshawo kutaura kuti kunzwisisa zvinodikanwa kwakakosha pakuvaka izvo bhizinesi rinoda. Nekudaro, dzimwe nguva zvinodiwa hazvisi pachena kana kuti hazvina kutsanangurwa, mune iyi nyaya, zviri nani kumirira kuti uwane kujekeswa kana kuvimba neruzivo rwako uye kuvimba neruzivo rwako. Asi zvakadaro, haugone kuita sarudzo nemazvo kana iwe usina misimboti uye mapatani ekuvimba nawo. Ndipo pandiri kuuya kune tsananguro yeSoftware Architecture Style.
Software Architecture Style seti yemisimboti uye mapatani anoratidza maitiro ekuvaka software.
Kune akawanda akasiyana masitaera ekuvaka akatarisana nemativi akasiyana ezvakarongwa zvivakwa, uye kushandisa akawanda acho kamwechete inguva yakajairwa.
Somuenzaniso, zvakadai se:
Monolithic architecture
Domain-driven design
Component-based
Microservices
Pombi nemasefa
Chiitiko-inofambiswa
Microkernel
Sevhisi-yakatarisana
zvichingoenda zvakadaro…
Ehe, ivo vane zvakanakira nekuipira kwavo, asi chinonyanya kukosha chandakadzidza ndechekuti zvivakwa zvinoshanduka zvishoma nezvishoma zvichienderana nematambudziko chaiwo. Kutanga neiyo monolithic architecture isarudzo huru yekudzikisa kuoma kwekushanda, ingangoita iyi dhizaini inokodzera zvaunoda kunyangwe mushure mekusvika Chigadzirwa-musika Fit (PMI) nhanho yekuvaka chigadzirwa. Pachiyero, unogona kufunga kuenda kunzira inofambiswa nechiitiko uye mamicroservices ekuwana yakazvimiririra kutumirwa, heterogeneous tech stack nharaunda, uye kushoma kwakabatana dhizaini (uye kushoma kujeka panguva ino nekuda kwechimiro chechiitiko chinotyairwa uye pub-sub nzira kana izvi zvinogamuchirwa). Kureruka uye kushanda zvakanaka zviri pedyo uye zvine simba guru kune mumwe nemumwe. Kazhinji, zvivakwa zvakaomarara zvinokanganisa kukurumidza kwekusimudzira kwezvinhu zvitsva, kutsigira nekuchengetedza zviripo, uye kupokana nekushanduka kwechisikigo kwehurongwa.
Zvisinei, maitiro akaoma anowanzoda maitiro akaoma uye akazara, izvo zvisingadzivisiki.
Zvakaringana, iyi inyaya yakafara kwazvo, uye kune akawanda mazano makuru ezve magadzirirwo nekuvaka masisitimu ekushanduka kwechisikigo. Zvichienderana neruzivo rwangu, ndakagadzira nzira inotevera:
Izvo zvakakoshawo kuti unzwisise manhamba uye metrics seDAU (Daily Active Users), MAU (Mwedzi Anoshanda Vashandisi), RPC (Chikumbiro Per Sechipiri), uye TPC (Transaction Per Second) nekuti inogona kukubatsira iwe kuita sarudzo nekuti zvivakwa zve 100 vashandisi vanoshanda uye 100 miriyoni vanoshanda vashandisi vakasiyana.
Sechinyorwa chekupedzisira, ndingati zvivakwa zvine chekuita nekubudirira kwechigadzirwa. Zvisizvo zvakagadzirirwa zvivakwa zvezvigadzirwa zvinodikanwa mukuyera, izvo zvingangotungamira mukukundikana sezvo vatengi vasingamirire iwe uchiyera sisitimu, ivo vanosarudza anokwikwidza, saka isu tinofanirwa kunge tiri pamberi pekukwira. Kunyangwe ini ndichibvuma kuti dzimwe nguva haigone kuve yakaonda nzira, iyo pfungwa ndeyekuve ne scalable asi isati yatoyerwa system. Nekune rimwe divi, kuve neyakaomesesa uye yatove yakasimudzwa sisitimu isina vatengi kana zvirongwa zvekuwana vazhinji vavo zvinokubhadhara mari pabhizinesi rako pasina.
Kusarudza tekinoroji stack zvakare iri macro-level sarudzo sezvo ichipesvedzera kuhaya, sisitimu yechisikigo shanduko maonero, scalability, uye system performance.
Iyi ndiyo rondedzero yezvakakosha zvekufunga pakusarudza tekinoroji stack:
Kuve neakawanda tekinoroji stacks kunogona kukanganisa kukura kwebhizinesi?
Kubva pane imwe maonero, kuunza imwe imwe stack kunogona kukwirisa kuhaya kwako, asi kune rimwe divi, zvinounza imwe mari yekugadzirisa sezvo iwe uchida kutsigira ese ari maviri. Saka, sezvandambotaura, mumaonero angu, kungodiwa chete kunofanira kunge kuri nharo yekubatanidza akawanda tekinoroji stacks.
Asi zvakadini nemusimboti wekusarudza chishandiso chakanakisa chedambudziko chairo?
Dzimwe nguva iwe hauna imwe sarudzo kunze kwekuunza zvishandiso zvitsva kugadzirisa rimwe dambudziko zvichienderana nekufunga kwakafanana kwambotaurwa, mumamiriro ezvinhu akadaro, zvine musoro kusarudza mhinduro yakanaka.
Kusikwa kwemasisitimu pasina kubatanidza kwakanyanya kune chaiyo tekinoroji kunogona kuve dambudziko. Zvakadaro, zvinobatsira kurwira mamiriro ekuti sisitimu haina kubatanidzwa zvakasimba kune tekinoroji, uye haife kana mangwana, imwe dhizaini kana chishandiso chikava panjodzi kana kutoderedzwa.
Imwe pfungwa yakakosha ine chekuita nekuvhurika-sosi uye proprietary software kutsamira. Proprietary software inokupa kushomeka kuchinjika uye mukana wekugadzirisa. Zvakadaro, chinhu chine njodzi zvakanyanya ndeye mutengesi kukiya-mukati, kwaunobva watsamira pane zvigadzirwa zvemutengesi, mitengo, mazwi, uye mepu yemugwagwa. Izvi zvinogona kuva nengozi kana mutengesi akachinja nzira, akawedzera mitengo, kana kurega chigadzirwa. Open-source software inoderedza njodzi iyi, sechinhu chimwe chete chisingaidzore. Kubvisa imwe pfungwa yekukundikana pamatanho ese ndiyo kiyi yekuvaka yakavimbika masisitimu ekukura.
Imwe pfungwa yekutadza (SPOF) inoreva chero chikamu chehurongwa icho, kana chikatadza, chichaita kuti sisitimu yese imire kushanda. Kubvisa maSPOF pamatanho ese kwakakosha kune chero system inoda kuwanikwa kwepamusoro. Zvese, kusanganisira ruzivo, vashandi, system components, cloud providers, uye internet cables, zvinogona kukundikana.
Pane akati wandei ekutanga maitiro atingashandise kubvisa imwechete mapoinzi ekutadza:
Muchinyorwa chino, takafukidza akati wandei akakosha maMacro uye kuti tingaite sei nekuoma kwadzo.
Ndinokutendai nekuverenga! Toonana nguva inotevera!