Arkitektura & Design Patterns

Saga pattern

Në shqip: Modeli saga

ShpjegimiSQ

Në mikroshërbime s'ka një transaksion të vetëm mbi shumë databaza. Saga e ndan veprimin në hapa (rezervo → paguaj → dërgo), dhe po dështon një hap, ekzekuton „veprime kompensuese“ (anulo rezervimin, kthe paratë).

EnglishEN

In microservices there's no single transaction across many databases. A saga splits the operation into steps (reserve → pay → ship), and if a step fails, runs “compensating actions” (cancel the reservation, refund).

Si ta mendosh

Si planifikimi i një udhëtimi: po anulohet fluturimi, anulon edhe hotelin.

Lexoje në anglisht

Like planning a trip: if the flight is cancelled, you cancel the hotel too.

Terma të lidhur