{"id":"6b09ab669843bccb708a3cb3","slug":"poc-guide","title":"PoC, spike, prototyp, MVP – jak zaplanować i przeprowadzić PoC (z działającym przykładem)","summary":"Czym różnią się spike, PoC, prototyp, MVP i pilotaż, kiedy PoC naprawdę jest potrzebny i jak go poprowadzić: hipoteza, mierzalne kryteria sukcesu, timebox, cięcie zakresu, plan, raport i decyzja go/no-go zapisana w ADR. Na przykładzie platformy ładowania aut elektrycznych VoltGo: czy brama OCPP w Node.js z Kafką przyjmie telemetrię z 10 000 ładowarek przy p95 < 300 ms? Kod bramy i konsumenta w TypeScript, skrypt k6, przykładowe wyniki, szablony planu i raportu do pobrania oraz pułapka „PoC trafia na produkcję”.","servedLang":"pl","availableLangs":["pl","en"],"topics":["solution-architecture","event-driven-architecture","aws-scalability","nodejs-runtime"],"techs":["typescript","node","general"],"tags":["solution-architect","proof-of-concept","spike","prototype","mvp","k6","load-testing","kafka","ocpp","ev-charging"],"level":"intermediate","kind":"tutorial","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":29,"stats":{"views":2,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-27T16:10:14.785Z","updatedAt":"2026-11-27T16:14:12.340Z","requestedLang":"pl","theme":{"hero":"classic","heroMedia":null,"accent":"teal","background":"hex","weaveResources":true,"toc":"right"},"seoDescription":"Jak zaplanować i przeprowadzić PoC (proof of concept): różnice PoC, spike, prototyp, MVP, pilotaż; hipoteza i kryteria sukcesu, timebox, plan PoC, raport i decyzja go/no-go w ADR. Przykład: test obciążeniowy k6 bramy OCPP (Node.js, TypeScript, Kafka) dla 10 000 ładowarek EV, szablony do pobrania.","wordCount":5640,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"„Zróbmy PoC” to jedno z najczęściej wypowiadanych i najrzadziej dobrze wykonanych zdań w projektach IT. Czasem kończy się tygodniem zabawy nową technologią bez żadnej decyzji, czasem – co gorsze – kodem, który „tymczasowo” trafia na produkcję i zostaje tam na lata. Dobry "},{"type":"text","text":"PoC","marks":[{"type":"bold"}]},{"type":"text","text":" ("},{"type":"text","text":"proof of concept","marks":[{"type":"italic"}]},{"type":"text","text":") to eksperyment z hipotezą, progami i datą decyzji. W tym poradniku zaplanujemy i przeprowadzimy taki PoC dla platformy ładowania aut elektrycznych "},{"type":"text","text":"VoltGo","marks":[{"type":"bold"}]},{"type":"text","text":" – od pytania po ADR – z kodem, który możesz uruchomić."}]},{"type":"callout","attrs":{"variant":"tip","title":"W skrócie"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"PoC odpowiada na "},{"type":"text","text":"jedno pytanie techniczne","marks":[{"type":"bold"}]},{"type":"text","text":", od którego zależy architektura: „czy to zadziała w naszych warunkach?”. Spike pyta „jak to zrobić?”, prototyp – „czy użytkownik to zechce?”, MVP – „czy rynek za to zapłaci?”."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Przed pierwszą linią kodu masz "},{"type":"text","text":"hipotezę, mierzalne kryteria go/no-go, timebox, zakres i decydenta","marks":[{"type":"bold"}]},{"type":"text","text":" z datą decyzji. Bez tego wynik zawsze brzmi „w zasadzie działa”."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Kod PoC się "},{"type":"text","text":"wyrzuca","marks":[{"type":"bold"}]},{"type":"text","text":". Zostają liczby, wnioski i warunki – w raporcie, w ADR i w wymaganiach do LLD."}]}]}]}]},{"type":"stats","attrs":{"items":[{"value":"10 000","label":"symulowanych ładowarek","hint":"4 generatory k6"},{"value":"1 000 msg/s","label":"telemetrii w stanie ustalonym","hint":"szczyt 3 000 msg/s"},{"value":"p95 < 300 ms","label":"próg opóźnienia","hint":"brama → stan na żywo"},{"value":"10 dni","label":"timebox PoC-01","hint":"2 osoby, decyzja 24.11"}]}},{"type":"callout","attrs":{"variant":"info","title":"Kontekst: HLD VoltGo"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Ten artykuł kontynuuje "},{"type":"text","text":"Kompletny HLD na przykładzie VoltGo","marks":[{"type":"link","attrs":{"href":"/pl/articles/hld-complete-example"}}]},{"type":"text","text":". W skrócie: VoltGo buduje własną platformę dla 4 000 punktów ładowania (10 000 w 2029 r.). Decyzja o własnej platformie (ADR-0001) jest "},{"type":"text","text":"warunkowa","marks":[{"type":"bold"}]},{"type":"text","text":": zależy od tego, czy brama OCPP w Node.js, publikująca telemetrię do Kafki, udźwignie skalę i opóźnienia z NFR. To pytanie dla PoC-01."}]}]},{"type":"heading","attrs":{"level":2,"id":"poc-spike-prototyp-mvp-pilotaz-czym-sie-roznia"},"content":[{"type":"text","text":"PoC, spike, prototyp, MVP, pilotaż – czym się różnią"}]},{"type":"paragraph","content":[{"type":"text","text":"Te słowa bywają używane zamiennie, a to proszenie się o kłopoty: zespół myśli, że robi szybki eksperyment, a biznes – że dostanie pierwszą wersję produktu. Różnicę najlepiej widać po "},{"type":"text","text":"pytaniu","marks":[{"type":"bold"}]},{"type":"text","text":", na które dana forma odpowiada:"}]},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph"}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Spike"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"PoC"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Prototyp"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"MVP"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Pilotaż"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Pytanie"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"jak to zrobić? ile to zajmie?"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"czy to zadziała technicznie w naszych warunkach?"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"czy użytkownik to zrozumie i zechce?"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"czy produkt daje wartość na rynku?"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"czy działa u prawdziwych klientów w małej skali?"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Odbiorca"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"zespół"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"architekt, decydenci techniczni"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"użytkownicy, PO, UX"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"rynek, biznes"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"wybrani klienci, operacje"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Czas"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"godziny – kilka dni"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"1–3 tygodnie"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"dni – tygodnie"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"miesiące"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"tygodnie – miesiące"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Kod po zakończeniu"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"wyrzucany"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"wyrzucany, zostaje wiedza"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"wyrzucany albo makieta"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"produkcyjny"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"produkcyjny"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Miara sukcesu"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"odpowiedź + szacunek"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"spełnione kryteria go/no-go"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"wyniki testów z użytkownikami"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"metryki produktowe"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"KPI pilotażu, stabilność"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"W VoltGo"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"jak zbudować rejestr połączeń w Redis?"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"czy brama + Kafka przyjmie telemetrię z 10 000 ładowarek?"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"klikalna makieta startu ładowania z kodu QR"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"aplikacja z płatnością ad hoc dla całej sieci"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"nowa platforma na 20 lokalizacjach w Warszawie"}]}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"Spotkasz też "},{"type":"text","text":"POT","marks":[{"type":"bold"}]},{"type":"text","text":" ("},{"type":"text","text":"proof of technology","marks":[{"type":"italic"}]},{"type":"text","text":" – czy technologia w ogóle robi to, co obiecuje producent) i "},{"type":"text","text":"proof of value","marks":[{"type":"bold"}]},{"type":"text","text":" (czy rozwiązanie daje mierzalną korzyść biznesową, często w presales). W praktyce różnica między POT a PoC jest mniej ważna niż to, żeby "},{"type":"text","text":"nazwać pytanie","marks":[{"type":"bold"}]},{"type":"text","text":" i nie mieszać go z budową produktu."}]},{"type":"resourceRef","attrs":{"resourceId":"6b0857b73c96f2d34d0b3c02"}},{"type":"heading","attrs":{"level":2,"id":"kiedy-poc-jest-potrzebny-a-kiedy-nie"},"content":[{"type":"text","text":"Kiedy PoC jest potrzebny, a kiedy nie"}]},{"type":"paragraph","content":[{"type":"text","text":"PoC kosztuje: dwie osoby przez dwa tygodnie to kilkadziesiąt tysięcy złotych i opóźnienie innych prac. Opłaca się, gdy "},{"type":"text","text":"koszt pomyłki jest większy niż koszt eksperymentu","marks":[{"type":"bold"}]},{"type":"text","text":", a odpowiedzi nie da się znaleźć taniej."}]},{"type":"diagram","attrs":{"kind":"mermaid","code":"flowchart TD\n  a[\"Założenie, od którego zależy architektura\"] --> b{\"Czy błędne założenie<br/>zmieni decyzję albo koszt<br/>w istotny sposób?\"}\n  b -- \"nie\" --> c[\"Zapisz jako założenie w HLD<br/>z właścicielem i datą\"]\n  b -- \"tak\" --> d{\"Czy odpowiedź jest w dokumentacji,<br/>benchmarku, u eksperta<br/>albo w innym zespole?\"}\n  d -- \"tak\" --> e[\"Sprawdź źródło – dni, nie tygodnie\"]\n  d -- \"nie\" --> f{\"Czy da się to sprawdzić<br/>w 1–3 tygodnie?\"}\n  f -- \"nie\" --> g[\"Podziel pytanie<br/>albo zmień wariant\"]\n  f -- \"tak\" --> h[\"PoC: hipoteza, kryteria,<br/>timebox, decydent\"]","caption":"Czy potrzebujesz PoC? Szybkie drzewo decyzji"}},{"type":"paragraph","content":[{"type":"text","text":"Typowe sygnały, że PoC ma sens:"}]},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Ekstremalne NFR","marks":[{"type":"bold"}]},{"type":"text","text":" – skala, opóźnienia lub dostępność, których zespół nigdy nie osiągał (VoltGo: 10 000 trwałych połączeń WebSocket i 1 000 msg/s przy p95 < 300 ms)."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Nowa technologia dla zespołu","marks":[{"type":"bold"}]},{"type":"text","text":" w krytycznym miejscu – tu: Kafka, której zespół nie zna (ryzyko R5 z HLD)."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Nieznany system zewnętrzny","marks":[{"type":"bold"}]},{"type":"text","text":" – API partnera, którego zachowania pod obciążeniem nikt nie widział."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Obietnice producenta","marks":[{"type":"bold"}]},{"type":"text","text":" – „nasz produkt obsłuży wszystko” (to raczej POT)."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Niepewność kosztowa","marks":[{"type":"bold"}]},{"type":"text","text":" – gdy rachunek za chmurę może zmienić wybór wariantu."}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"PoC "},{"type":"text","text":"nie","marks":[{"type":"bold"}]},{"type":"text","text":" jest potrzebny, gdy odpowiedź jest znana (nie testuj, czy PostgreSQL zapisze 50 wierszy na sekundę), gdy błędne założenie łatwo naprawić później albo gdy tak naprawdę pytasz o użyteczność – wtedy potrzebujesz prototypu, nie PoC."}]},{"type":"resourceRef","attrs":{"resourceId":"6b09ab5e3c96f2d34d0bc20c"}},{"type":"heading","attrs":{"level":2,"id":"hipoteza-i-mierzalne-kryteria-sukcesu"},"content":[{"type":"text","text":"Hipoteza i mierzalne kryteria sukcesu"}]},{"type":"paragraph","content":[{"type":"text","text":"Hipoteza zamienia mgliste „sprawdźmy Kafkę” w zdanie, które da się obalić. Format jest prosty: "},{"type":"text","text":"wierzymy, że","marks":[{"type":"bold"}]},{"type":"text","text":" rozwiązanie X "},{"type":"text","text":"pozwoli osiągnąć","marks":[{"type":"bold"}]},{"type":"text","text":" Y "},{"type":"text","text":"przy","marks":[{"type":"bold"}]},{"type":"text","text":" warunkach Z; "},{"type":"text","text":"uznamy to za prawdę, jeśli","marks":[{"type":"bold"}]},{"type":"text","text":" spełnione są kryteria K."}]},{"type":"pullQuote","attrs":{"text":"Wierzymy, że brama OCPP w Node.js publikująca telemetrię do Kafki (MSK) i potwierdzająca ją po zapisie przyjmie dane z 10 000 ładowarek (1 000 msg/s, szczyt 3 000) z opóźnieniem p95 < 300 ms i bez utraty wiadomości – także podczas burzy połączeń i restartu instancji.","author":"Hipoteza PoC-01","role":"VoltGo"}},{"type":"paragraph","content":[{"type":"text","text":"Kryteria muszą być "},{"type":"text","text":"mierzalne, ustalone przed startem i zatwierdzone przez decydenta","marks":[{"type":"bold"}]},{"type":"text","text":". Dzielimy je na „musi” (niespełnione = no-go albo zmiana wariantu) i „powinno” (niespełnione = warunek albo ryzyko):"}]},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"ID"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Kryterium"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Próg"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Jak mierzymy"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Waga"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"K1"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"potwierdzenie "},{"type":"text","text":"MeterValues","marks":[{"type":"code"}]},{"type":"text","text":" (CALL → CALLRESULT)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"p95 < 300 ms przy 1 000 i 3 000 msg/s"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"trend "},{"type":"text","text":"ocpp_ack_ms","marks":[{"type":"code"}]},{"type":"text","text":" w k6"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"musi"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"K2"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"end-to-end: znacznik czasu ładowarki → przetworzenie w konsumencie"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"p95 < 300 ms"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"percentyle w konsumencie"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"musi"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"K3"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"utrata wiadomości"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"0"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"luki w numeracji + porównanie: potwierdzone w k6 = przetworzone w konsumencie"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"musi"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"K4"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"CPU procesu bramy przy 5 000 połączeń i 500 msg/s"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"< 70% jednego rdzenia"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"metryki instancji, "},{"type":"text","text":"loop_p99","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"musi"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"K5"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"burza: 10 000 ponownych połączeń w ok. 10 s"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"wszystkie zaakceptowane ≤ 5 min, potwierdzenia p95 < 300 ms"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"k6 + dashboard"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"musi"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"K6"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"restart jednej z 3 instancji bramy"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"ładowarki wracają < 60 s, 0 luk"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"k6 + konsument"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"powinno"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"K7"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"koszt ścieżki telemetrii przy 10 000 punktów"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"≤ 8 tys. zł miesięcznie"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"AWS Pricing Calculator"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"powinno"}]}]}]}]},{"type":"callout","attrs":{"variant":"warning","title":"Kryterium, którego nie da się oblać, nie jest kryterium"},"content":[{"type":"paragraph","content":[{"type":"text","text":"„Brama działa wydajnie”, „Kafka sprawdza się” czy „zespół jest zadowolony” – po takim PoC każdy wynik da się ogłosić sukcesem. Dobre kryterium ma liczbę, warunki obciążenia, czas trwania, sposób pomiaru i zostało zapisane "},{"type":"text","text":"zanim","marks":[{"type":"bold"}]},{"type":"text","text":" zobaczysz wynik. Przesuwanie progu po fakcie to najczęstszy sposób na unieważnienie PoC."}]}]},{"type":"heading","attrs":{"level":2,"id":"timebox-i-ciecie-zakresu"},"content":[{"type":"text","text":"Timebox i cięcie zakresu"}]},{"type":"paragraph","content":[{"type":"text","text":"Timebox","marks":[{"type":"bold"}]},{"type":"text","text":" to nie termin, tylko budżet: po 10 dniach podejmujemy decyzję z tym, co wiemy – nawet jeśli odpowiedź brzmi „nie zdążyliśmy zbadać K6”. Wydłużanie PoC „o jeszcze tydzień” to sygnał, że pytanie było za szerokie."}]},{"type":"paragraph","content":[{"type":"text","text":"Zakres tniemy według jednej reguły: zostaje tylko to, co "},{"type":"text","text":"wpływa na odpowiedź","marks":[{"type":"bold"}]},{"type":"text","text":". Wszystko inne – nawet jeśli kusi – wypada, z uzasadnieniem:"}]},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"W zakresie"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Poza zakresem (i dlaczego wolno to pominąć)"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"BootNotification","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"MeterValues","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"StatusNotification","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Start/StopTransaction","marks":[{"type":"code"}]},{"type":"text","text":" – ścieżka synchroniczna, osobne ryzyko, test w laboratorium"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"TLS terminowany w bramie (jak profil bezpieczeństwa 2)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"hasła per ładowarka – pomijalny koszt wobec TLS, osobny test bezpieczeństwa"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Kafka w MSK (3 brokery, "},{"type":"text","text":"acks=all","marks":[{"type":"code"}]},{"type":"text","text":") – jak w produkcji"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Redis – znany koszt zapisu (~1 ms); w PoC stan w pamięci konsumenta"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"konsument z pomiarem opóźnień i luk"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"prawdziwe ładowarki – ryzyko R1, laboratorium z 3 modelami"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"burza połączeń, restart instancji"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"DR międzyregionowy, UI, autoryzacja operatorów"}]}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"Plan dnia po dniu – też część PoC, bo bez niego „środowisko” potrafi zjeść połowę timeboxu:"}]},{"type":"timeline","attrs":{"items":[{"date":"Dzień 1 (9.11)","title":"Plan i kryteria","text":"Hipoteza, K1–K7, zakres i scenariusze zatwierdzone przez CTO i lidera zespołu Ładowanie. Gałąź `poc/telemetry-ingest`."},{"date":"Dni 2–4","title":"Kod","text":"Brama, konsument, skrypt k6; test dymny lokalnie z Redpandą i 500 ładowarkami."},{"date":"Dzień 5","title":"Środowisko","text":"Konto sandbox AWS z Terraform: NLB, 3 instancje bramy, MSK, konsument, 4 generatory k6, Grafana."},{"date":"Dni 6–7","title":"Scenariusze S1","text":"Stan ustalony 10 000 ładowarek, szczyt 3 000 msg/s, jedna instancja z 5 000 połączeń."},{"date":"Dni 8–9","title":"Scenariusze S2–S3","text":"Burza połączeń (dwie rundy), restart instancji bramy."},{"date":"Dzień 10 (23.11)","title":"Raport i decyzja","text":"Raport, demo dashboardu, decyzja go/no-go; ADR-0003 i HLD zaktualizowane 24.11. `terraform destroy`."}]}},{"type":"paragraph","content":[{"type":"text","text":"Plan zapisujesz w krótkim dokumencie – szablon do pobrania:"}]},{"type":"codeBlock","attrs":{"language":"plaintext","filename":"templates/PoC-plan.md"},"content":[{"type":"text","text":"# PoC-<nr>: <pytanie w jednym zdaniu, zakończone znakiem zapytania>\n\n| Właściciel | Zespół | Timebox | Start | Decyzja (data, kto) |\n|---|---|---|---|---|\n| <architekt> | <2–3 osoby> | <np. 10 dni roboczych> | RRRR-MM-DD | RRRR-MM-DD, <decydent> |\n\n## 1. Po co ten PoC\n<!-- Które założenie z HLD/ADR sprawdzamy? Co się stanie z architekturą, jeśli okaże się fałszywe? -->\n- Założenie / ryzyko: <A1, R2 z rejestru HLD>\n- Decyzja, która od tego zależy: <ADR-XXXX>\n- Koszt pomyłki bez PoC: <np. przepisanie bramy po starcie, X tys. zł miesięcznie więcej>\n\n## 2. Hipoteza\nWierzymy, że **<rozwiązanie>** pozwoli **<osiągnąć wynik>** przy **<warunkach / skali>**.\nUznamy hipotezę za potwierdzoną, jeśli **<mierzalne kryteria z sekcji 3>**.\n\n## 3. Kryteria sukcesu (go / no-go)\n| ID | Kryterium | Próg | Jak mierzymy | Waga (musi / powinno) |\n|---|---|---|---|---|\n| K1 | | | | musi |\n| K2 | | | | powinno |\n\n## 4. Zakres\n| W zakresie | Poza zakresem (i dlaczego wolno to pominąć) |\n|---|---|\n| | |\n\n## 5. Scenariusze testowe\n| Scenariusz | Obciążenie / zdarzenie | Czas | Co obserwujemy |\n|---|---|---|---|\n| S1 stan ustalony | | | |\n| S2 szczyt / burza | | | |\n| S3 awaria | | | |\n\n## 6. Środowisko i narzędzia\n- Infrastruktura: <konto sandbox, region, typy instancji – jak najbliżej produkcji>\n- Generatory obciążenia: <k6, ile maszyn, ile VU na maszynę>\n- Pomiar: <metryki, dashboard, gdzie zapisujemy surowe wyniki>\n- Kod: gałąź `poc/<nazwa>` – **nie trafia do main**; po decyzji archiwizujemy tagiem\n\n## 7. Plan dzień po dniu\n| Dzień | Cel |\n|---|---|\n| 1 | plan i kryteria zatwierdzone przez decydenta |\n| … | |\n| ostatni | raport, demo, decyzja |\n\n## 8. Budżet i ryzyka PoC\n- Koszt środowiska: <kwota> · Ludzie: <osobodni>\n- Co przerywa PoC przed czasem: <np. brak dostępu do sandboksu dostawcy>"}]},{"type":"heading","attrs":{"level":2,"id":"przyklad-poc-01-telemetria-z-10-000-ladowarek"},"content":[{"type":"text","text":"Przykład: PoC-01 – telemetria z 10 000 ładowarek"}]},{"type":"paragraph","content":[{"type":"text","text":"Architektura PoC jest celowo minimalna: symulowane ładowarki (k6) → brama OCPP → Kafka → konsument, który mierzy opóźnienia i liczy luki. Nic więcej nie jest potrzebne, żeby odpowiedzieć na pytanie."}]},{"type":"diagram","attrs":{"kind":"mermaid","code":"flowchart LR\n  subgraph gen[\"4 generatory k6 (c7g.2xlarge)\"]\n    k1[\"2 500 VU = 2 500 ładowarek<br/>MeterValues co 10 s\"]\n  end\n  subgraph aws[\"Konto sandbox AWS, eu-central-1\"]\n    nlb[\"NLB<br/>TLS do bramy\"]\n    gw[\"Brama OCPP ×3<br/>Node.js 24, ws\"]\n    msk[[\"MSK, 3 brokery<br/>ocpp.inbound.v1, 24 partycje\"]]\n    con[\"Konsument<br/>opóźnienia, luki, stan na żywo\"]\n    graf[\"Grafana + Prometheus<br/>metryki k6 i instancji\"]\n  end\n  k1 -- \"WSS, OCPP 1.6J\" --> nlb --> gw\n  gw -- \"acks=all, potem CALLRESULT\" --> msk\n  msk --> con\n  k1 -. \"remote write\" .-> graf\n  gw -. \"metryki\" .-> graf","caption":"Środowisko PoC-01: tylko to, co wpływa na odpowiedź"}},{"type":"paragraph","content":[{"type":"text","text":"Kod jest prosty, ale nie naiwny: brama potwierdza "},{"type":"text","text":"MeterValues","marks":[{"type":"code"}]},{"type":"text","text":" "},{"type":"text","text":"dopiero po zapisie w Kafce","marks":[{"type":"bold"}]},{"type":"text","text":" (dostarczanie co najmniej raz), zbiera wiadomości w mikro-paczki co 5 ms, a przy burzy połączeń potrafi odpowiedzieć na "},{"type":"text","text":"BootNotification","marks":[{"type":"code"}]},{"type":"text","text":" statusem "},{"type":"text","text":"Pending","marks":[{"type":"code"}]},{"type":"text","text":" – mechanizmem z samego OCPP 1.6, który każe ładowarce spróbować ponownie za podaną liczbę sekund."}]},{"type":"heading","attrs":{"level":3,"id":"projekt-i-uruchomienie"},"content":[{"type":"text","text":"Projekt i uruchomienie"}]},{"type":"codeGroup","attrs":{"title":"Projekt PoC-01 – package.json, tsconfig, Redpanda"},"content":[{"type":"codeBlock","attrs":{"language":"json","filename":"package.json"},"content":[{"type":"text","text":"{\n  \"name\": \"voltgo-poc-telemetry\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"description\": \"PoC-01: can one OCPP gateway + Kafka ingest MeterValues from 10 000 chargers with p95 < 300 ms end-to-end?\",\n  \"type\": \"module\",\n  \"engines\": { \"node\": \">=22\" },\n  \"scripts\": {\n    \"build\": \"tsc -p .\",\n    \"gateway\": \"node dist/gateway.js\",\n    \"consumer\": \"node dist/consumer.js\",\n    \"topic\": \"docker compose exec redpanda rpk topic create ocpp.inbound.v1 -p 24 -r 1\",\n    \"load\": \"k6 run k6/telemetry.js\"\n  },\n  \"dependencies\": {\n    \"kafkajs\": \"^2.2.4\",\n    \"ws\": \"^8.18.3\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"^24.10.0\",\n    \"@types/ws\": \"^8.18.1\",\n    \"typescript\": \"^5.9.3\"\n  }\n}"}]},{"type":"codeBlock","attrs":{"language":"json","filename":"tsconfig.json"},"content":[{"type":"text","text":"{\n  \"compilerOptions\": {\n    \"target\": \"ES2023\",\n    \"module\": \"NodeNext\",\n    \"moduleResolution\": \"NodeNext\",\n    \"rootDir\": \"src\",\n    \"outDir\": \"dist\",\n    \"strict\": true,\n    \"noUncheckedIndexedAccess\": true,\n    \"skipLibCheck\": true,\n    \"sourceMap\": true\n  },\n  \"include\": [\"src\"]\n}"}]},{"type":"codeBlock","attrs":{"language":"yaml","filename":"docker-compose.yml"},"content":[{"type":"text","text":"services:\n  redpanda:\n    image: docker.redpanda.com/redpandadata/redpanda:v26.2.7\n    command:\n      - redpanda\n      - start\n      - --mode=dev-container\n      - --smp=2\n      - --kafka-addr=internal://0.0.0.0:9092,external://0.0.0.0:19092\n      - --advertise-kafka-addr=internal://redpanda:9092,external://localhost:19092\n    ports:\n      - \"19092:19092\""}]}]},{"type":"codeBlock","attrs":{"language":"bash"},"content":[{"type":"text","text":"docker compose up -d                  # Redpanda (API Kafki) na localhost:19092\nnpm install && npm run build\nnpm run topic                         # ocpp.inbound.v1, 24 partycje\nnpm run gateway                       # terminal 1\nnpm run consumer                      # terminal 2\nk6 run -e CHARGERS=500 -e RAMP=30s -e HOLD=2m k6/telemetry.js   # terminal 3: test dymny"}]},{"type":"paragraph","content":[{"type":"text","text":"Lokalnie sprawdzasz poprawność, nie wydajność: Redpanda ma API Kafki, ale to inny silnik, a laptop z generatorem, brokerem i bramą na jednym CPU nie powie nic o produkcji. Liczby do raportu pochodzą ze środowiska w AWS."}]},{"type":"heading","attrs":{"level":3,"id":"ramki-ocpp-i-brama"},"content":[{"type":"text","text":"Ramki OCPP i brama"}]},{"type":"codeGroup","attrs":{"title":"Brama OCPP – ramki OCPP-J i producent Kafki"},"content":[{"type":"codeBlock","attrs":{"language":"typescript","filename":"src/ocpp.ts"},"content":[{"type":"text","text":"// Minimal OCPP 1.6-J framing – just enough for the PoC.\n// Frames are JSON arrays: CALL [2, id, action, payload], CALLRESULT [3, id, payload], CALLERROR [4, id, code, text, details].\n\nexport type Call = [2, string, string, Record<string, unknown>];\n\nexport interface SampledValue {\n  value: string;\n  measurand?: string;\n  unit?: string;\n}\n\nexport interface MeterValuesReq {\n  connectorId: number;\n  transactionId?: number;\n  meterValue: { timestamp: string; sampledValue: SampledValue[] }[];\n}\n\n/** Envelope published to Kafka for every inbound charger message. */\nexport interface InboundEvent {\n  cpId: string;\n  action: string;\n  uniqueId: string;\n  receivedAt: number; // epoch ms at the gateway\n  payload: Record<string, unknown>;\n}\n\nexport function parseCall(raw: string): Call | null {\n  try {\n    const msg: unknown = JSON.parse(raw);\n    if (\n      Array.isArray(msg) &&\n      msg[0] === 2 &&\n      typeof msg[1] === 'string' &&\n      typeof msg[2] === 'string' &&\n      typeof msg[3] === 'object' &&\n      msg[3] !== null\n    ) {\n      return msg as Call;\n    }\n  } catch {\n    // not JSON – treated as a protocol error by the caller\n  }\n  return null;\n}\n\nexport const callResult = (id: string, payload: Record<string, unknown> = {}): string => JSON.stringify([3, id, payload]);\n\nexport const callError = (id: string, code: 'NotImplemented' | 'FormationViolation' | 'InternalError', text: string): string =>\n  JSON.stringify([4, id, code, text, {}]);\n\n/** Value of one measurand from the newest sample, e.g. 'Power.Active.Import'. */\nexport function measurand(req: MeterValuesReq, name: string): number | undefined {\n  const sample = req.meterValue.at(-1);\n  const v = sample?.sampledValue.find((s) => (s.measurand ?? 'Energy.Active.Import.Register') === name)?.value;\n  return v === undefined ? undefined : Number(v);\n}"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"src/gateway.ts"},"content":[{"type":"text","text":"// PoC OCPP gateway: holds charger WebSockets and publishes inbound messages to Kafka.\n// MeterValues/StatusNotification are acknowledged only AFTER Kafka confirms the write (at-least-once).\nimport { readFileSync } from 'node:fs';\nimport { createServer, type IncomingMessage, type ServerResponse } from 'node:http';\nimport { createServer as createTlsServer } from 'node:https';\nimport { monitorEventLoopDelay } from 'node:perf_hooks';\nimport { Kafka, logLevel, type Message } from 'kafkajs';\nimport { WebSocket, WebSocketServer } from 'ws';\nimport { callError, callResult, parseCall, type InboundEvent } from './ocpp.js';\n\nconst PORT = Number(process.env.PORT ?? 9000);\nconst TOPIC = process.env.TOPIC ?? 'ocpp.inbound.v1';\nconst BROKERS = (process.env.BROKERS ?? 'localhost:19092').split(',');\nconst FLUSH_MS = Number(process.env.FLUSH_MS ?? 5);\nconst BOOT_RATE = Number(process.env.BOOT_RATE ?? 0); // accepted BootNotifications per second, 0 = unlimited\n\nconst kafka = new Kafka({ clientId: `ocpp-gw-${process.pid}`, brokers: BROKERS, logLevel: logLevel.WARN });\nconst producer = kafka.producer({ allowAutoTopicCreation: false });\n\ntype Pending = { msg: Message; ack: () => void };\nlet pending: Pending[] = [];\nlet flushing = false;\nconst stats = { connections: 0, published: 0, failed: 0, bootPending: 0 };\n\n// Load shedding for reconnect storms: above BOOT_RATE/s, answer \"Pending\" with a random retry interval.\n// OCPP 1.6: a charger in Pending state retries BootNotification after `interval` seconds.\nlet bootTokens = BOOT_RATE;\nif (BOOT_RATE > 0) setInterval(() => (bootTokens = BOOT_RATE), 1000).unref();\nfunction admitBoot(): boolean {\n  if (BOOT_RATE === 0) return true;\n  if (bootTokens <= 0) return false;\n  bootTokens--;\n  return true;\n}\n\n// Micro-batching: one Kafka request every few ms instead of one per charger message.\nasync function flush(): Promise<void> {\n  if (flushing || pending.length === 0) return;\n  flushing = true;\n  const batch = pending;\n  pending = [];\n  try {\n    await producer.send({ topic: TOPIC, acks: -1, messages: batch.map((p) => p.msg) });\n    for (const p of batch) p.ack();\n    stats.published += batch.length;\n  } catch (err) {\n    // No CALLRESULT is sent: chargers retry transaction-related messages after a timeout.\n    stats.failed += batch.length;\n    console.error(`kafka send failed (${batch.length} msgs):`, (err as Error).message);\n  } finally {\n    flushing = false;\n  }\n}\n\nfunction onMessage(cpId: string, socket: WebSocket, raw: string): void {\n  const call = parseCall(raw);\n  if (!call) return; // CALLRESULT/CALLERROR from the charger – not used in the PoC\n  const [, uniqueId, action, payload] = call;\n  switch (action) {\n    case 'BootNotification': {\n      const currentTime = new Date().toISOString();\n      if (admitBoot()) {\n        socket.send(callResult(uniqueId, { status: 'Accepted', currentTime, interval: 300 }));\n      } else {\n        stats.bootPending++;\n        socket.send(callResult(uniqueId, { status: 'Pending', currentTime, interval: 30 + Math.floor(Math.random() * 90) }));\n      }\n      return;\n    }\n    case 'Heartbeat':\n      socket.send(callResult(uniqueId, { currentTime: new Date().toISOString() }));\n      return;\n    case 'MeterValues':\n    case 'StatusNotification': {\n      const event: InboundEvent = { cpId, action, uniqueId, receivedAt: Date.now(), payload };\n      pending.push({\n        msg: { key: cpId, value: JSON.stringify(event) }, // key = charger → per-charger ordering\n        ack: () => {\n          if (socket.readyState === WebSocket.OPEN) socket.send(callResult(uniqueId));\n        },\n      });\n      return;\n    }\n    default:\n      socket.send(callError(uniqueId, 'NotImplemented', `${action} is out of PoC scope`));\n  }\n}\n\n// TLS like OCPP security profile 2 (the NLB passes TLS through, the gateway terminates it).\nconst reject = (_req: IncomingMessage, res: ServerResponse) => res.writeHead(426).end('Upgrade Required');\nconst { TLS_CERT, TLS_KEY } = process.env;\nconst server =\n  TLS_CERT && TLS_KEY ? createTlsServer({ cert: readFileSync(TLS_CERT), key: readFileSync(TLS_KEY) }, reject) : createServer(reject);\nconst wss = new WebSocketServer({\n  server,\n  handleProtocols: (protocols) => (protocols.has('ocpp1.6') ? 'ocpp1.6' : false),\n});\n\nwss.on('connection', (socket, req) => {\n  // OCPP-J: the charge point identity is the last segment of the URL, e.g. /ocpp/VG-WAW-00042\n  const cpId = decodeURIComponent(req.url?.split('/').pop() ?? '');\n  if (socket.protocol !== 'ocpp1.6' || !/^[A-Za-z0-9._-]{1,48}$/.test(cpId)) {\n    socket.close(1002, 'ocpp1.6 subprotocol and a valid charge point id are required');\n    return;\n  }\n  stats.connections++;\n  socket.on('message', (data) => onMessage(cpId, socket, data.toString()));\n  socket.on('close', () => stats.connections--);\n});\n\nconst loopDelay = monitorEventLoopDelay({ resolution: 10 });\nloopDelay.enable();\nlet lastPublished = 0;\nsetInterval(() => {\n  const rate = (stats.published - lastPublished) / 10;\n  lastPublished = stats.published;\n  const p99 = (loopDelay.percentile(99) / 1e6).toFixed(1);\n  const rss = Math.round(process.memoryUsage().rss / 1024 / 1024);\n  console.log(\n    `conn=${stats.connections} published/s=${rate.toFixed(0)} failed=${stats.failed} queue=${pending.length} boot_pending=${stats.bootPending} loop_p99=${p99}ms rss=${rss}MB`,\n  );\n  loopDelay.reset();\n}, 10_000).unref();\n\nconst flushTimer = setInterval(() => void flush(), FLUSH_MS);\n\nasync function shutdown(): Promise<void> {\n  console.log('shutting down: closing sockets, flushing the last batch');\n  clearInterval(flushTimer);\n  for (const ws of wss.clients) ws.close(1001, 'gateway restart'); // chargers reconnect to another instance\n  await flush();\n  await producer.disconnect();\n  server.close(() => process.exit(0));\n}\nprocess.on('SIGTERM', () => void shutdown());\nprocess.on('SIGINT', () => void shutdown());\n\nawait producer.connect();\nconst scheme = TLS_CERT ? 'wss' : 'ws';\nserver.listen(PORT, () => console.log(`OCPP gateway ${scheme}://0.0.0.0:${PORT}/ocpp/<chargePointId> → ${TOPIC} @ ${BROKERS.join(',')}`));"}]}]}]},"toc":[{"id":"poc-spike-prototyp-mvp-pilotaz-czym-sie-roznia","text":"PoC, spike, prototyp, MVP, pilotaż – czym się różnią","level":2,"locked":false},{"id":"kiedy-poc-jest-potrzebny-a-kiedy-nie","text":"Kiedy PoC jest potrzebny, a kiedy nie","level":2,"locked":false},{"id":"hipoteza-i-mierzalne-kryteria-sukcesu","text":"Hipoteza i mierzalne kryteria sukcesu","level":2,"locked":false},{"id":"timebox-i-ciecie-zakresu","text":"Timebox i cięcie zakresu","level":2,"locked":false},{"id":"przyklad-poc-01-telemetria-z-10-000-ladowarek","text":"Przykład: PoC-01 – telemetria z 10 000 ładowarek","level":2,"locked":false},{"id":"projekt-i-uruchomienie","text":"Projekt i uruchomienie","level":3,"locked":false},{"id":"ramki-ocpp-i-brama","text":"Ramki OCPP i brama","level":3,"locked":false},{"id":"konsument-opoznienia-i-luki","text":"Konsument: opóźnienia i luki","level":3,"locked":true},{"id":"skrypt-k6-2-500-ladowarek-na-generator","text":"Skrypt k6: 2 500 ładowarek na generator","level":3,"locked":true},{"id":"burza-polaczen-wynik-ktory-zmienil-projekt","text":"Burza połączeń: wynik, który zmienił projekt","level":3,"locked":true},{"id":"raport-z-wynikow","text":"Raport z wyników","level":2,"locked":true},{"id":"decyzja-go-no-go-i-adr","text":"Decyzja go/no-go i ADR","level":2,"locked":true},{"id":"pulapki-ktore-psuja-poc","text":"Pułapki, które psują PoC","level":2,"locked":true},{"id":"narzedzia-do-poc","text":"Narzędzia do PoC","level":2,"locked":true},{"id":"powiazane","text":"Powiązane","level":2,"locked":true},{"id":"sprawdz-sie","text":"Sprawdź się","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":85,"visibleBlocks":40,"resources":[{"id":"6b0857b73c96f2d34d0b3c02","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/pl/podcast/mvp-poc-pot-przestan-mieszac-te-trzy-rzeczy/id1477067604?i=1000769038113","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id1477067604?i=1000769038113","title":"MVP, POC, POT - przestań mieszać te trzy rzeczy","description":"“The POC must deliver a fully functional production capable MVP.” Autentyczny cytat od klienta, który Łukasz wyciąga z Teamsów jak dowód rzeczowy w sprawie o zbiorowe pomieszanie pojęć. Brzmi znajomo? 🎯 MVP, POC, POT - trzy skróty, które w korporacji zlały się w jedno bezkształtne coś. Szymon…","author":"Patoarchitekci","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts211/v4/12/ab/89/12ab890a-3ba9-28fc-a8b9-be26723bf3f8/mza_1118503093741563394.jpg/600x600bb.jpg","durationSec":1537,"lang":"pl","topics":[],"techs":["general"],"tags":["podcast","security"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2026-05-22T06:00:04.000Z","popularity":68,"verifiedAt":"2026-11-26T11:07:41.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:53.924Z","updatedAt":"2026-11-26T16:00:53.924Z"},{"id":"6b09ab5e3c96f2d34d0bc20c","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=65qOqfbQV2Y","embedUrl":"https://www.youtube-nocookie.com/embed/65qOqfbQV2Y","title":"Lesson 181 - Feasibility and Questioning Requirements","description":"Mark Richards on feasibility – an often overlooked architectural characteristic shaped by time, budget and skills – and on questioning \"requirements\" that are really solutions handed down by stakeholders.","author":"Software Architecture Monday","thumbnailUrl":"https://i.ytimg.com/vi/65qOqfbQV2Y/hqdefault.jpg","durationSec":null,"lang":"en","topics":["solution-architecture"],"techs":["general"],"tags":["software-architecture","feasibility","requirements"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":"2024-02-26T00:00:00.000Z","popularity":58,"verifiedAt":"2026-11-27T15:40:00.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-27T16:10:06.319Z","updatedAt":"2026-11-27T16:10:06.319Z"},{"id":"6b09ab5e3c96f2d34d0bc20f","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=iJ2KKO7sbvU","embedUrl":"https://www.youtube-nocookie.com/embed/iJ2KKO7sbvU","title":"Lesson206 - Architecture Decisions: Overcoming Analysis Paralysis","description":"Anti-patterns behind analysis paralysis in architecture decisions – stubbornness, missing information, fear of being wrong – and two techniques that help you decide and move on.","author":"Software Architecture Monday","thumbnailUrl":"https://i.ytimg.com/vi/iJ2KKO7sbvU/hqdefault.jpg","durationSec":null,"lang":"en","topics":["solution-architecture"],"techs":["general"],"tags":["software-architecture","architecture-decisions"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":"2025-04-07T00:00:00.000Z","popularity":57,"verifiedAt":"2026-11-27T15:40:00.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-27T16:10:06.319Z","updatedAt":"2026-11-27T16:10:06.319Z"},{"id":"6b0857b83c96f2d34d0b3c87","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/pl/podcast/85-o-architectural-kata-i-procesie-tworzenia-architektury/id1508298430?i=1000653265837","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id1508298430?i=1000653265837","title":"85. O Architectural Kata i procesie tworzenia architektury z Piotrem Filipowiczem","description":"\"Jak mamy pozyskać świetnych architektów, jeśli w swojej karierze będą mieli okazję ją tworzyć mniej niż pół tuzina razy?\". Dokładnie takie pytania postawił Ted Neward, szukając sposobu na doskonalenie umiejętności tworzenia architektury. I trudno się tu nie zgodzić, patrząc jak często w zespołach…","author":"Better Software Design","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/a9/6d/bb/a96dbb46-a01a-9cf6-40ef-27a27cef3c73/mza_18038037312547630971.jpg/600x600bb.jpg","durationSec":3440,"lang":"pl","topics":[],"techs":["general"],"tags":["podcast","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2024-04-22T23:00:00.000Z","popularity":62,"verifiedAt":"2026-11-26T11:07:44.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:55.661Z","updatedAt":"2026-11-26T16:00:55.661Z"},{"id":"6b09ab5e3c96f2d34d0bc20b","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=41NVge3_cYo","embedUrl":"https://www.youtube-nocookie.com/embed/41NVge3_cYo","title":"SATURN 2017 Talk: Architecture Decision Records in Action","description":"A SATURN 2017 conference talk (Software Engineering Institute) on using Architecture Decision Records in practice: what goes into an ADR, how teams adopt them and what they learned along the way.","author":"Software Engineering Institute | Carnegie Mellon University","thumbnailUrl":"https://i.ytimg.com/vi/41NVge3_cYo/hqdefault.jpg","durationSec":null,"lang":"en","topics":["solution-architecture"],"techs":["general"],"tags":["software-architecture","adr","architecture-decisions"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":62,"verifiedAt":"2026-11-27T15:40:00.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-27T16:10:06.319Z","updatedAt":"2026-11-27T16:10:06.319Z"},{"id":"6b0857b93c96f2d34d0b3d09","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/us/podcast/adr-czyli-architecture-decision-record/id1477067604?i=1000456242255","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id1477067604?i=1000456242255","title":"ADR, czyli Architecture Decision Record","description":"13 odcinek, więc warto zająć się dokumentacją. Dokumentacja większość osób boli, szczególnie dokumentowanie przyczyn podjęcia decyzji. ADR, czyli Architecture Decision Record to metoda, która jest prosta, dobra i, mimo że formalna (częściowo ;-)) to bardzo wygodna w użyciu! Ciekawe linki i inne…","author":"Patoarchitekci","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts221/v4/b5/c0/3b/b5c03bc3-51ed-0f38-a1d1-d104c923f52d/mza_14281507814274290979.jpg/600x600bb.jpg","durationSec":1911,"lang":"pl","topics":[],"techs":["general"],"tags":["podcast","software-architecture","cloud"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2019-11-08T18:51:05.000Z","popularity":59,"verifiedAt":"2026-11-26T10:59:15.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:55.661Z","updatedAt":"2026-11-26T16:00:55.661Z"},{"id":"6b09ab5e3c96f2d34d0bc214","type":"article","provider":"web","url":"https://grafana.com/docs/k6/latest/","embedUrl":null,"title":"Grafana k6 documentation","description":"Official k6 documentation: writing load tests in JavaScript, scenarios and executors, thresholds, WebSocket and gRPC testing, distributed runs and sending results to Grafana.","author":"Grafana Labs","thumbnailUrl":"https://grafana.com/meta-generator/Grafana+k6@@@k6-docs@@@3.png","durationSec":null,"lang":"en","topics":["solution-architecture"],"techs":["general"],"tags":["load-testing","k6","performance"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":62,"verifiedAt":"2026-11-27T15:40:00.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-27T16:10:06.319Z","updatedAt":"2026-11-27T16:10:06.319Z"},{"id":"6b09ab5e3c96f2d34d0bc216","type":"article","provider":"web","url":"https://testcontainers.com/","embedUrl":null,"title":"Testcontainers","description":"Open-source libraries for throwaway Docker-based dependencies in tests – databases, Kafka, Redpanda, LocalStack and more – for Java, .NET, Node.js, Go, Python and other languages.","author":"Testcontainers","thumbnailUrl":"https://testcontainers.com//images/share-image.png","durationSec":null,"lang":"en","topics":["solution-architecture"],"techs":["general"],"tags":["testing","docker","integration-testing"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":60,"verifiedAt":"2026-11-27T15:40:00.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-27T16:10:06.319Z","updatedAt":"2026-11-27T16:10:06.319Z"}],"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"}],"attachments":[],"hasCode":true,"repoUrl":null,"series":[{"slug":"solution-architect-path","title":"Jak zostać Solution Architectem","items":[{"slug":"solution-architecture","title":"Kim jest Solution Architect? Rola, odpowiedzialność i mapa kariery","current":false},{"slug":"sa-daily-duties","title":"Dzień z życia Solution Architecta: obowiązki, rytm pracy i priorytety","current":false},{"slug":"sa-requirements-and-nfr","title":"Wymagania i NFR: jak wyciągnąć od biznesu liczby, które naprawdę projektują system","current":false},{"slug":"sa-hld-step-by-step","title":"HLD krok po kroku: od pustej kartki do zaakceptowanej architektury","current":false},{"slug":"hld-complete-example","title":"Kompletny HLD na przykładzie: sieć ładowarek VoltGo – dokument, diagramy, ADR i narzędzia","current":false},{"slug":"poc-guide","title":"PoC, spike, prototyp, MVP – jak zaplanować i przeprowadzić PoC (z działającym przykładem)","current":true},{"slug":"sa-decisions-and-adr","title":"Decyzje architektoniczne i ADR: jak wybierać, liczyć kompromisy i zapisywać „dlaczego”","current":false},{"slug":"sa-integrations-and-contracts","title":"Integracje i kontrakty: API, zdarzenia i zależności między zespołami bez niespodzianek","current":false},{"slug":"sa-security-and-operations","title":"Bezpieczeństwo i operacje w projekcie: STRIDE, OAuth2, SLO i runbooki","current":false},{"slug":"sa-estimation-cost-tco","title":"Szacowanie, koszty i TCO: ile to kosztuje i ile serwerów naprawdę potrzeba","current":false},{"slug":"sa-governance-and-reviews","title":"Governance i przeglądy: jak obronić projekt przed Architecture Review Board","current":false},{"slug":"sa-migrations-as-is-to-be","title":"Migracja AS-IS → TO-BE bez przestoju: architektura przejściowa, strangler fig i CDC","current":false},{"slug":"sa-how-to-become","title":"Jak zostać Solution Architectem: kompetencje, ścieżka, rozmowa i pierwsze 90 dni","current":false}]}],"prev":{"slug":"hld-complete-example","title":"Kompletny HLD na przykładzie: sieć ładowarek VoltGo – dokument, diagramy, ADR i narzędzia"},"next":{"slug":"sa-decisions-and-adr","title":"Decyzje architektoniczne i ADR: jak wybierać, liczyć kompromisy i zapisywać „dlaczego”"},"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":104,"skills":[{"key":"typescript","title":"TypeScript","level":5,"levelLabel":"Autorytet","articles":90},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Autorytet","articles":61},{"key":"python","title":"Python","level":5,"levelLabel":"Autorytet","articles":59},{"key":"java","title":"Java","level":5,"levelLabel":"Autorytet","articles":46}]}}