{"id":"6b08bd3380884893657cc94c","slug":"event-sourcing","title":"Event sourcing: zapisuj fakty, a nie tylko ostatni stan","summary":"Stan jako ciąg niezmiennych zdarzeń: strumienie, odtwarzanie przez fold, optymistyczna współbieżność, projekcje, migawki i wersjonowanie zdarzeń. Agregat i magazyn zdarzeń w C# (Marten), TypeScript, Javie, Go i Pythonie.","servedLang":"pl","availableLangs":["pl","en"],"topics":["event-sourcing","cqrs","event-driven-architecture"],"techs":["dotnet","java","typescript","go","python"],"tags":["architecture","event-sourcing","event-store","projections","optimistic-concurrency","marten"],"level":"advanced","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":13,"stats":{"views":3,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:13:55.121Z","updatedAt":"2026-11-27T12:41:13.747Z","requestedLang":"pl","theme":{"hero":"classic","heroMedia":null,"accent":"teal","background":"hex","weaveResources":true,"toc":"right"},"seoDescription":"Event sourcing: zdarzenia jako źródło prawdy, strumień agregatu, rehydratacja, oczekiwana wersja i konflikty, projekcje, snapshoty, upcasting, RODO, przykłady w C#, TypeScript, Java, Go i Python, Marten, KurrentDB, Axon.","wordCount":2406,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"„Gdzie się podziały moje punkty?” – pyta pan Zdzisio, stały klient pierogarni Haliny. W bazie widać tylko "},{"type":"text","text":"balance = 40","marks":[{"type":"code"}]},{"type":"text","text":". Nie wiadomo, czy punkty wygasły, czy ktoś je wymienił, czy był błąd przy zwrocie. "},{"type":"text","text":"Event sourcing","marks":[{"type":"bold"}]},{"type":"text","text":" odpowiada na takie pytania z definicji: zamiast nadpisywać stan, system zapisuje każdą zmianę jako niezmienne "},{"type":"text","text":"zdarzenie","marks":[{"type":"bold"}]},{"type":"text","text":", a stan bieżący oblicza, odtwarzając historię."}]},{"type":"callout","attrs":{"variant":"tip","title":"W skrócie"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Źródłem prawdy jest "},{"type":"text","text":"strumień zdarzeń","marks":[{"type":"bold"}]},{"type":"text","text":" ("},{"type":"text","text":"PointsEarned","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"PointsRedeemed","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"PointsExpired","marks":[{"type":"code"}]},{"type":"text","text":"), a stan to jego "},{"type":"text","text":"fold","marks":[{"type":"bold"}]},{"type":"text","text":" – suma zastosowanych zdarzeń."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Zapis to "},{"type":"text","text":"dopisanie","marks":[{"type":"bold"}]},{"type":"text","text":" zdarzeń z "},{"type":"text","text":"oczekiwaną wersją","marks":[{"type":"bold"}]},{"type":"text","text":" strumienia; równoległe zmiany kończą się kontrolowanym konfliktem."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Odczyty obsługują "},{"type":"text","text":"projekcje","marks":[{"type":"bold"}]},{"type":"text","text":" – dlatego event sourcing prawie zawsze idzie w parze z CQRS."}]}]}]}]},{"type":"stats","attrs":{"items":[{"value":"2005","label":"opis wzorca „Event Sourcing”","hint":"Martin Fowler, kontynuacja katalogu PoEAA"},{"value":"6 mln","label":"zamówień na sekundę w LMAX","hint":"jeden wątek, logika odtwarzana ze zdarzeń (Fowler, 2011)"},{"value":"0","label":"operacji UPDATE i DELETE na zdarzeniach","hint":"magazyn zdarzeń jest tylko do dopisywania"}]}},{"type":"heading","attrs":{"level":2,"id":"kontekst-i-sily"},"content":[{"type":"text","text":"Kontekst i siły"}]},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Audyt i spory","marks":[{"type":"bold"}]},{"type":"text","text":" – program lojalnościowy dotyczy pieniędzy klienta; trzeba umieć pokazać, skąd wziął się każdy punkt."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Pytania o przeszłość","marks":[{"type":"bold"}]},{"type":"text","text":" – „ile punktów miał Zdzisio w Wigilię?” albo „co by było, gdyby promocja trwała dłużej?”."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Nowe widoki z istniejących danych","marks":[{"type":"bold"}]},{"type":"text","text":" – dział marketingu chce raportu, o którym nikt nie myślał przy projektowaniu tabel."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Integracja przez zdarzenia","marks":[{"type":"bold"}]},{"type":"text","text":" – inne moduły i usługi i tak potrzebują informacji o tym, co się wydarzyło."}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"Bankowość i księgowość robią to od wieków: saldo konta to wynik księgowań, a błędu nie wymazuje się gumką, tylko księguje korektę. Martin Fowler opisał wzorzec w 2005 roku, a Greg Young spopularyzował go razem z CQRS i bazą EventStoreDB (dziś KurrentDB)."}]},{"type":"heading","attrs":{"level":2,"id":"struktura"},"content":[{"type":"text","text":"Struktura"}]},{"type":"diagram","attrs":{"kind":"mermaid","code":"flowchart LR\n  cmd[\"Komenda<br/>RedeemReward\"] --> h[\"Handler\"]\n  h -- \"1. wczytaj strumień\" --> es[(\"Magazyn zdarzeń<br/>loyalty-7f3c: v1..v12\")]\n  h -- \"2. fold → stan,<br/>3. decyzja → nowe zdarzenia\" --> agg[\"LoyaltyAccount\"]\n  h -- \"4. dopisz z oczekiwaną wersją 12\" --> es\n  es -- \"subskrypcja\" --> p1[\"Projekcja: saldo klienta\"]\n  es -- \"subskrypcja\" --> p2[\"Projekcja: raport promocji\"]\n  es -- \"subskrypcja\" --> p3[\"Publikacja zdarzeń integracyjnych\"]\n  p1 --> r1[(\"Model odczytu\")]\n  p2 --> r2[(\"Hurtownia danych\")]","caption":"Komenda, strumień zdarzeń i projekcje"}},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Pojęcie"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Znaczenie"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Zdarzenie"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Fakt z przeszłości w czasie przeszłym, niezmienny: "},{"type":"text","text":"PointsRedeemed(reward, 300)","marks":[{"type":"code"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Strumień"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Uporządkowane zdarzenia jednego agregatu, np. "},{"type":"text","text":"loyalty-<id>","marks":[{"type":"code"}]},{"type":"text","text":"; pozycja w nim to wersja"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Rehydratacja"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Odtworzenie stanu przez zastosowanie (fold) wszystkich zdarzeń strumienia"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Oczekiwana wersja"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Warunek przy dopisywaniu: „dopisz, jeśli strumień ma nadal wersję 12” – optymistyczna współbieżność"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Projekcja"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Proces, który czyta zdarzenia i buduje z nich model odczytu; można go odtworzyć od zera"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Migawka (snapshot)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Zapisany stan po N zdarzeniach, żeby nie odtwarzać tysięcy zdarzeń przy każdym odczycie"}]}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"Dobrym sposobem, żeby zobaczyć ideę, jest strumień jednego konta – tak wygląda historia, której brakowało przy pytaniu pana Zdzisia:"}]},{"type":"timeline","attrs":{"items":[{"date":"1 marca","title":"AccountOpened","text":"Zdzisio zakłada konto w aplikacji, saldo 0."},{"date":"3 marca","title":"PointsEarned +85","text":"Zamówienie 20 ruskich i 10 jagodowych."},{"date":"17 marca","title":"PointsEarned +120","text":"Catering na urodziny wnuczki."},{"date":"2 kwietnia","title":"Próba wymiany 300 pkt","text":"Odrzucona przez regułę (saldo 205) – żadne zdarzenie nie powstaje."},{"date":"20 kwietnia","title":"PointsEarned +140","text":"Kolejne zamówienia, saldo 345."},{"date":"21 kwietnia","title":"PointsRedeemed −300","text":"Darmowe 10 ruskich, saldo 45."},{"date":"1 lipca","title":"PointsExpired −5","text":"Wygaśnięcie punktów sprzed roku według regulaminu – saldo 40."}]}},{"type":"heading","attrs":{"level":2,"id":"jak-to-wyglada-w-kodzie"},"content":[{"type":"text","text":"Jak to wygląda w kodzie"}]},{"type":"paragraph","content":[{"type":"text","text":"Agregat ma dwie funkcje: "},{"type":"text","text":"apply/evolve","marks":[{"type":"bold"}]},{"type":"text","text":" (jak zdarzenie zmienia stan) i "},{"type":"text","text":"decide","marks":[{"type":"bold"}]},{"type":"text","text":" (jakie zdarzenia wynikają z komendy w danym stanie). Obie są czyste i testuje się je bez bazy: „mając te zdarzenia, po tej komendzie oczekuję tych zdarzeń”."}]},{"type":"codeGroup","attrs":{"title":"Agregat odtwarzany ze zdarzeń"},"content":[{"type":"codeBlock","attrs":{"language":"csharp","filename":"LoyaltyAccount.cs"},"content":[{"type":"text","text":"// Events are facts in the past tense. They are the source of truth.\npublic abstract record LoyaltyEvent;\npublic sealed record AccountOpened(Guid CustomerId, DateTimeOffset At) : LoyaltyEvent;\npublic sealed record PointsEarned(Guid OrderId, int Points, DateTimeOffset At) : LoyaltyEvent;\npublic sealed record PointsRedeemed(string Reward, int Points, DateTimeOffset At) : LoyaltyEvent;\npublic sealed record PointsExpired(int Points, DateTimeOffset At) : LoyaltyEvent;\n\npublic sealed class LoyaltyAccount\n{\n    public Guid Id { get; private set; }\n    public int Balance { get; private set; }\n    public int Version { get; private set; }               // number of events applied so far\n\n    // State = left fold of all events. No setters, no ORM mapping.\n    public static LoyaltyAccount Rehydrate(Guid id, IEnumerable<LoyaltyEvent> history)\n    {\n        var account = new LoyaltyAccount { Id = id };\n        foreach (var e in history) account.Apply(e);\n        return account;\n    }\n\n    // Decide: check the rules against the current state and return NEW events (nothing is mutated yet).\n    public IReadOnlyList<LoyaltyEvent> Redeem(string reward, int cost, DateTimeOffset now) =>\n        Balance >= cost\n            ? [new PointsRedeemed(reward, cost, now)]\n            : throw new InvalidOperationException($\"Balance {Balance} is lower than {cost}.\");\n\n    public void Apply(LoyaltyEvent e)\n    {\n        Balance = e switch\n        {\n            AccountOpened => 0,\n            PointsEarned x => Balance + x.Points,\n            PointsRedeemed x => Balance - x.Points,\n            PointsExpired x => Balance - x.Points,\n            _ => Balance\n        };\n        Version++;\n    }\n}"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"loyalty-account.ts"},"content":[{"type":"text","text":"// Events are facts in the past tense. They are the source of truth.\nexport type LoyaltyEvent =\n  | { type: \"AccountOpened\"; customerId: string; at: string }\n  | { type: \"PointsEarned\"; orderId: string; points: number; at: string }\n  | { type: \"PointsRedeemed\"; reward: string; points: number; at: string }\n  | { type: \"PointsExpired\"; points: number; at: string };\n\nexport interface LoyaltyState {\n  balance: number;\n  version: number;\n}\n\n// evolve: (state, event) -> state. State is a left fold of the whole stream.\nexport const evolve = (s: LoyaltyState, e: LoyaltyEvent): LoyaltyState => {\n  switch (e.type) {\n    case \"AccountOpened\": return { balance: 0, version: s.version + 1 };\n    case \"PointsEarned\": return { balance: s.balance + e.points, version: s.version + 1 };\n    case \"PointsRedeemed\":\n    case \"PointsExpired\": return { balance: s.balance - e.points, version: s.version + 1 };\n  }\n};\n\nexport const rehydrate = (events: LoyaltyEvent[]): LoyaltyState =>\n  events.reduce(evolve, { balance: 0, version: 0 });\n\n// decide: (command, state) -> new events. Pure function, trivially testable.\nexport function redeem(state: LoyaltyState, reward: string, cost: number, now: Date): LoyaltyEvent[] {\n  if (state.balance < cost) throw new Error(`Balance ${state.balance} is lower than ${cost}`);\n  return [{ type: \"PointsRedeemed\", reward, points: cost, at: now.toISOString() }];\n}"}]},{"type":"codeBlock","attrs":{"language":"java","filename":"LoyaltyAccount.java"},"content":[{"type":"text","text":"public sealed interface LoyaltyEvent permits AccountOpened, PointsEarned, PointsRedeemed, PointsExpired {}\npublic record AccountOpened(UUID customerId, Instant at) implements LoyaltyEvent {}\npublic record PointsEarned(UUID orderId, int points, Instant at) implements LoyaltyEvent {}\npublic record PointsRedeemed(String reward, int points, Instant at) implements LoyaltyEvent {}\npublic record PointsExpired(int points, Instant at) implements LoyaltyEvent {}\n\npublic final class LoyaltyAccount {\n    private int balance;\n    private int version;\n\n    public static LoyaltyAccount rehydrate(List<LoyaltyEvent> history) {\n        var account = new LoyaltyAccount();\n        history.forEach(account::apply);                    // state = fold of events\n        return account;\n    }\n\n    public List<LoyaltyEvent> redeem(String reward, int cost, Instant now) {\n        if (balance < cost) throw new IllegalStateException(\"Balance \" + balance + \" is lower than \" + cost);\n        return List.of(new PointsRedeemed(reward, cost, now)); // decide, don't mutate\n    }\n\n    public void apply(LoyaltyEvent e) {\n        balance = switch (e) {                             // exhaustive thanks to the sealed interface\n            case AccountOpened o -> 0;\n            case PointsEarned p -> balance + p.points();\n            case PointsRedeemed r -> balance - r.points();\n            case PointsExpired x -> balance - x.points();\n        };\n        version++;\n    }\n\n    public int balance() { return balance; }\n    public int version() { return version; }\n}"}]},{"type":"codeBlock","attrs":{"language":"go","filename":"loyalty/account.go"},"content":[{"type":"text","text":"package loyalty\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\n// Event is a fact in the past tense; concrete types below.\ntype Event interface{ isEvent() }\n\ntype AccountOpened struct {\n\tCustomerID string\n\tAt         time.Time\n}\ntype PointsEarned struct {\n\tOrderID string\n\tPoints  int\n\tAt      time.Time\n}\ntype PointsRedeemed struct {\n\tReward string\n\tPoints int\n\tAt     time.Time\n}\n\nfunc (AccountOpened) isEvent()  {}\nfunc (PointsEarned) isEvent()   {}\nfunc (PointsRedeemed) isEvent() {}\n\ntype Account struct {\n\tBalance int\n\tVersion int\n}\n\n// Rehydrate folds the stream into the current state.\nfunc Rehydrate(history []Event) Account {\n\tvar a Account\n\tfor _, e := range history {\n\t\ta.Apply(e)\n\t}\n\treturn a\n}\n\nfunc (a *Account) Apply(e Event) {\n\tswitch ev := e.(type) {\n\tcase AccountOpened:\n\t\ta.Balance = 0\n\tcase PointsEarned:\n\t\ta.Balance += ev.Points\n\tcase PointsRedeemed:\n\t\ta.Balance -= ev.Points\n\t}\n\ta.Version++\n}\n\n// Redeem decides which events should happen; it does not mutate the account.\nfunc (a Account) Redeem(reward string, cost int, now time.Time) ([]Event, error) {\n\tif a.Balance < cost {\n\t\treturn nil, fmt.Errorf(\"balance %d is lower than %d\", a.Balance, cost)\n\t}\n\treturn []Event{PointsRedeemed{Reward: reward, Points: cost, At: now}}, nil\n}"}]},{"type":"codeBlock","attrs":{"language":"python","filename":"loyalty/account.py"},"content":[{"type":"text","text":"from dataclasses import dataclass, replace\nfrom datetime import datetime\nfrom functools import reduce\n\n\n# Events are facts in the past tense. They are the source of truth.\n@dataclass(frozen=True)\nclass AccountOpened:\n    customer_id: str\n    at: datetime\n\n\n@dataclass(frozen=True)\nclass PointsEarned:\n    order_id: str\n    points: int\n    at: datetime\n\n\n@dataclass(frozen=True)\nclass PointsRedeemed:\n    reward: str\n    points: int\n    at: datetime\n\n\n@dataclass(frozen=True)\nclass Account:\n    balance: int = 0\n    version: int = 0\n\n\ndef evolve(state: Account, event) -> Account:\n    match event:\n        case AccountOpened():\n            return Account(balance=0, version=state.version + 1)\n        case PointsEarned(points=p):\n            return replace(state, balance=state.balance + p, version=state.version + 1)\n        case PointsRedeemed(points=p):\n            return replace(state, balance=state.balance - p, version=state.version + 1)\n    return state\n\n\ndef rehydrate(history: list) -> Account:\n    return reduce(evolve, history, Account())\n\n\ndef redeem(state: Account, reward: str, cost: int, now: datetime) -> list:\n    if state.balance < cost:\n        raise ValueError(f\"Balance {state.balance} is lower than {cost}\")\n    return [PointsRedeemed(reward=reward, points=cost, at=now)]"}]}]}]},"toc":[{"id":"kontekst-i-sily","text":"Kontekst i siły","level":2,"locked":false},{"id":"struktura","text":"Struktura","level":2,"locked":false},{"id":"jak-to-wyglada-w-kodzie","text":"Jak to wygląda w kodzie","level":2,"locked":false},{"id":"ewolucja-zdarzen-i-dane-osobowe","text":"Ewolucja zdarzeń i dane osobowe","level":2,"locked":true},{"id":"kompromisy","text":"Kompromisy","level":2,"locked":true},{"id":"sciezka-wdrozenia","text":"Ścieżka wdrożenia","level":2,"locked":true},{"id":"w-praktyce","text":"W praktyce","level":2,"locked":true},{"id":"antywzorce","text":"Antywzorce","level":2,"locked":true},{"id":"powiazane-tematy","text":"Powiązane tematy","level":2,"locked":true},{"id":"sprawdz-sie","text":"Sprawdź się","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":36,"visibleBlocks":14,"resources":[{"id":"6b0857bf3c96f2d34d0b423b","type":"article","provider":"web","url":"https://microservices.io/patterns/data/event-sourcing.html","embedUrl":null,"title":"Microservices Pattern: Pattern: Event sourcing","description":"Use event sourcing, which persists aggregates as a sequence of domain events","author":"Chris Richardson (microservices.io)","thumbnailUrl":null,"durationSec":null,"lang":"en","topics":["event-sourcing","microservices"],"techs":["general"],"tags":["software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":70,"verifiedAt":"2026-11-26T11:25:54.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857b23c96f2d34d0b355e","type":"repo","provider":"github","url":"https://github.com/oskardudycz/EventSourcing.NetCore","embedUrl":null,"title":"oskardudycz/EventSourcing.NetCore","description":"Examples and Tutorials of Event Sourcing in .NET","author":"oskardudycz","thumbnailUrl":"https://opengraph.githubassets.com/1/oskardudycz/EventSourcing.NetCore","durationSec":null,"lang":"en","topics":["cqrs","event-sourcing"],"techs":["dotnet"],"tags":["cqrs","dotnet-core","event-sourcing","example","hacktoberfest","marten","mediatr","netcore","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2017-01-28T11:21:53.000Z","popularity":69,"verifiedAt":"2026-11-26T10:58:21.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:50.215Z","updatedAt":"2026-11-26T16:00:50.215Z"},{"id":"6b0857a53c96f2d34d0b3216","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=JHGkaShoyNs","embedUrl":"https://www.youtube-nocookie.com/embed/JHGkaShoyNs","title":"Greg Young - CQRS and Event Sourcing - Code on the Beach 2014","description":"","author":"Code on the Beach","thumbnailUrl":"https://i.ytimg.com/vi/JHGkaShoyNs/hqdefault.jpg","durationSec":null,"lang":"en","topics":["cqrs","event-sourcing"],"techs":["general"],"tags":[],"price":"free","featured":true,"featuredOrder":12,"packageName":null,"source":"seed","publishedAt":null,"popularity":0,"verifiedAt":"2026-11-26T00:00:00.000Z","curated":true,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:37.067Z","updatedAt":"2026-11-26T16:00:37.067Z"},{"id":"6b0857b23c96f2d34d0b3570","type":"repo","provider":"github","url":"https://github.com/JasperFx/marten","embedUrl":null,"title":"JasperFx/marten","description":".NET Transactional Document DB and Event Store on PostgreSQL","author":"JasperFx","thumbnailUrl":"https://opengraph.githubassets.com/1/JasperFx/marten","durationSec":null,"lang":"en","topics":["event-sourcing"],"techs":["dotnet"],"tags":["document-database","documentdb","dotnet","event-sourcing","eventsourcing","marten","databases","plv8","postgres","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2015-10-12T18:11:12.000Z","popularity":68,"verifiedAt":"2026-11-26T10:58:21.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:50.215Z","updatedAt":"2026-11-26T16:00:50.215Z"},{"id":"6b0857b73c96f2d34d0b3beb","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/us/podcast/wprowadzenie-do-event-sourcing-z-oskarem-dudyczem/id1477067604?i=1000607816170","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id1477067604?i=1000607816170","title":"Wprowadzenie do Event Sourcing z Oskarem Dudyczem","description":"Sprawdź Patoszkolenia! ➡️ 04.06.2024 Architektura 101 ➡️ 18.06.2024 Observability Tym razem nasz gość specjalny, Oskar Dudycz, przybliży nam temat event sourcingu! Słuchasz Patoarchitektów dzięki Protopii. Sprawdź, jak Patoarchitekci i Protopia mogą Ci pomóc ➡️ protopia.tech Nasze sociale i linki…","author":"Patoarchitekci","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts221/v4/d7/43/6e/d7436e6d-b51c-6ba8-69ba-56c43c62978d/mza_16348210063467326394.jpg/600x600bb.jpg","durationSec":2803,"lang":"pl","topics":["event-sourcing"],"techs":["general"],"tags":["podcast","observability","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2023-04-07T06:00:02.000Z","popularity":69,"verifiedAt":"2026-11-26T10:58:53.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:53.924Z","updatedAt":"2026-11-26T16:00:53.924Z"},{"id":"6b0857be3c96f2d34d0b4222","type":"article","provider":"web","url":"https://martinfowler.com/articles/lmax.html","embedUrl":null,"title":"The LMAX Architecture","description":"LMAX is a retail financial trading system that can handle that can 6 million orders per second on a single JVM thread. The business logic runs in-memory surrounded by disruptors using event sourcing.","author":"Martin Fowler","thumbnailUrl":"https://martinfowler.com/articles/images/lmax/arch-full.png","durationSec":null,"lang":"en","topics":["event-sourcing"],"techs":["java"],"tags":["martin-fowler","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":75,"verifiedAt":"2026-11-26T11:07:26.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"}],"challenges":[{"id":"6b093dc191bd8fbaf2a0c8d0","slug":"inventory-cqrs","title":"Magazyn z CQRS – osobny model zapisu i odczytu","summary":"Komendy magazynowe walidowane na własnym modelu zapisu, zdarzenia na szynie i projekcja budująca model odczytu z raportem niskich stanów. Model odczytu da się odtworzyć z samych zdarzeń.","servedLang":"pl","availableLangs":["pl","en"],"kind":"code","category":"architecture","status":"published","difficulty":"medium","topics":["cqrs","event-driven-architecture"],"techs":["typescript","javascript","python","dotnet","java","go"],"tags":["cqrs","read-model","projection","events","inventory"],"languages":["typescript","javascript","python","csharp","java","go"],"questionCount":null,"xp":20,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:25.519Z"},{"id":"6b093dc091bd8fbaf2a0c8c0","slug":"event-sourced-account","title":"Konto bankowe w event sourcingu","summary":"Agregat konta, którego stan powstaje wyłącznie z odtwarzania zdarzeń, magazyn zdarzeń z optymistyczną współbieżnością i repozytorium zapisujące tylko nowe fakty. Zapytania o stan z przeszłości w gratisie.","servedLang":"pl","availableLangs":["pl","en"],"kind":"code","category":"architecture","status":"published","difficulty":"hard","topics":["event-sourcing","cqrs"],"techs":["typescript","javascript","python","dotnet","java","go"],"tags":["event-sourcing","aggregate","event-store","optimistic-concurrency","ddd"],"languages":["typescript","javascript","python","csharp","java","go"],"questionCount":null,"xp":40,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:24.935Z"}],"attachments":[],"hasCode":true,"repoUrl":null,"series":[{"slug":"architecture-path","title":"Od monolitu do mikroserwisów","items":[{"slug":"monolith","title":"Monolit: jedna aplikacja, jedno wdrożenie i dlaczego to często dobry start","current":false},{"slug":"modular-monolith","title":"Modularny monolit: twarde granice bez kosztów sieci","current":false},{"slug":"layered-architecture","title":"Architektura warstwowa: prezentacja, logika, dane – i gdzie to się psuje","current":false},{"slug":"hexagonal-architecture","title":"Pierogi w Heksagonie","current":false},{"slug":"clean-architecture","title":"Czysta architektura: reguła zależności i przypadki użycia w centrum","current":false},{"slug":"onion-architecture","title":"Architektura cebulowa: model domeny w środku, infrastruktura na zewnątrz","current":false},{"slug":"vertical-slice-architecture","title":"Architektura pionowych wycinków: kod według funkcji, nie według warstw","current":false},{"slug":"cqrs","title":"CQRS: osobny model do zmieniania, osobny do czytania","current":false},{"slug":"event-sourcing","title":"Event sourcing: zapisuj fakty, a nie tylko ostatni stan","current":true},{"slug":"event-driven-architecture","title":"Architektura sterowana zdarzeniami: kto publikuje, kto słucha i co może pójść nie tak","current":false},{"slug":"microservices","title":"Mikroserwisy: niezależne wdrożenia, prawdziwe koszty i kiedy to się opłaca","current":false},{"slug":"ddd-strategic-design","title":"DDD – projektowanie strategiczne: poddomeny, konteksty ograniczone i mapy kontekstów","current":false}]}],"prev":{"slug":"cqrs","title":"CQRS: osobny model do zmieniania, osobny do czytania"},"next":{"slug":"event-driven-architecture","title":"Architektura sterowana zdarzeniami: kto publikuje, kto słucha i co może pójść nie tak"},"featured":false,"authorCard":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","headline":"Wzorce projektowe · Architektura · AI i LLM","community":false,"reputation":{"points":3900,"level":{"key":"mentor","label":"Mentor"}},"articles":68,"skills":[{"key":"typescript","title":"TypeScript","level":5,"levelLabel":"Autorytet","articles":63},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Autorytet","articles":53},{"key":"python","title":"Python","level":5,"levelLabel":"Autorytet","articles":52},{"key":"java","title":"Java","level":5,"levelLabel":"Autorytet","articles":38}]}}