[{"data":1,"prerenderedAt":8750},["ShallowReactive",2],{"blog-ecommerce-platform-case-study":3,"blog-related-ecommerce-platform-case-study":1773,"content-query-6rY2LDTCeN":7307},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"slug":10,"date":11,"readTime":12,"category":13,"image":14,"imageCaption":15,"author":16,"tags":25,"body":30,"_type":1767,"_id":1768,"_source":1769,"_file":1770,"_stem":1771,"_extension":1772},"/blog/ecommerce-platform-case-study","blog",false,"","How We Cut Page Load Time by 65%: Modernising a Legacy E-Commerce Platform","A detailed case study on migrating a decade-old PHP monolith to .NET 8 and Nuxt 3—delivering a 28% conversion rate increase, 47% more mobile orders, and monthly releases replaced by daily deploys.","ecommerce-platform-case-study","2025-01-15","11 min","Case Study","https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?w=1200&h=600&fit=crop&auto=format","Modern e-commerce platform UI built with Nuxt 3 and .NET 8",{"name":17,"role":18,"avatar":19,"bio":20,"social":21},"Tobias Lie-Atjam","Founder & Senior Software Engineer at MediaFront","https://images.unsplash.com/photo-1560250097-0b93528c311a?w=400&h=400&fit=crop&auto=format","Tobias is the founder of MediaFront. He specialises in cloud-native architecture, Rust, and .NET—helping businesses build high-performance systems that scale.",{"github":22,"twitter":23,"linkedin":24},"https://github.com/","https://twitter.com/","https://linkedin.com/",[26,27,28,29,13],".NET","Vue.js","E-Commerce","Modernisation",{"type":31,"children":32,"toc":1753},"root",[33,42,48,53,94,99,105,110,115,120,164,169,175,182,187,921,947,953,958,1319,1324,1330,1335,1341,1480,1486,1605,1611,1706,1712,1722,1732,1742,1747],{"type":34,"tag":35,"props":36,"children":38},"element","h2",{"id":37},"the-business-problem",[39],{"type":40,"value":41},"text","The Business Problem",{"type":34,"tag":43,"props":44,"children":45},"p",{},[46],{"type":40,"value":47},"FreshMarket, a growing grocery delivery service, came to MediaFront with a platform that had become a business liability. Built ten years earlier as a PHP/jQuery monolith, the codebase had accumulated so much technical debt that even simple features took weeks to ship—and those features frequently broke in production.",{"type":34,"tag":43,"props":49,"children":50},{},[51],{"type":40,"value":52},"The impact was measurable:",{"type":34,"tag":54,"props":55,"children":56},"ul",{},[57,69,79,89],{"type":34,"tag":58,"props":59,"children":60},"li",{},[61,67],{"type":34,"tag":62,"props":63,"children":64},"strong",{},[65],{"type":40,"value":66},"5.2-second page load times",{"type":40,"value":68}," driving mobile users to competitors",{"type":34,"tag":58,"props":70,"children":71},{},[72,77],{"type":34,"tag":62,"props":73,"children":74},{},[75],{"type":40,"value":76},"System crashes during promotional events",{"type":40,"value":78}," — the platform would buckle at 3× normal traffic",{"type":34,"tag":58,"props":80,"children":81},{},[82,87],{"type":34,"tag":62,"props":83,"children":84},{},[85],{"type":40,"value":86},"62% cart abandonment rate",{"type":40,"value":88}," — far above the 50% industry average",{"type":34,"tag":58,"props":90,"children":91},{},[92],{"type":40,"value":93},"Monthly release cycles with a 40% regression rate",{"type":34,"tag":43,"props":95,"children":96},{},[97],{"type":40,"value":98},"The brief was clear: rebuild for performance, scalability, and velocity—without taking the platform offline for months.",{"type":34,"tag":35,"props":100,"children":102},{"id":101},"the-strategy-strangle-dont-rewrite",[103],{"type":40,"value":104},"The Strategy: Strangle, Don't Rewrite",{"type":34,"tag":43,"props":106,"children":107},{},[108],{"type":40,"value":109},"The fastest way to deliver value without risk is the strangler fig pattern: build a new system incrementally alongside the old one, routing traffic to the new components as they mature, until nothing is left to strangle.",{"type":34,"tag":43,"props":111,"children":112},{},[113],{"type":40,"value":114},"We rejected a full rewrite for two reasons. First, big-bang rewrites routinely fail or deliver years late. Second, FreshMarket couldn't stop selling groceries while we worked.",{"type":34,"tag":43,"props":116,"children":117},{},[118],{"type":40,"value":119},"Our phased approach over eight months:",{"type":34,"tag":121,"props":122,"children":123},"ol",{},[124,134,144,154],{"type":34,"tag":58,"props":125,"children":126},{},[127,132],{"type":34,"tag":62,"props":128,"children":129},{},[130],{"type":40,"value":131},"Month 1–2",{"type":40,"value":133},": Build the API layer and CI/CD infrastructure",{"type":34,"tag":58,"props":135,"children":136},{},[137,142],{"type":34,"tag":62,"props":138,"children":139},{},[140],{"type":40,"value":141},"Month 3–4",{"type":40,"value":143},": Rebuild the product catalogue, search, and checkout in Nuxt 3",{"type":34,"tag":58,"props":145,"children":146},{},[147,152],{"type":34,"tag":62,"props":148,"children":149},{},[150],{"type":40,"value":151},"Month 5–6",{"type":40,"value":153},": Migrate order processing and inventory to .NET 8 microservices",{"type":34,"tag":58,"props":155,"children":156},{},[157,162],{"type":34,"tag":62,"props":158,"children":159},{},[160],{"type":40,"value":161},"Month 7–8",{"type":40,"value":163},": Decommission legacy PHP, performance optimisation, launch",{"type":34,"tag":43,"props":165,"children":166},{},[167],{"type":40,"value":168},"An Azure API Management gateway sat in front of both systems throughout, routing based on URL path. Users never saw the migration happening.",{"type":34,"tag":35,"props":170,"children":172},{"id":171},"the-technical-architecture",[173],{"type":40,"value":174},"The Technical Architecture",{"type":34,"tag":176,"props":177,"children":179},"h3",{"id":178},"backend-net-8-with-clean-architecture",[180],{"type":40,"value":181},"Backend: .NET 8 with Clean Architecture",{"type":34,"tag":43,"props":183,"children":184},{},[185],{"type":40,"value":186},"We built the backend on .NET 8 using a clean architecture approach—domain logic isolated from infrastructure concerns, with CQRS (Command Query Responsibility Segregation) separating reads from writes at the service boundary.",{"type":34,"tag":188,"props":189,"children":193},"pre",{"className":190,"code":191,"language":192,"meta":7,"style":7},"language-csharp shiki shiki-themes github-light","// Command: write path — validated, transactional, produces domain events\npublic class CreateOrderCommandHandler : IRequestHandler\u003CCreateOrderCommand, Result\u003Cint>>\n{\n    private readonly IOrderRepository _orders;\n    private readonly IEventBus _events;\n\n    public async Task\u003CResult\u003Cint>> Handle(\n        CreateOrderCommand cmd,\n        CancellationToken ct)\n    {\n        var order = Order.Create(cmd.CustomerId, cmd.Items);\n\n        if (order.IsFailure)\n            return Result.Failure\u003Cint>(order.Error);\n\n        await _orders.SaveAsync(order.Value, ct);\n        await _events.PublishAsync(new OrderCreatedEvent(order.Value.Id), ct);\n\n        return Result.Success(order.Value.Id);\n    }\n}\n\n// Query: read path — optimised for speed, no domain model overhead\npublic class GetOrderSummaryQueryHandler : IRequestHandler\u003CGetOrderSummaryQuery, OrderSummaryDto>\n{\n    private readonly IDbConnection _db;\n\n    public async Task\u003COrderSummaryDto> Handle(GetOrderSummaryQuery query, CancellationToken ct)\n    {\n        // Direct Dapper query against denormalised read model — sub-10ms\n        return await _db.QuerySingleAsync\u003COrderSummaryDto>(\n            \"SELECT * FROM v_order_summaries WHERE id = @Id\",\n            new { query.Id });\n    }\n}\n","csharp",[194],{"type":34,"tag":195,"props":196,"children":197},"code",{"__ignoreMap":7},[198,210,276,285,314,340,350,400,419,438,447,481,489,503,535,543,567,605,613,636,645,654,662,671,719,727,753,761,824,832,841,877,891,905,913],{"type":34,"tag":199,"props":200,"children":203},"span",{"class":201,"line":202},"line",1,[204],{"type":34,"tag":199,"props":205,"children":207},{"style":206},"--shiki-default:#6A737D",[208],{"type":40,"value":209},"// Command: write path — validated, transactional, produces domain events\n",{"type":34,"tag":199,"props":211,"children":213},{"class":201,"line":212},2,[214,220,225,231,237,242,247,252,257,262,266,271],{"type":34,"tag":199,"props":215,"children":217},{"style":216},"--shiki-default:#D73A49",[218],{"type":40,"value":219},"public",{"type":34,"tag":199,"props":221,"children":222},{"style":216},[223],{"type":40,"value":224}," class",{"type":34,"tag":199,"props":226,"children":228},{"style":227},"--shiki-default:#6F42C1",[229],{"type":40,"value":230}," CreateOrderCommandHandler",{"type":34,"tag":199,"props":232,"children":234},{"style":233},"--shiki-default:#24292E",[235],{"type":40,"value":236}," : ",{"type":34,"tag":199,"props":238,"children":239},{"style":227},[240],{"type":40,"value":241},"IRequestHandler",{"type":34,"tag":199,"props":243,"children":244},{"style":233},[245],{"type":40,"value":246},"\u003C",{"type":34,"tag":199,"props":248,"children":249},{"style":227},[250],{"type":40,"value":251},"CreateOrderCommand",{"type":34,"tag":199,"props":253,"children":254},{"style":233},[255],{"type":40,"value":256},", ",{"type":34,"tag":199,"props":258,"children":259},{"style":227},[260],{"type":40,"value":261},"Result",{"type":34,"tag":199,"props":263,"children":264},{"style":233},[265],{"type":40,"value":246},{"type":34,"tag":199,"props":267,"children":268},{"style":216},[269],{"type":40,"value":270},"int",{"type":34,"tag":199,"props":272,"children":273},{"style":233},[274],{"type":40,"value":275},">>\n",{"type":34,"tag":199,"props":277,"children":279},{"class":201,"line":278},3,[280],{"type":34,"tag":199,"props":281,"children":282},{"style":233},[283],{"type":40,"value":284},"{\n",{"type":34,"tag":199,"props":286,"children":288},{"class":201,"line":287},4,[289,294,299,304,309],{"type":34,"tag":199,"props":290,"children":291},{"style":216},[292],{"type":40,"value":293},"    private",{"type":34,"tag":199,"props":295,"children":296},{"style":216},[297],{"type":40,"value":298}," readonly",{"type":34,"tag":199,"props":300,"children":301},{"style":227},[302],{"type":40,"value":303}," IOrderRepository",{"type":34,"tag":199,"props":305,"children":306},{"style":227},[307],{"type":40,"value":308}," _orders",{"type":34,"tag":199,"props":310,"children":311},{"style":233},[312],{"type":40,"value":313},";\n",{"type":34,"tag":199,"props":315,"children":317},{"class":201,"line":316},5,[318,322,326,331,336],{"type":34,"tag":199,"props":319,"children":320},{"style":216},[321],{"type":40,"value":293},{"type":34,"tag":199,"props":323,"children":324},{"style":216},[325],{"type":40,"value":298},{"type":34,"tag":199,"props":327,"children":328},{"style":227},[329],{"type":40,"value":330}," IEventBus",{"type":34,"tag":199,"props":332,"children":333},{"style":227},[334],{"type":40,"value":335}," _events",{"type":34,"tag":199,"props":337,"children":338},{"style":233},[339],{"type":40,"value":313},{"type":34,"tag":199,"props":341,"children":343},{"class":201,"line":342},6,[344],{"type":34,"tag":199,"props":345,"children":347},{"emptyLinePlaceholder":346},true,[348],{"type":40,"value":349},"\n",{"type":34,"tag":199,"props":351,"children":353},{"class":201,"line":352},7,[354,359,364,369,373,377,381,385,390,395],{"type":34,"tag":199,"props":355,"children":356},{"style":216},[357],{"type":40,"value":358},"    public",{"type":34,"tag":199,"props":360,"children":361},{"style":216},[362],{"type":40,"value":363}," async",{"type":34,"tag":199,"props":365,"children":366},{"style":227},[367],{"type":40,"value":368}," Task",{"type":34,"tag":199,"props":370,"children":371},{"style":233},[372],{"type":40,"value":246},{"type":34,"tag":199,"props":374,"children":375},{"style":227},[376],{"type":40,"value":261},{"type":34,"tag":199,"props":378,"children":379},{"style":233},[380],{"type":40,"value":246},{"type":34,"tag":199,"props":382,"children":383},{"style":216},[384],{"type":40,"value":270},{"type":34,"tag":199,"props":386,"children":387},{"style":233},[388],{"type":40,"value":389},">> ",{"type":34,"tag":199,"props":391,"children":392},{"style":227},[393],{"type":40,"value":394},"Handle",{"type":34,"tag":199,"props":396,"children":397},{"style":233},[398],{"type":40,"value":399},"(\n",{"type":34,"tag":199,"props":401,"children":403},{"class":201,"line":402},8,[404,409,414],{"type":34,"tag":199,"props":405,"children":406},{"style":227},[407],{"type":40,"value":408},"        CreateOrderCommand",{"type":34,"tag":199,"props":410,"children":411},{"style":227},[412],{"type":40,"value":413}," cmd",{"type":34,"tag":199,"props":415,"children":416},{"style":233},[417],{"type":40,"value":418},",\n",{"type":34,"tag":199,"props":420,"children":422},{"class":201,"line":421},9,[423,428,433],{"type":34,"tag":199,"props":424,"children":425},{"style":227},[426],{"type":40,"value":427},"        CancellationToken",{"type":34,"tag":199,"props":429,"children":430},{"style":227},[431],{"type":40,"value":432}," ct",{"type":34,"tag":199,"props":434,"children":435},{"style":233},[436],{"type":40,"value":437},")\n",{"type":34,"tag":199,"props":439,"children":441},{"class":201,"line":440},10,[442],{"type":34,"tag":199,"props":443,"children":444},{"style":233},[445],{"type":40,"value":446},"    {\n",{"type":34,"tag":199,"props":448,"children":450},{"class":201,"line":449},11,[451,456,461,466,471,476],{"type":34,"tag":199,"props":452,"children":453},{"style":216},[454],{"type":40,"value":455},"        var",{"type":34,"tag":199,"props":457,"children":458},{"style":227},[459],{"type":40,"value":460}," order",{"type":34,"tag":199,"props":462,"children":463},{"style":216},[464],{"type":40,"value":465}," =",{"type":34,"tag":199,"props":467,"children":468},{"style":233},[469],{"type":40,"value":470}," Order.",{"type":34,"tag":199,"props":472,"children":473},{"style":227},[474],{"type":40,"value":475},"Create",{"type":34,"tag":199,"props":477,"children":478},{"style":233},[479],{"type":40,"value":480},"(cmd.CustomerId, cmd.Items);\n",{"type":34,"tag":199,"props":482,"children":484},{"class":201,"line":483},12,[485],{"type":34,"tag":199,"props":486,"children":487},{"emptyLinePlaceholder":346},[488],{"type":40,"value":349},{"type":34,"tag":199,"props":490,"children":492},{"class":201,"line":491},13,[493,498],{"type":34,"tag":199,"props":494,"children":495},{"style":216},[496],{"type":40,"value":497},"        if",{"type":34,"tag":199,"props":499,"children":500},{"style":233},[501],{"type":40,"value":502}," (order.IsFailure)\n",{"type":34,"tag":199,"props":504,"children":506},{"class":201,"line":505},14,[507,512,517,522,526,530],{"type":34,"tag":199,"props":508,"children":509},{"style":216},[510],{"type":40,"value":511},"            return",{"type":34,"tag":199,"props":513,"children":514},{"style":233},[515],{"type":40,"value":516}," Result.",{"type":34,"tag":199,"props":518,"children":519},{"style":227},[520],{"type":40,"value":521},"Failure",{"type":34,"tag":199,"props":523,"children":524},{"style":233},[525],{"type":40,"value":246},{"type":34,"tag":199,"props":527,"children":528},{"style":216},[529],{"type":40,"value":270},{"type":34,"tag":199,"props":531,"children":532},{"style":233},[533],{"type":40,"value":534},">(order.Error);\n",{"type":34,"tag":199,"props":536,"children":538},{"class":201,"line":537},15,[539],{"type":34,"tag":199,"props":540,"children":541},{"emptyLinePlaceholder":346},[542],{"type":40,"value":349},{"type":34,"tag":199,"props":544,"children":546},{"class":201,"line":545},16,[547,552,557,562],{"type":34,"tag":199,"props":548,"children":549},{"style":216},[550],{"type":40,"value":551},"        await",{"type":34,"tag":199,"props":553,"children":554},{"style":233},[555],{"type":40,"value":556}," _orders.",{"type":34,"tag":199,"props":558,"children":559},{"style":227},[560],{"type":40,"value":561},"SaveAsync",{"type":34,"tag":199,"props":563,"children":564},{"style":233},[565],{"type":40,"value":566},"(order.Value, ct);\n",{"type":34,"tag":199,"props":568,"children":570},{"class":201,"line":569},17,[571,575,580,585,590,595,600],{"type":34,"tag":199,"props":572,"children":573},{"style":216},[574],{"type":40,"value":551},{"type":34,"tag":199,"props":576,"children":577},{"style":233},[578],{"type":40,"value":579}," _events.",{"type":34,"tag":199,"props":581,"children":582},{"style":227},[583],{"type":40,"value":584},"PublishAsync",{"type":34,"tag":199,"props":586,"children":587},{"style":233},[588],{"type":40,"value":589},"(",{"type":34,"tag":199,"props":591,"children":592},{"style":216},[593],{"type":40,"value":594},"new",{"type":34,"tag":199,"props":596,"children":597},{"style":227},[598],{"type":40,"value":599}," OrderCreatedEvent",{"type":34,"tag":199,"props":601,"children":602},{"style":233},[603],{"type":40,"value":604},"(order.Value.Id), ct);\n",{"type":34,"tag":199,"props":606,"children":608},{"class":201,"line":607},18,[609],{"type":34,"tag":199,"props":610,"children":611},{"emptyLinePlaceholder":346},[612],{"type":40,"value":349},{"type":34,"tag":199,"props":614,"children":616},{"class":201,"line":615},19,[617,622,626,631],{"type":34,"tag":199,"props":618,"children":619},{"style":216},[620],{"type":40,"value":621},"        return",{"type":34,"tag":199,"props":623,"children":624},{"style":233},[625],{"type":40,"value":516},{"type":34,"tag":199,"props":627,"children":628},{"style":227},[629],{"type":40,"value":630},"Success",{"type":34,"tag":199,"props":632,"children":633},{"style":233},[634],{"type":40,"value":635},"(order.Value.Id);\n",{"type":34,"tag":199,"props":637,"children":639},{"class":201,"line":638},20,[640],{"type":34,"tag":199,"props":641,"children":642},{"style":233},[643],{"type":40,"value":644},"    }\n",{"type":34,"tag":199,"props":646,"children":648},{"class":201,"line":647},21,[649],{"type":34,"tag":199,"props":650,"children":651},{"style":233},[652],{"type":40,"value":653},"}\n",{"type":34,"tag":199,"props":655,"children":657},{"class":201,"line":656},22,[658],{"type":34,"tag":199,"props":659,"children":660},{"emptyLinePlaceholder":346},[661],{"type":40,"value":349},{"type":34,"tag":199,"props":663,"children":665},{"class":201,"line":664},23,[666],{"type":34,"tag":199,"props":667,"children":668},{"style":206},[669],{"type":40,"value":670},"// Query: read path — optimised for speed, no domain model overhead\n",{"type":34,"tag":199,"props":672,"children":674},{"class":201,"line":673},24,[675,679,683,688,692,696,700,705,709,714],{"type":34,"tag":199,"props":676,"children":677},{"style":216},[678],{"type":40,"value":219},{"type":34,"tag":199,"props":680,"children":681},{"style":216},[682],{"type":40,"value":224},{"type":34,"tag":199,"props":684,"children":685},{"style":227},[686],{"type":40,"value":687}," GetOrderSummaryQueryHandler",{"type":34,"tag":199,"props":689,"children":690},{"style":233},[691],{"type":40,"value":236},{"type":34,"tag":199,"props":693,"children":694},{"style":227},[695],{"type":40,"value":241},{"type":34,"tag":199,"props":697,"children":698},{"style":233},[699],{"type":40,"value":246},{"type":34,"tag":199,"props":701,"children":702},{"style":227},[703],{"type":40,"value":704},"GetOrderSummaryQuery",{"type":34,"tag":199,"props":706,"children":707},{"style":233},[708],{"type":40,"value":256},{"type":34,"tag":199,"props":710,"children":711},{"style":227},[712],{"type":40,"value":713},"OrderSummaryDto",{"type":34,"tag":199,"props":715,"children":716},{"style":233},[717],{"type":40,"value":718},">\n",{"type":34,"tag":199,"props":720,"children":722},{"class":201,"line":721},25,[723],{"type":34,"tag":199,"props":724,"children":725},{"style":233},[726],{"type":40,"value":284},{"type":34,"tag":199,"props":728,"children":730},{"class":201,"line":729},26,[731,735,739,744,749],{"type":34,"tag":199,"props":732,"children":733},{"style":216},[734],{"type":40,"value":293},{"type":34,"tag":199,"props":736,"children":737},{"style":216},[738],{"type":40,"value":298},{"type":34,"tag":199,"props":740,"children":741},{"style":227},[742],{"type":40,"value":743}," IDbConnection",{"type":34,"tag":199,"props":745,"children":746},{"style":227},[747],{"type":40,"value":748}," _db",{"type":34,"tag":199,"props":750,"children":751},{"style":233},[752],{"type":40,"value":313},{"type":34,"tag":199,"props":754,"children":756},{"class":201,"line":755},27,[757],{"type":34,"tag":199,"props":758,"children":759},{"emptyLinePlaceholder":346},[760],{"type":40,"value":349},{"type":34,"tag":199,"props":762,"children":764},{"class":201,"line":763},28,[765,769,773,777,781,785,790,794,798,802,807,811,816,820],{"type":34,"tag":199,"props":766,"children":767},{"style":216},[768],{"type":40,"value":358},{"type":34,"tag":199,"props":770,"children":771},{"style":216},[772],{"type":40,"value":363},{"type":34,"tag":199,"props":774,"children":775},{"style":227},[776],{"type":40,"value":368},{"type":34,"tag":199,"props":778,"children":779},{"style":233},[780],{"type":40,"value":246},{"type":34,"tag":199,"props":782,"children":783},{"style":227},[784],{"type":40,"value":713},{"type":34,"tag":199,"props":786,"children":787},{"style":233},[788],{"type":40,"value":789},"> ",{"type":34,"tag":199,"props":791,"children":792},{"style":227},[793],{"type":40,"value":394},{"type":34,"tag":199,"props":795,"children":796},{"style":233},[797],{"type":40,"value":589},{"type":34,"tag":199,"props":799,"children":800},{"style":227},[801],{"type":40,"value":704},{"type":34,"tag":199,"props":803,"children":804},{"style":227},[805],{"type":40,"value":806}," query",{"type":34,"tag":199,"props":808,"children":809},{"style":233},[810],{"type":40,"value":256},{"type":34,"tag":199,"props":812,"children":813},{"style":227},[814],{"type":40,"value":815},"CancellationToken",{"type":34,"tag":199,"props":817,"children":818},{"style":227},[819],{"type":40,"value":432},{"type":34,"tag":199,"props":821,"children":822},{"style":233},[823],{"type":40,"value":437},{"type":34,"tag":199,"props":825,"children":827},{"class":201,"line":826},29,[828],{"type":34,"tag":199,"props":829,"children":830},{"style":233},[831],{"type":40,"value":446},{"type":34,"tag":199,"props":833,"children":835},{"class":201,"line":834},30,[836],{"type":34,"tag":199,"props":837,"children":838},{"style":206},[839],{"type":40,"value":840},"        // Direct Dapper query against denormalised read model — sub-10ms\n",{"type":34,"tag":199,"props":842,"children":844},{"class":201,"line":843},31,[845,849,854,859,864,868,872],{"type":34,"tag":199,"props":846,"children":847},{"style":216},[848],{"type":40,"value":621},{"type":34,"tag":199,"props":850,"children":851},{"style":216},[852],{"type":40,"value":853}," await",{"type":34,"tag":199,"props":855,"children":856},{"style":233},[857],{"type":40,"value":858}," _db.",{"type":34,"tag":199,"props":860,"children":861},{"style":227},[862],{"type":40,"value":863},"QuerySingleAsync",{"type":34,"tag":199,"props":865,"children":866},{"style":233},[867],{"type":40,"value":246},{"type":34,"tag":199,"props":869,"children":870},{"style":227},[871],{"type":40,"value":713},{"type":34,"tag":199,"props":873,"children":874},{"style":233},[875],{"type":40,"value":876},">(\n",{"type":34,"tag":199,"props":878,"children":880},{"class":201,"line":879},32,[881,887],{"type":34,"tag":199,"props":882,"children":884},{"style":883},"--shiki-default:#032F62",[885],{"type":40,"value":886},"            \"SELECT * FROM v_order_summaries WHERE id = @Id\"",{"type":34,"tag":199,"props":888,"children":889},{"style":233},[890],{"type":40,"value":418},{"type":34,"tag":199,"props":892,"children":894},{"class":201,"line":893},33,[895,900],{"type":34,"tag":199,"props":896,"children":897},{"style":216},[898],{"type":40,"value":899},"            new",{"type":34,"tag":199,"props":901,"children":902},{"style":233},[903],{"type":40,"value":904}," { query.Id });\n",{"type":34,"tag":199,"props":906,"children":908},{"class":201,"line":907},34,[909],{"type":34,"tag":199,"props":910,"children":911},{"style":233},[912],{"type":40,"value":644},{"type":34,"tag":199,"props":914,"children":916},{"class":201,"line":915},35,[917],{"type":34,"tag":199,"props":918,"children":919},{"style":233},[920],{"type":40,"value":653},{"type":34,"tag":43,"props":922,"children":923},{},[924,926,931,933,938,940,945],{"type":40,"value":925},"Key decisions that paid off: ",{"type":34,"tag":62,"props":927,"children":928},{},[929],{"type":40,"value":930},"MediatR",{"type":40,"value":932}," for decoupled command/query dispatch, ",{"type":34,"tag":62,"props":934,"children":935},{},[936],{"type":40,"value":937},"Azure Service Bus",{"type":40,"value":939}," for asynchronous cross-service communication, and ",{"type":34,"tag":62,"props":941,"children":942},{},[943],{"type":40,"value":944},"Redis",{"type":40,"value":946}," for hot product catalogue data with a 94% cache hit rate in production.",{"type":34,"tag":176,"props":948,"children":950},{"id":949},"frontend-nuxt-3-with-server-side-rendering",[951],{"type":40,"value":952},"Frontend: Nuxt 3 with Server-Side Rendering",{"type":34,"tag":43,"props":954,"children":955},{},[956],{"type":40,"value":957},"The customer-facing frontend was rebuilt in Nuxt 3 with SSR enabled for all product and checkout pages — critical for both SEO and perceived performance on slow mobile connections.",{"type":34,"tag":188,"props":959,"children":963},{"className":960,"code":961,"language":962,"meta":7,"style":7},"language-typescript shiki shiki-themes github-light","// Nuxt 3 composable: type-safe product fetching with caching\nconst useProduct = (id: string) => {\n  return useAsyncData(\n    `product-${id}`,\n    () => $fetch\u003CProduct>(`/api/products/${id}`),\n    {\n      // Cache in Nuxt's built-in data layer — no duplicate requests\n      dedupe: 'defer',\n      transform: (data) => ({\n        ...data,\n        // Pre-format price on server to avoid hydration mismatch\n        formattedPrice: new Intl.NumberFormat('nl-NL', {\n          style: 'currency',\n          currency: 'EUR',\n        }).format(data.price),\n      }),\n    }\n  );\n};\n","typescript",[964],{"type":34,"tag":195,"props":965,"children":966},{"__ignoreMap":7},[967,975,1029,1046,1067,1116,1123,1131,1148,1179,1192,1200,1236,1253,1270,1288,1296,1303,1311],{"type":34,"tag":199,"props":968,"children":969},{"class":201,"line":202},[970],{"type":34,"tag":199,"props":971,"children":972},{"style":206},[973],{"type":40,"value":974},"// Nuxt 3 composable: type-safe product fetching with caching\n",{"type":34,"tag":199,"props":976,"children":977},{"class":201,"line":212},[978,983,988,992,997,1003,1008,1014,1019,1024],{"type":34,"tag":199,"props":979,"children":980},{"style":216},[981],{"type":40,"value":982},"const",{"type":34,"tag":199,"props":984,"children":985},{"style":227},[986],{"type":40,"value":987}," useProduct",{"type":34,"tag":199,"props":989,"children":990},{"style":216},[991],{"type":40,"value":465},{"type":34,"tag":199,"props":993,"children":994},{"style":233},[995],{"type":40,"value":996}," (",{"type":34,"tag":199,"props":998,"children":1000},{"style":999},"--shiki-default:#E36209",[1001],{"type":40,"value":1002},"id",{"type":34,"tag":199,"props":1004,"children":1005},{"style":216},[1006],{"type":40,"value":1007},":",{"type":34,"tag":199,"props":1009,"children":1011},{"style":1010},"--shiki-default:#005CC5",[1012],{"type":40,"value":1013}," string",{"type":34,"tag":199,"props":1015,"children":1016},{"style":233},[1017],{"type":40,"value":1018},") ",{"type":34,"tag":199,"props":1020,"children":1021},{"style":216},[1022],{"type":40,"value":1023},"=>",{"type":34,"tag":199,"props":1025,"children":1026},{"style":233},[1027],{"type":40,"value":1028}," {\n",{"type":34,"tag":199,"props":1030,"children":1031},{"class":201,"line":278},[1032,1037,1042],{"type":34,"tag":199,"props":1033,"children":1034},{"style":216},[1035],{"type":40,"value":1036},"  return",{"type":34,"tag":199,"props":1038,"children":1039},{"style":227},[1040],{"type":40,"value":1041}," useAsyncData",{"type":34,"tag":199,"props":1043,"children":1044},{"style":233},[1045],{"type":40,"value":399},{"type":34,"tag":199,"props":1047,"children":1048},{"class":201,"line":287},[1049,1054,1058,1063],{"type":34,"tag":199,"props":1050,"children":1051},{"style":883},[1052],{"type":40,"value":1053},"    `product-${",{"type":34,"tag":199,"props":1055,"children":1056},{"style":233},[1057],{"type":40,"value":1002},{"type":34,"tag":199,"props":1059,"children":1060},{"style":883},[1061],{"type":40,"value":1062},"}`",{"type":34,"tag":199,"props":1064,"children":1065},{"style":233},[1066],{"type":40,"value":418},{"type":34,"tag":199,"props":1068,"children":1069},{"class":201,"line":316},[1070,1075,1079,1084,1088,1093,1098,1103,1107,1111],{"type":34,"tag":199,"props":1071,"children":1072},{"style":233},[1073],{"type":40,"value":1074},"    () ",{"type":34,"tag":199,"props":1076,"children":1077},{"style":216},[1078],{"type":40,"value":1023},{"type":34,"tag":199,"props":1080,"children":1081},{"style":227},[1082],{"type":40,"value":1083}," $fetch",{"type":34,"tag":199,"props":1085,"children":1086},{"style":233},[1087],{"type":40,"value":246},{"type":34,"tag":199,"props":1089,"children":1090},{"style":227},[1091],{"type":40,"value":1092},"Product",{"type":34,"tag":199,"props":1094,"children":1095},{"style":233},[1096],{"type":40,"value":1097},">(",{"type":34,"tag":199,"props":1099,"children":1100},{"style":883},[1101],{"type":40,"value":1102},"`/api/products/${",{"type":34,"tag":199,"props":1104,"children":1105},{"style":233},[1106],{"type":40,"value":1002},{"type":34,"tag":199,"props":1108,"children":1109},{"style":883},[1110],{"type":40,"value":1062},{"type":34,"tag":199,"props":1112,"children":1113},{"style":233},[1114],{"type":40,"value":1115},"),\n",{"type":34,"tag":199,"props":1117,"children":1118},{"class":201,"line":342},[1119],{"type":34,"tag":199,"props":1120,"children":1121},{"style":233},[1122],{"type":40,"value":446},{"type":34,"tag":199,"props":1124,"children":1125},{"class":201,"line":352},[1126],{"type":34,"tag":199,"props":1127,"children":1128},{"style":206},[1129],{"type":40,"value":1130},"      // Cache in Nuxt's built-in data layer — no duplicate requests\n",{"type":34,"tag":199,"props":1132,"children":1133},{"class":201,"line":402},[1134,1139,1144],{"type":34,"tag":199,"props":1135,"children":1136},{"style":233},[1137],{"type":40,"value":1138},"      dedupe: ",{"type":34,"tag":199,"props":1140,"children":1141},{"style":883},[1142],{"type":40,"value":1143},"'defer'",{"type":34,"tag":199,"props":1145,"children":1146},{"style":233},[1147],{"type":40,"value":418},{"type":34,"tag":199,"props":1149,"children":1150},{"class":201,"line":421},[1151,1156,1161,1166,1170,1174],{"type":34,"tag":199,"props":1152,"children":1153},{"style":227},[1154],{"type":40,"value":1155},"      transform",{"type":34,"tag":199,"props":1157,"children":1158},{"style":233},[1159],{"type":40,"value":1160},": (",{"type":34,"tag":199,"props":1162,"children":1163},{"style":999},[1164],{"type":40,"value":1165},"data",{"type":34,"tag":199,"props":1167,"children":1168},{"style":233},[1169],{"type":40,"value":1018},{"type":34,"tag":199,"props":1171,"children":1172},{"style":216},[1173],{"type":40,"value":1023},{"type":34,"tag":199,"props":1175,"children":1176},{"style":233},[1177],{"type":40,"value":1178}," ({\n",{"type":34,"tag":199,"props":1180,"children":1181},{"class":201,"line":440},[1182,1187],{"type":34,"tag":199,"props":1183,"children":1184},{"style":216},[1185],{"type":40,"value":1186},"        ...",{"type":34,"tag":199,"props":1188,"children":1189},{"style":233},[1190],{"type":40,"value":1191},"data,\n",{"type":34,"tag":199,"props":1193,"children":1194},{"class":201,"line":449},[1195],{"type":34,"tag":199,"props":1196,"children":1197},{"style":206},[1198],{"type":40,"value":1199},"        // Pre-format price on server to avoid hydration mismatch\n",{"type":34,"tag":199,"props":1201,"children":1202},{"class":201,"line":483},[1203,1208,1212,1217,1222,1226,1231],{"type":34,"tag":199,"props":1204,"children":1205},{"style":233},[1206],{"type":40,"value":1207},"        formattedPrice: ",{"type":34,"tag":199,"props":1209,"children":1210},{"style":216},[1211],{"type":40,"value":594},{"type":34,"tag":199,"props":1213,"children":1214},{"style":233},[1215],{"type":40,"value":1216}," Intl.",{"type":34,"tag":199,"props":1218,"children":1219},{"style":227},[1220],{"type":40,"value":1221},"NumberFormat",{"type":34,"tag":199,"props":1223,"children":1224},{"style":233},[1225],{"type":40,"value":589},{"type":34,"tag":199,"props":1227,"children":1228},{"style":883},[1229],{"type":40,"value":1230},"'nl-NL'",{"type":34,"tag":199,"props":1232,"children":1233},{"style":233},[1234],{"type":40,"value":1235},", {\n",{"type":34,"tag":199,"props":1237,"children":1238},{"class":201,"line":491},[1239,1244,1249],{"type":34,"tag":199,"props":1240,"children":1241},{"style":233},[1242],{"type":40,"value":1243},"          style: ",{"type":34,"tag":199,"props":1245,"children":1246},{"style":883},[1247],{"type":40,"value":1248},"'currency'",{"type":34,"tag":199,"props":1250,"children":1251},{"style":233},[1252],{"type":40,"value":418},{"type":34,"tag":199,"props":1254,"children":1255},{"class":201,"line":505},[1256,1261,1266],{"type":34,"tag":199,"props":1257,"children":1258},{"style":233},[1259],{"type":40,"value":1260},"          currency: ",{"type":34,"tag":199,"props":1262,"children":1263},{"style":883},[1264],{"type":40,"value":1265},"'EUR'",{"type":34,"tag":199,"props":1267,"children":1268},{"style":233},[1269],{"type":40,"value":418},{"type":34,"tag":199,"props":1271,"children":1272},{"class":201,"line":537},[1273,1278,1283],{"type":34,"tag":199,"props":1274,"children":1275},{"style":233},[1276],{"type":40,"value":1277},"        }).",{"type":34,"tag":199,"props":1279,"children":1280},{"style":227},[1281],{"type":40,"value":1282},"format",{"type":34,"tag":199,"props":1284,"children":1285},{"style":233},[1286],{"type":40,"value":1287},"(data.price),\n",{"type":34,"tag":199,"props":1289,"children":1290},{"class":201,"line":545},[1291],{"type":34,"tag":199,"props":1292,"children":1293},{"style":233},[1294],{"type":40,"value":1295},"      }),\n",{"type":34,"tag":199,"props":1297,"children":1298},{"class":201,"line":569},[1299],{"type":34,"tag":199,"props":1300,"children":1301},{"style":233},[1302],{"type":40,"value":644},{"type":34,"tag":199,"props":1304,"children":1305},{"class":201,"line":607},[1306],{"type":34,"tag":199,"props":1307,"children":1308},{"style":233},[1309],{"type":40,"value":1310},"  );\n",{"type":34,"tag":199,"props":1312,"children":1313},{"class":201,"line":615},[1314],{"type":34,"tag":199,"props":1315,"children":1316},{"style":233},[1317],{"type":40,"value":1318},"};\n",{"type":34,"tag":43,"props":1320,"children":1321},{},[1322],{"type":40,"value":1323},"We implemented Tailwind CSS for consistent utility-first styling, Pinia for client-side state (cart, wishlist, user session), and lazy-loaded non-critical components to keep initial JS bundles under 120kB.",{"type":34,"tag":35,"props":1325,"children":1327},{"id":1326},"measuring-what-matters",[1328],{"type":40,"value":1329},"Measuring What Matters",{"type":34,"tag":43,"props":1331,"children":1332},{},[1333],{"type":40,"value":1334},"We tracked three categories of metrics from day one:",{"type":34,"tag":176,"props":1336,"children":1338},{"id":1337},"performance-lighthouse-real-user-monitoring",[1339],{"type":40,"value":1340},"Performance (Lighthouse, Real User Monitoring)",{"type":34,"tag":1342,"props":1343,"children":1344},"table",{},[1345,1374],{"type":34,"tag":1346,"props":1347,"children":1348},"thead",{},[1349],{"type":34,"tag":1350,"props":1351,"children":1352},"tr",{},[1353,1359,1364,1369],{"type":34,"tag":1354,"props":1355,"children":1356},"th",{},[1357],{"type":40,"value":1358},"Metric",{"type":34,"tag":1354,"props":1360,"children":1361},{},[1362],{"type":40,"value":1363},"Before",{"type":34,"tag":1354,"props":1365,"children":1366},{},[1367],{"type":40,"value":1368},"After",{"type":34,"tag":1354,"props":1370,"children":1371},{},[1372],{"type":40,"value":1373},"Change",{"type":34,"tag":1375,"props":1376,"children":1377},"tbody",{},[1378,1405,1431,1457],{"type":34,"tag":1350,"props":1379,"children":1380},{},[1381,1387,1392,1397],{"type":34,"tag":1382,"props":1383,"children":1384},"td",{},[1385],{"type":40,"value":1386},"Page load time (median)",{"type":34,"tag":1382,"props":1388,"children":1389},{},[1390],{"type":40,"value":1391},"5.2s",{"type":34,"tag":1382,"props":1393,"children":1394},{},[1395],{"type":40,"value":1396},"1.8s",{"type":34,"tag":1382,"props":1398,"children":1399},{},[1400],{"type":34,"tag":62,"props":1401,"children":1402},{},[1403],{"type":40,"value":1404},"−65%",{"type":34,"tag":1350,"props":1406,"children":1407},{},[1408,1413,1418,1423],{"type":34,"tag":1382,"props":1409,"children":1410},{},[1411],{"type":40,"value":1412},"Server response time",{"type":34,"tag":1382,"props":1414,"children":1415},{},[1416],{"type":40,"value":1417},"850ms",{"type":34,"tag":1382,"props":1419,"children":1420},{},[1421],{"type":40,"value":1422},"120ms",{"type":34,"tag":1382,"props":1424,"children":1425},{},[1426],{"type":34,"tag":62,"props":1427,"children":1428},{},[1429],{"type":40,"value":1430},"−86%",{"type":34,"tag":1350,"props":1432,"children":1433},{},[1434,1439,1444,1449],{"type":34,"tag":1382,"props":1435,"children":1436},{},[1437],{"type":40,"value":1438},"Lighthouse Performance",{"type":34,"tag":1382,"props":1440,"children":1441},{},[1442],{"type":40,"value":1443},"42",{"type":34,"tag":1382,"props":1445,"children":1446},{},[1447],{"type":40,"value":1448},"89",{"type":34,"tag":1382,"props":1450,"children":1451},{},[1452],{"type":34,"tag":62,"props":1453,"children":1454},{},[1455],{"type":40,"value":1456},"+112%",{"type":34,"tag":1350,"props":1458,"children":1459},{},[1460,1465,1470,1475],{"type":34,"tag":1382,"props":1461,"children":1462},{},[1463],{"type":40,"value":1464},"Core Web Vitals (LCP)",{"type":34,"tag":1382,"props":1466,"children":1467},{},[1468],{"type":40,"value":1469},"6.1s",{"type":34,"tag":1382,"props":1471,"children":1472},{},[1473],{"type":40,"value":1474},"1.9s",{"type":34,"tag":1382,"props":1476,"children":1477},{},[1478],{"type":40,"value":1479},"✅ Good",{"type":34,"tag":176,"props":1481,"children":1483},{"id":1482},"business-metrics-3-months-post-launch",[1484],{"type":40,"value":1485},"Business Metrics (3 months post-launch)",{"type":34,"tag":1342,"props":1487,"children":1488},{},[1489,1511],{"type":34,"tag":1346,"props":1490,"children":1491},{},[1492],{"type":34,"tag":1350,"props":1493,"children":1494},{},[1495,1499,1503,1507],{"type":34,"tag":1354,"props":1496,"children":1497},{},[1498],{"type":40,"value":1358},{"type":34,"tag":1354,"props":1500,"children":1501},{},[1502],{"type":40,"value":1363},{"type":34,"tag":1354,"props":1504,"children":1505},{},[1506],{"type":40,"value":1368},{"type":34,"tag":1354,"props":1508,"children":1509},{},[1510],{"type":40,"value":1373},{"type":34,"tag":1375,"props":1512,"children":1513},{},[1514,1537,1558,1584],{"type":34,"tag":1350,"props":1515,"children":1516},{},[1517,1522,1527,1532],{"type":34,"tag":1382,"props":1518,"children":1519},{},[1520],{"type":40,"value":1521},"Conversion rate",{"type":34,"tag":1382,"props":1523,"children":1524},{},[1525],{"type":40,"value":1526},"baseline",{"type":34,"tag":1382,"props":1528,"children":1529},{},[1530],{"type":40,"value":1531},"+28%",{"type":34,"tag":1382,"props":1533,"children":1534},{},[1535],{"type":40,"value":1536},"📈",{"type":34,"tag":1350,"props":1538,"children":1539},{},[1540,1545,1549,1554],{"type":34,"tag":1382,"props":1541,"children":1542},{},[1543],{"type":40,"value":1544},"Mobile orders",{"type":34,"tag":1382,"props":1546,"children":1547},{},[1548],{"type":40,"value":1526},{"type":34,"tag":1382,"props":1550,"children":1551},{},[1552],{"type":40,"value":1553},"+47%",{"type":34,"tag":1382,"props":1555,"children":1556},{},[1557],{"type":40,"value":1536},{"type":34,"tag":1350,"props":1559,"children":1560},{},[1561,1566,1571,1576],{"type":34,"tag":1382,"props":1562,"children":1563},{},[1564],{"type":40,"value":1565},"Cart abandonment",{"type":34,"tag":1382,"props":1567,"children":1568},{},[1569],{"type":40,"value":1570},"62%",{"type":34,"tag":1382,"props":1572,"children":1573},{},[1574],{"type":40,"value":1575},"41%",{"type":34,"tag":1382,"props":1577,"children":1578},{},[1579],{"type":34,"tag":62,"props":1580,"children":1581},{},[1582],{"type":40,"value":1583},"−34%",{"type":34,"tag":1350,"props":1585,"children":1586},{},[1587,1592,1596,1601],{"type":34,"tag":1382,"props":1588,"children":1589},{},[1590],{"type":40,"value":1591},"Average order value",{"type":34,"tag":1382,"props":1593,"children":1594},{},[1595],{"type":40,"value":1526},{"type":34,"tag":1382,"props":1597,"children":1598},{},[1599],{"type":40,"value":1600},"+12%",{"type":34,"tag":1382,"props":1602,"children":1603},{},[1604],{"type":40,"value":1536},{"type":34,"tag":176,"props":1606,"children":1608},{"id":1607},"engineering-velocity",[1609],{"type":40,"value":1610},"Engineering Velocity",{"type":34,"tag":1342,"props":1612,"children":1613},{},[1614,1632],{"type":34,"tag":1346,"props":1615,"children":1616},{},[1617],{"type":34,"tag":1350,"props":1618,"children":1619},{},[1620,1624,1628],{"type":34,"tag":1354,"props":1621,"children":1622},{},[1623],{"type":40,"value":1358},{"type":34,"tag":1354,"props":1625,"children":1626},{},[1627],{"type":40,"value":1363},{"type":34,"tag":1354,"props":1629,"children":1630},{},[1631],{"type":40,"value":1368},{"type":34,"tag":1375,"props":1633,"children":1634},{},[1635,1653,1670,1688],{"type":34,"tag":1350,"props":1636,"children":1637},{},[1638,1643,1648],{"type":34,"tag":1382,"props":1639,"children":1640},{},[1641],{"type":40,"value":1642},"Deploy frequency",{"type":34,"tag":1382,"props":1644,"children":1645},{},[1646],{"type":40,"value":1647},"monthly",{"type":34,"tag":1382,"props":1649,"children":1650},{},[1651],{"type":40,"value":1652},"3–4× per week",{"type":34,"tag":1350,"props":1654,"children":1655},{},[1656,1661,1665],{"type":34,"tag":1382,"props":1657,"children":1658},{},[1659],{"type":40,"value":1660},"Deploy-related incidents",{"type":34,"tag":1382,"props":1662,"children":1663},{},[1664],{"type":40,"value":1526},{"type":34,"tag":1382,"props":1666,"children":1667},{},[1668],{"type":40,"value":1669},"−92%",{"type":34,"tag":1350,"props":1671,"children":1672},{},[1673,1678,1683],{"type":34,"tag":1382,"props":1674,"children":1675},{},[1676],{"type":40,"value":1677},"Mean time to recovery",{"type":34,"tag":1382,"props":1679,"children":1680},{},[1681],{"type":40,"value":1682},"hours",{"type":34,"tag":1382,"props":1684,"children":1685},{},[1686],{"type":40,"value":1687},"minutes",{"type":34,"tag":1350,"props":1689,"children":1690},{},[1691,1696,1701],{"type":34,"tag":1382,"props":1692,"children":1693},{},[1694],{"type":40,"value":1695},"Onboarding time (new dev)",{"type":34,"tag":1382,"props":1697,"children":1698},{},[1699],{"type":40,"value":1700},"~3 weeks",{"type":34,"tag":1382,"props":1702,"children":1703},{},[1704],{"type":40,"value":1705},"~4 days",{"type":34,"tag":35,"props":1707,"children":1709},{"id":1708},"the-lessons-that-carried-forward",[1710],{"type":40,"value":1711},"The Lessons That Carried Forward",{"type":34,"tag":43,"props":1713,"children":1714},{},[1715,1720],{"type":34,"tag":62,"props":1716,"children":1717},{},[1718],{"type":40,"value":1719},"Start where the customer feels the pain.",{"type":40,"value":1721}," We rebuilt the checkout flow in month three, before the product catalogue was even finished on the new stack. A 28% conversion lift started accumulating six months before the migration completed.",{"type":34,"tag":43,"props":1723,"children":1724},{},[1725,1730],{"type":34,"tag":62,"props":1726,"children":1727},{},[1728],{"type":40,"value":1729},"Invest in observability from week one.",{"type":40,"value":1731}," We instrumented every API endpoint with Azure Application Insights on day one. Without real latency data, we would have optimised the wrong things. With it, we identified that 70% of total response time came from two database queries — both fixable.",{"type":34,"tag":43,"props":1733,"children":1734},{},[1735,1740],{"type":34,"tag":62,"props":1736,"children":1737},{},[1738],{"type":40,"value":1739},"Strangler is slower to start, faster to finish.",{"type":40,"value":1741}," The first two months felt slow — no visible user-facing changes. But by month four, we were shipping multiple features per week to a progressively growing slice of real production traffic, validating changes with real users rather than staging assumptions.",{"type":34,"tag":43,"props":1743,"children":1744},{},[1745],{"type":40,"value":1746},"The modernised FreshMarket platform now handles 5× the peak traffic of the old system, on 30% less infrastructure spend. More importantly, the team ships with confidence — because the architecture was built to evolve.",{"type":34,"tag":1748,"props":1749,"children":1750},"style",{},[1751],{"type":40,"value":1752},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":278,"depth":278,"links":1754},[1755,1756,1757,1761,1766],{"id":37,"depth":212,"text":41},{"id":101,"depth":212,"text":104},{"id":171,"depth":212,"text":174,"children":1758},[1759,1760],{"id":178,"depth":278,"text":181},{"id":949,"depth":278,"text":952},{"id":1326,"depth":212,"text":1329,"children":1762},[1763,1764,1765],{"id":1337,"depth":278,"text":1340},{"id":1482,"depth":278,"text":1485},{"id":1607,"depth":278,"text":1610},{"id":1708,"depth":212,"text":1711},"markdown","content:blog:ecommerce-platform-case-study.md","content","blog/ecommerce-platform-case-study.md","blog/ecommerce-platform-case-study","md",[1774,2431,4548],{"_path":1775,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":1776,"description":1777,"slug":1778,"date":1779,"readTime":1780,"category":1781,"image":1782,"imageCaption":1783,"author":1784,"tags":1786,"body":1792,"_type":1767,"_id":2428,"_source":1769,"_file":2429,"_stem":2430,"_extension":1772},"/blog/azure-architecture-patterns","Scalable Azure Architecture Patterns Every Cloud Engineer Should Know in 2025","Explore the proven Azure architecture patterns—from Container Apps microservices to multi-region high availability—that MediaFront uses to build resilient, cost-efficient cloud applications.","azure-architecture-patterns","2025-04-10","10 min","Cloud","https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=1200&h=600&fit=crop&auto=format","Azure cloud infrastructure supporting modern microservices at global scale",{"name":17,"role":18,"avatar":19,"bio":20,"social":1785},{"github":22,"twitter":23,"linkedin":24},[1787,1788,1789,1790,1791],"Azure","Cloud Architecture","Microservices","Containers","DevOps",{"type":31,"children":1793,"toc":2417},[1794,1800,1805,1811,1816,1821,1864,1869,1877,1882,1888,1893,1898,1988,1993,1999,2004,2037,2042,2048,2053,2105,2110,2116,2121,2129,2134,2140,2145,2188,2194,2199,2341,2354,2360,2365,2408,2413],{"type":34,"tag":35,"props":1795,"children":1797},{"id":1796},"why-azure-architecture-decisions-matter-more-than-ever",[1798],{"type":40,"value":1799},"Why Azure Architecture Decisions Matter More Than Ever",{"type":34,"tag":43,"props":1801,"children":1802},{},[1803],{"type":40,"value":1804},"Choosing the wrong architecture pattern on Azure can cost a company thousands of euros per month in wasted compute and dozens of engineering hours untangling bottlenecks. Choose well, and you get an application that scales automatically, stays resilient under pressure, and grows with your business. This guide covers the five patterns we deploy most frequently at MediaFront and why each one earns its place in a modern cloud stack.",{"type":34,"tag":35,"props":1806,"children":1808},{"id":1807},"microservices-with-azure-container-apps",[1809],{"type":40,"value":1810},"Microservices with Azure Container Apps",{"type":34,"tag":43,"props":1812,"children":1813},{},[1814],{"type":40,"value":1815},"Azure Container Apps is the sweet spot between the simplicity of App Service and the raw power of AKS. It runs your containers on a serverless runtime, so you pay only for what you use while gaining all the benefits of orchestration.",{"type":34,"tag":43,"props":1817,"children":1818},{},[1819],{"type":40,"value":1820},"Key capabilities that matter in production:",{"type":34,"tag":54,"props":1822,"children":1823},{},[1824,1834,1844,1854],{"type":34,"tag":58,"props":1825,"children":1826},{},[1827,1832],{"type":34,"tag":62,"props":1828,"children":1829},{},[1830],{"type":40,"value":1831},"HTTP and event-driven scaling",{"type":40,"value":1833}," — scale a service to zero when idle, spike to hundreds of replicas during peak load without a single YAML manifest change",{"type":34,"tag":58,"props":1835,"children":1836},{},[1837,1842],{"type":34,"tag":62,"props":1838,"children":1839},{},[1840],{"type":40,"value":1841},"Revision management",{"type":40,"value":1843}," — deploy a new version, split traffic 90/10 between old and new, then cut over once telemetry confirms stability",{"type":34,"tag":58,"props":1845,"children":1846},{},[1847,1852],{"type":34,"tag":62,"props":1848,"children":1849},{},[1850],{"type":40,"value":1851},"Built-in service-to-service communication",{"type":40,"value":1853}," via Dapr sidecars, removing the networking boilerplate you'd otherwise write by hand",{"type":34,"tag":58,"props":1855,"children":1856},{},[1857,1862],{"type":34,"tag":62,"props":1858,"children":1859},{},[1860],{"type":40,"value":1861},"gRPC and WebSocket support",{"type":40,"value":1863}," — not just REST",{"type":34,"tag":43,"props":1865,"children":1866},{},[1867],{"type":40,"value":1868},"A typical three-tier architecture we ship looks like this:",{"type":34,"tag":188,"props":1870,"children":1872},{"code":1871},"Azure API Management\n  ├── Auth Service        (Container App — scales to 0 at night)\n  ├── Catalogue Service   (Container App — scales 1–20 replicas)\n  │     └── Azure Cosmos DB (multi-region writes)\n  ├── Order Service       (Container App)\n  │     └── Azure SQL     (zone-redundant)\n  └── Notification Service (Container App)\n        └── Azure Service Bus (Standard tier)\n",[1873],{"type":34,"tag":195,"props":1874,"children":1875},{"__ignoreMap":7},[1876],{"type":40,"value":1871},{"type":34,"tag":43,"props":1878,"children":1879},{},[1880],{"type":40,"value":1881},"Each service owns its data store and communicates through well-defined contracts. Teams can deploy independently, and a failure in the Notification Service never cascades into the Order Service.",{"type":34,"tag":35,"props":1883,"children":1885},{"id":1884},"event-driven-architecture-with-event-grid-and-functions",[1886],{"type":40,"value":1887},"Event-Driven Architecture with Event Grid and Functions",{"type":34,"tag":43,"props":1889,"children":1890},{},[1891],{"type":40,"value":1892},"When your system needs to react to things that happen — a file upload, a payment completing, a sensor reading arriving — an event-driven backbone beats tight REST coupling every time.",{"type":34,"tag":43,"props":1894,"children":1895},{},[1896],{"type":40,"value":1897},"Azure gives you three complementary messaging primitives:",{"type":34,"tag":1342,"props":1899,"children":1900},{},[1901,1922],{"type":34,"tag":1346,"props":1902,"children":1903},{},[1904],{"type":34,"tag":1350,"props":1905,"children":1906},{},[1907,1912,1917],{"type":34,"tag":1354,"props":1908,"children":1909},{},[1910],{"type":40,"value":1911},"Service",{"type":34,"tag":1354,"props":1913,"children":1914},{},[1915],{"type":40,"value":1916},"Best For",{"type":34,"tag":1354,"props":1918,"children":1919},{},[1920],{"type":40,"value":1921},"Throughput",{"type":34,"tag":1375,"props":1923,"children":1924},{},[1925,1946,1967],{"type":34,"tag":1350,"props":1926,"children":1927},{},[1928,1936,1941],{"type":34,"tag":1382,"props":1929,"children":1930},{},[1931],{"type":34,"tag":62,"props":1932,"children":1933},{},[1934],{"type":40,"value":1935},"Event Grid",{"type":34,"tag":1382,"props":1937,"children":1938},{},[1939],{"type":40,"value":1940},"Reactive routing of discrete events",{"type":34,"tag":1382,"props":1942,"children":1943},{},[1944],{"type":40,"value":1945},"Millions/sec",{"type":34,"tag":1350,"props":1947,"children":1948},{},[1949,1957,1962],{"type":34,"tag":1382,"props":1950,"children":1951},{},[1952],{"type":34,"tag":62,"props":1953,"children":1954},{},[1955],{"type":40,"value":1956},"Event Hubs",{"type":34,"tag":1382,"props":1958,"children":1959},{},[1960],{"type":40,"value":1961},"High-volume data streaming and ingestion",{"type":34,"tag":1382,"props":1963,"children":1964},{},[1965],{"type":40,"value":1966},"Petabyte-scale",{"type":34,"tag":1350,"props":1968,"children":1969},{},[1970,1978,1983],{"type":34,"tag":1382,"props":1971,"children":1972},{},[1973],{"type":34,"tag":62,"props":1974,"children":1975},{},[1976],{"type":40,"value":1977},"Service Bus",{"type":34,"tag":1382,"props":1979,"children":1980},{},[1981],{"type":40,"value":1982},"Reliable ordered message delivery",{"type":34,"tag":1382,"props":1984,"children":1985},{},[1986],{"type":40,"value":1987},"Enterprise-grade",{"type":34,"tag":43,"props":1989,"children":1990},{},[1991],{"type":40,"value":1992},"The pattern we reach for most: Event Grid as the central event router, Service Bus queues for per-service processing, and Azure Functions as lightweight consumers. The result is a system where adding a new feature means wiring up a new Function—not modifying existing services.",{"type":34,"tag":35,"props":1994,"children":1996},{"id":1995},"global-static-web-apps-edge-functions",[1997],{"type":40,"value":1998},"Global Static Web Apps + Edge Functions",{"type":34,"tag":43,"props":2000,"children":2001},{},[2002],{"type":40,"value":2003},"For marketing sites, SaaS dashboards, and content-heavy applications, the combination of Azure Static Web Apps with Azure Functions delivers exceptional performance at minimal cost:",{"type":34,"tag":54,"props":2005,"children":2006},{},[2007,2017,2027],{"type":34,"tag":58,"props":2008,"children":2009},{},[2010,2015],{"type":34,"tag":62,"props":2011,"children":2012},{},[2013],{"type":40,"value":2014},"Static Web Apps",{"type":40,"value":2016}," serve pre-rendered HTML, CSS, and JS from Azure's global CDN — Lighthouse scores of 95+ become routine",{"type":34,"tag":58,"props":2018,"children":2019},{},[2020,2025],{"type":34,"tag":62,"props":2021,"children":2022},{},[2023],{"type":40,"value":2024},"Integrated API",{"type":40,"value":2026}," routes live alongside your frontend in the same repository; Azure handles routing automatically",{"type":34,"tag":58,"props":2028,"children":2029},{},[2030,2035],{"type":34,"tag":62,"props":2031,"children":2032},{},[2033],{"type":40,"value":2034},"Azure Front Door",{"type":40,"value":2036}," sits in front as a global entry point, providing WAF, DDoS protection, and sub-10ms SSL termination",{"type":34,"tag":43,"props":2038,"children":2039},{},[2040],{"type":40,"value":2041},"When workloads outgrow Functions, we migrate the API layer to Azure Container Apps without touching the frontend infrastructure.",{"type":34,"tag":35,"props":2043,"children":2045},{"id":2044},"multi-region-high-availability",[2046],{"type":40,"value":2047},"Multi-Region High Availability",{"type":34,"tag":43,"props":2049,"children":2050},{},[2051],{"type":40,"value":2052},"For clients with SLA commitments above 99.9%, a single-region deployment simply isn't enough. Our multi-region blueprint:",{"type":34,"tag":121,"props":2054,"children":2055},{},[2056,2065,2075,2085,2095],{"type":34,"tag":58,"props":2057,"children":2058},{},[2059,2063],{"type":34,"tag":62,"props":2060,"children":2061},{},[2062],{"type":40,"value":2034},{"type":40,"value":2064}," routes users to the closest healthy region via anycast",{"type":34,"tag":58,"props":2066,"children":2067},{},[2068,2073],{"type":34,"tag":62,"props":2069,"children":2070},{},[2071],{"type":40,"value":2072},"Identical application stacks",{"type":40,"value":2074}," in at least two Azure regions (paired regions where possible)",{"type":34,"tag":58,"props":2076,"children":2077},{},[2078,2083],{"type":34,"tag":62,"props":2079,"children":2080},{},[2081],{"type":40,"value":2082},"Cosmos DB multi-region writes",{"type":40,"value":2084}," — data is always written to the user's nearest region",{"type":34,"tag":58,"props":2086,"children":2087},{},[2088,2093],{"type":34,"tag":62,"props":2089,"children":2090},{},[2091],{"type":40,"value":2092},"Azure SQL Geo-Replication",{"type":40,"value":2094}," for relational workloads that need ACID guarantees",{"type":34,"tag":58,"props":2096,"children":2097},{},[2098,2103],{"type":34,"tag":62,"props":2099,"children":2100},{},[2101],{"type":40,"value":2102},"Regular chaos engineering",{"type":40,"value":2104}," — we inject failures in staging to prove the failover actually works",{"type":34,"tag":43,"props":2106,"children":2107},{},[2108],{"type":40,"value":2109},"Active-active for stateless services, active-passive with fast failover for stateful ones. The distinction matters: active-active everywhere sounds great until you need to reconcile conflicting writes.",{"type":34,"tag":35,"props":2111,"children":2113},{"id":2112},"cost-effective-data-processing-with-data-factory-and-synapse",[2114],{"type":40,"value":2115},"Cost-Effective Data Processing with Data Factory and Synapse",{"type":34,"tag":43,"props":2117,"children":2118},{},[2119],{"type":40,"value":2120},"Analytics pipelines don't need to run on expensive always-on compute. Our serverless data architecture:",{"type":34,"tag":188,"props":2122,"children":2124},{"code":2123},"Raw Data Sources → Azure Data Factory (orchestration)\n                       ↓\n                 Azure Blob Storage (cold storage, \u003C €0.02/GB)\n                       ↓\n              Azure Synapse Serverless SQL (query on demand)\n                       ↓\n                    Power BI (embedded reports)\n",[2125],{"type":34,"tag":195,"props":2126,"children":2127},{"__ignoreMap":7},[2128],{"type":40,"value":2123},{"type":34,"tag":43,"props":2130,"children":2131},{},[2132],{"type":40,"value":2133},"Data Factory handles scheduling and movement. Synapse runs complex queries against Parquet files without a warehouse to provision. Power BI surfaces the results to stakeholders. The entire stack scales from zero and costs a fraction of a dedicated data warehouse for most SME use cases.",{"type":34,"tag":35,"props":2135,"children":2137},{"id":2136},"security-zero-trust-from-day-one",[2138],{"type":40,"value":2139},"Security: Zero-Trust from Day One",{"type":34,"tag":43,"props":2141,"children":2142},{},[2143],{"type":40,"value":2144},"Across every architecture pattern above, we apply the same security baseline:",{"type":34,"tag":54,"props":2146,"children":2147},{},[2148,2158,2168,2178],{"type":34,"tag":58,"props":2149,"children":2150},{},[2151,2156],{"type":34,"tag":62,"props":2152,"children":2153},{},[2154],{"type":40,"value":2155},"Managed Identities",{"type":40,"value":2157}," everywhere — no secrets stored in environment variables or Key Vault references in app settings that could be read by anyone with Contributor access",{"type":34,"tag":58,"props":2159,"children":2160},{},[2161,2166],{"type":34,"tag":62,"props":2162,"children":2163},{},[2164],{"type":40,"value":2165},"Private Endpoints",{"type":40,"value":2167}," for all PaaS services — your Cosmos DB, Service Bus, and Storage accounts should never be reachable from the public internet",{"type":34,"tag":58,"props":2169,"children":2170},{},[2171,2176],{"type":34,"tag":62,"props":2172,"children":2173},{},[2174],{"type":40,"value":2175},"Azure Defender for Cloud",{"type":40,"value":2177}," continuously scanning for misconfiguration",{"type":34,"tag":58,"props":2179,"children":2180},{},[2181,2186],{"type":34,"tag":62,"props":2182,"children":2183},{},[2184],{"type":40,"value":2185},"Key Vault references",{"type":40,"value":2187}," in App Configuration so secrets rotate without redeployment",{"type":34,"tag":35,"props":2189,"children":2191},{"id":2190},"infrastructure-as-code-azure-bicep",[2192],{"type":40,"value":2193},"Infrastructure as Code: Azure Bicep",{"type":34,"tag":43,"props":2195,"children":2196},{},[2197],{"type":40,"value":2198},"Every pattern above is deployed through code, not the portal. We use Azure Bicep for its native Azure integration and superior readability compared to ARM templates:",{"type":34,"tag":188,"props":2200,"children":2204},{"code":2201,"language":2202,"meta":7,"className":2203,"style":7},"resource containerApp 'Microsoft.App/containerApps@2023-05-01' = {\n  name: 'order-service'\n  location: location\n  properties: {\n    configuration: {\n      ingress: { external: false, targetPort: 8080 }\n    }\n    template: {\n      containers: [{\n        name: 'order-service'\n        image: '${acr.name}.azurecr.io/order-service:${imageTag}'\n        resources: { cpu: '0.5', memory: '1Gi' }\n      }]\n      scale: { minReplicas: 1, maxReplicas: 20 }\n    }\n  }\n}\n","bicep","language-bicep shiki shiki-themes github-light",[2205],{"type":34,"tag":195,"props":2206,"children":2207},{"__ignoreMap":7},[2208,2216,2224,2232,2240,2248,2256,2263,2271,2279,2287,2295,2303,2311,2319,2326,2334],{"type":34,"tag":199,"props":2209,"children":2210},{"class":201,"line":202},[2211],{"type":34,"tag":199,"props":2212,"children":2213},{},[2214],{"type":40,"value":2215},"resource containerApp 'Microsoft.App/containerApps@2023-05-01' = {\n",{"type":34,"tag":199,"props":2217,"children":2218},{"class":201,"line":212},[2219],{"type":34,"tag":199,"props":2220,"children":2221},{},[2222],{"type":40,"value":2223},"  name: 'order-service'\n",{"type":34,"tag":199,"props":2225,"children":2226},{"class":201,"line":278},[2227],{"type":34,"tag":199,"props":2228,"children":2229},{},[2230],{"type":40,"value":2231},"  location: location\n",{"type":34,"tag":199,"props":2233,"children":2234},{"class":201,"line":287},[2235],{"type":34,"tag":199,"props":2236,"children":2237},{},[2238],{"type":40,"value":2239},"  properties: {\n",{"type":34,"tag":199,"props":2241,"children":2242},{"class":201,"line":316},[2243],{"type":34,"tag":199,"props":2244,"children":2245},{},[2246],{"type":40,"value":2247},"    configuration: {\n",{"type":34,"tag":199,"props":2249,"children":2250},{"class":201,"line":342},[2251],{"type":34,"tag":199,"props":2252,"children":2253},{},[2254],{"type":40,"value":2255},"      ingress: { external: false, targetPort: 8080 }\n",{"type":34,"tag":199,"props":2257,"children":2258},{"class":201,"line":352},[2259],{"type":34,"tag":199,"props":2260,"children":2261},{},[2262],{"type":40,"value":644},{"type":34,"tag":199,"props":2264,"children":2265},{"class":201,"line":402},[2266],{"type":34,"tag":199,"props":2267,"children":2268},{},[2269],{"type":40,"value":2270},"    template: {\n",{"type":34,"tag":199,"props":2272,"children":2273},{"class":201,"line":421},[2274],{"type":34,"tag":199,"props":2275,"children":2276},{},[2277],{"type":40,"value":2278},"      containers: [{\n",{"type":34,"tag":199,"props":2280,"children":2281},{"class":201,"line":440},[2282],{"type":34,"tag":199,"props":2283,"children":2284},{},[2285],{"type":40,"value":2286},"        name: 'order-service'\n",{"type":34,"tag":199,"props":2288,"children":2289},{"class":201,"line":449},[2290],{"type":34,"tag":199,"props":2291,"children":2292},{},[2293],{"type":40,"value":2294},"        image: '${acr.name}.azurecr.io/order-service:${imageTag}'\n",{"type":34,"tag":199,"props":2296,"children":2297},{"class":201,"line":483},[2298],{"type":34,"tag":199,"props":2299,"children":2300},{},[2301],{"type":40,"value":2302},"        resources: { cpu: '0.5', memory: '1Gi' }\n",{"type":34,"tag":199,"props":2304,"children":2305},{"class":201,"line":491},[2306],{"type":34,"tag":199,"props":2307,"children":2308},{},[2309],{"type":40,"value":2310},"      }]\n",{"type":34,"tag":199,"props":2312,"children":2313},{"class":201,"line":505},[2314],{"type":34,"tag":199,"props":2315,"children":2316},{},[2317],{"type":40,"value":2318},"      scale: { minReplicas: 1, maxReplicas: 20 }\n",{"type":34,"tag":199,"props":2320,"children":2321},{"class":201,"line":537},[2322],{"type":34,"tag":199,"props":2323,"children":2324},{},[2325],{"type":40,"value":644},{"type":34,"tag":199,"props":2327,"children":2328},{"class":201,"line":545},[2329],{"type":34,"tag":199,"props":2330,"children":2331},{},[2332],{"type":40,"value":2333},"  }\n",{"type":34,"tag":199,"props":2335,"children":2336},{"class":201,"line":569},[2337],{"type":34,"tag":199,"props":2338,"children":2339},{},[2340],{"type":40,"value":653},{"type":34,"tag":43,"props":2342,"children":2343},{},[2344,2346,2352],{"type":40,"value":2345},"Version-controlled infrastructure means every environment is reproducible, every change is auditable, and rollbacks are a ",{"type":34,"tag":195,"props":2347,"children":2349},{"className":2348},[],[2350],{"type":40,"value":2351},"git revert",{"type":40,"value":2353}," away.",{"type":34,"tag":35,"props":2355,"children":2357},{"id":2356},"choosing-the-right-pattern",[2358],{"type":40,"value":2359},"Choosing the Right Pattern",{"type":34,"tag":43,"props":2361,"children":2362},{},[2363],{"type":40,"value":2364},"No single pattern fits every project. Use this as a quick guide:",{"type":34,"tag":54,"props":2366,"children":2367},{},[2368,2378,2388,2398],{"type":34,"tag":58,"props":2369,"children":2370},{},[2371,2376],{"type":34,"tag":62,"props":2372,"children":2373},{},[2374],{"type":40,"value":2375},"Greenfield SaaS product",{"type":40,"value":2377},": Container Apps + Event Grid + Cosmos DB",{"type":34,"tag":58,"props":2379,"children":2380},{},[2381,2386],{"type":34,"tag":62,"props":2382,"children":2383},{},[2384],{"type":40,"value":2385},"Marketing site with dynamic API",{"type":40,"value":2387},": Static Web Apps + Functions + Azure SQL",{"type":34,"tag":58,"props":2389,"children":2390},{},[2391,2396],{"type":34,"tag":62,"props":2392,"children":2393},{},[2394],{"type":40,"value":2395},"Mission-critical transactional system",{"type":40,"value":2397},": Multi-region + Service Bus + SQL Geo-Replication",{"type":34,"tag":58,"props":2399,"children":2400},{},[2401,2406],{"type":34,"tag":62,"props":2402,"children":2403},{},[2404],{"type":40,"value":2405},"Analytics-heavy application",{"type":40,"value":2407},": Data Factory + Synapse Serverless + Power BI",{"type":34,"tag":43,"props":2409,"children":2410},{},[2411],{"type":40,"value":2412},"The best Azure architecture is the one that matches your load profile, your team's operational maturity, and your cost envelope — not the most sophisticated one you can build.",{"type":34,"tag":1748,"props":2414,"children":2415},{},[2416],{"type":40,"value":1752},{"title":7,"searchDepth":278,"depth":278,"links":2418},[2419,2420,2421,2422,2423,2424,2425,2426,2427],{"id":1796,"depth":212,"text":1799},{"id":1807,"depth":212,"text":1810},{"id":1884,"depth":212,"text":1887},{"id":1995,"depth":212,"text":1998},{"id":2044,"depth":212,"text":2047},{"id":2112,"depth":212,"text":2115},{"id":2136,"depth":212,"text":2139},{"id":2190,"depth":212,"text":2193},{"id":2356,"depth":212,"text":2359},"content:blog:azure-architecture-patterns.md","blog/azure-architecture-patterns.md","blog/azure-architecture-patterns",{"_path":2432,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":2433,"description":2434,"slug":2435,"date":2436,"readTime":2437,"category":1791,"image":2438,"imageCaption":2439,"author":2440,"tags":2442,"body":2446,"_type":1767,"_id":4545,"_source":1769,"_file":4546,"_stem":4547,"_extension":1772},"/blog/containerization-guide","Docker & Kubernetes: A Complete Containerization Guide for Production-Ready Apps","From writing your first Dockerfile to orchestrating workloads with Kubernetes—a practical containerization guide covering image optimisation, security, and a real-world case study that cut deployment time from hours to minutes.","containerization-guide","2025-03-28","12 min","https://images.unsplash.com/photo-1605745341112-85968b19335b?w=1200&h=600&fit=crop&auto=format","Container infrastructure running microservices in a production Kubernetes cluster",{"name":17,"role":18,"avatar":19,"bio":20,"social":2441},{"github":22,"twitter":23,"linkedin":24},[2443,2444,1790,1791,2445],"Docker","Kubernetes","Cloud Native",{"type":31,"children":2447,"toc":4530},[2448,2454,2475,2480,2486,2491,2534,2539,2545,2550,2556,2561,2711,2717,2722,2805,2927,2933,2938,3499,3520,3526,3531,3537,3638,3644,4341,4362,4368,4373,4467,4472,4478,4483,4516,4521,4526],{"type":34,"tag":35,"props":2449,"children":2451},{"id":2450},"the-promise-and-the-reality-of-containerisation",[2452],{"type":40,"value":2453},"The Promise (and the Reality) of Containerisation",{"type":34,"tag":43,"props":2455,"children":2456},{},[2457,2459,2465,2467,2473],{"type":40,"value":2458},"Containers solve a problem every developer knows well: ",{"type":34,"tag":2460,"props":2461,"children":2462},"em",{},[2463],{"type":40,"value":2464},"\"it works on my machine.\"",{"type":40,"value":2466}," By packaging an application alongside all its runtime dependencies into a portable, reproducible unit, containers eliminate the friction between development, staging, and production environments. But getting from a working Dockerfile to a resilient, production-ready container strategy requires more than just running ",{"type":34,"tag":195,"props":2468,"children":2470},{"className":2469},[],[2471],{"type":40,"value":2472},"docker build",{"type":40,"value":2474},".",{"type":34,"tag":43,"props":2476,"children":2477},{},[2478],{"type":40,"value":2479},"This guide walks through the full journey—from container fundamentals to Kubernetes orchestration—drawing on patterns we've refined across dozens of client projects at MediaFront.",{"type":34,"tag":35,"props":2481,"children":2483},{"id":2482},"what-containers-actually-are",[2484],{"type":40,"value":2485},"What Containers Actually Are",{"type":34,"tag":43,"props":2487,"children":2488},{},[2489],{"type":40,"value":2490},"Unlike virtual machines, containers don't virtualise hardware. They share the host operating system kernel while running in isolated user-space processes. The practical result:",{"type":34,"tag":54,"props":2492,"children":2493},{},[2494,2504,2514,2524],{"type":34,"tag":58,"props":2495,"children":2496},{},[2497,2502],{"type":34,"tag":62,"props":2498,"children":2499},{},[2500],{"type":40,"value":2501},"Startup in milliseconds",{"type":40,"value":2503},", not minutes",{"type":34,"tag":58,"props":2505,"children":2506},{},[2507,2512],{"type":34,"tag":62,"props":2508,"children":2509},{},[2510],{"type":40,"value":2511},"Image sizes in megabytes",{"type":40,"value":2513},", not gigabytes",{"type":34,"tag":58,"props":2515,"children":2516},{},[2517,2522],{"type":34,"tag":62,"props":2518,"children":2519},{},[2520],{"type":40,"value":2521},"Predictable resource usage",{"type":40,"value":2523}," — you can set hard CPU and memory limits",{"type":34,"tag":58,"props":2525,"children":2526},{},[2527,2532],{"type":34,"tag":62,"props":2528,"children":2529},{},[2530],{"type":40,"value":2531},"Immutable deployments",{"type":40,"value":2533}," — every release is a new image tag, making rollbacks trivial",{"type":34,"tag":43,"props":2535,"children":2536},{},[2537],{"type":40,"value":2538},"The trade-off: containers on the same host share the kernel, which has security implications we'll address below.",{"type":34,"tag":35,"props":2540,"children":2542},{"id":2541},"writing-production-grade-dockerfiles",[2543],{"type":40,"value":2544},"Writing Production-Grade Dockerfiles",{"type":34,"tag":43,"props":2546,"children":2547},{},[2548],{"type":40,"value":2549},"A Dockerfile is infrastructure as code for your runtime environment. Small choices here have outsized consequences in production.",{"type":34,"tag":176,"props":2551,"children":2553},{"id":2552},"use-multi-stage-builds",[2554],{"type":40,"value":2555},"Use Multi-Stage Builds",{"type":34,"tag":43,"props":2557,"children":2558},{},[2559],{"type":40,"value":2560},"Multi-stage builds separate the build toolchain from the runtime image, dramatically reducing final image size and attack surface:",{"type":34,"tag":188,"props":2562,"children":2566},{"className":2563,"code":2564,"language":2565,"meta":7,"style":7},"language-dockerfile shiki shiki-themes github-light","# Stage 1: Build\nFROM mcr.microsoft.com/dotnet/sdk:8.0 AS build\nWORKDIR /src\nCOPY [\"OrderService.csproj\", \"./\"]\nRUN dotnet restore\nCOPY . .\nRUN dotnet publish -c Release -o /app/publish\n\n# Stage 2: Runtime-only image (~100MB vs ~800MB SDK image)\nFROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime\nWORKDIR /app\nEXPOSE 8080\nCOPY --from=build /app/publish .\n\n# Never run as root in production\nUSER app\n\nENTRYPOINT [\"dotnet\", \"OrderService.dll\"]\n","dockerfile",[2567],{"type":34,"tag":195,"props":2568,"children":2569},{"__ignoreMap":7},[2570,2578,2586,2594,2602,2610,2618,2626,2633,2641,2649,2657,2665,2673,2680,2688,2696,2703],{"type":34,"tag":199,"props":2571,"children":2572},{"class":201,"line":202},[2573],{"type":34,"tag":199,"props":2574,"children":2575},{},[2576],{"type":40,"value":2577},"# Stage 1: Build\n",{"type":34,"tag":199,"props":2579,"children":2580},{"class":201,"line":212},[2581],{"type":34,"tag":199,"props":2582,"children":2583},{},[2584],{"type":40,"value":2585},"FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build\n",{"type":34,"tag":199,"props":2587,"children":2588},{"class":201,"line":278},[2589],{"type":34,"tag":199,"props":2590,"children":2591},{},[2592],{"type":40,"value":2593},"WORKDIR /src\n",{"type":34,"tag":199,"props":2595,"children":2596},{"class":201,"line":287},[2597],{"type":34,"tag":199,"props":2598,"children":2599},{},[2600],{"type":40,"value":2601},"COPY [\"OrderService.csproj\", \"./\"]\n",{"type":34,"tag":199,"props":2603,"children":2604},{"class":201,"line":316},[2605],{"type":34,"tag":199,"props":2606,"children":2607},{},[2608],{"type":40,"value":2609},"RUN dotnet restore\n",{"type":34,"tag":199,"props":2611,"children":2612},{"class":201,"line":342},[2613],{"type":34,"tag":199,"props":2614,"children":2615},{},[2616],{"type":40,"value":2617},"COPY . .\n",{"type":34,"tag":199,"props":2619,"children":2620},{"class":201,"line":352},[2621],{"type":34,"tag":199,"props":2622,"children":2623},{},[2624],{"type":40,"value":2625},"RUN dotnet publish -c Release -o /app/publish\n",{"type":34,"tag":199,"props":2627,"children":2628},{"class":201,"line":402},[2629],{"type":34,"tag":199,"props":2630,"children":2631},{"emptyLinePlaceholder":346},[2632],{"type":40,"value":349},{"type":34,"tag":199,"props":2634,"children":2635},{"class":201,"line":421},[2636],{"type":34,"tag":199,"props":2637,"children":2638},{},[2639],{"type":40,"value":2640},"# Stage 2: Runtime-only image (~100MB vs ~800MB SDK image)\n",{"type":34,"tag":199,"props":2642,"children":2643},{"class":201,"line":440},[2644],{"type":34,"tag":199,"props":2645,"children":2646},{},[2647],{"type":40,"value":2648},"FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime\n",{"type":34,"tag":199,"props":2650,"children":2651},{"class":201,"line":449},[2652],{"type":34,"tag":199,"props":2653,"children":2654},{},[2655],{"type":40,"value":2656},"WORKDIR /app\n",{"type":34,"tag":199,"props":2658,"children":2659},{"class":201,"line":483},[2660],{"type":34,"tag":199,"props":2661,"children":2662},{},[2663],{"type":40,"value":2664},"EXPOSE 8080\n",{"type":34,"tag":199,"props":2666,"children":2667},{"class":201,"line":491},[2668],{"type":34,"tag":199,"props":2669,"children":2670},{},[2671],{"type":40,"value":2672},"COPY --from=build /app/publish .\n",{"type":34,"tag":199,"props":2674,"children":2675},{"class":201,"line":505},[2676],{"type":34,"tag":199,"props":2677,"children":2678},{"emptyLinePlaceholder":346},[2679],{"type":40,"value":349},{"type":34,"tag":199,"props":2681,"children":2682},{"class":201,"line":537},[2683],{"type":34,"tag":199,"props":2684,"children":2685},{},[2686],{"type":40,"value":2687},"# Never run as root in production\n",{"type":34,"tag":199,"props":2689,"children":2690},{"class":201,"line":545},[2691],{"type":34,"tag":199,"props":2692,"children":2693},{},[2694],{"type":40,"value":2695},"USER app\n",{"type":34,"tag":199,"props":2697,"children":2698},{"class":201,"line":569},[2699],{"type":34,"tag":199,"props":2700,"children":2701},{"emptyLinePlaceholder":346},[2702],{"type":40,"value":349},{"type":34,"tag":199,"props":2704,"children":2705},{"class":201,"line":607},[2706],{"type":34,"tag":199,"props":2707,"children":2708},{},[2709],{"type":40,"value":2710},"ENTRYPOINT [\"dotnet\", \"OrderService.dll\"]\n",{"type":34,"tag":176,"props":2712,"children":2714},{"id":2713},"security-hardening-checklist",[2715],{"type":40,"value":2716},"Security Hardening Checklist",{"type":34,"tag":43,"props":2718,"children":2719},{},[2720],{"type":40,"value":2721},"Before any image goes to production, verify:",{"type":34,"tag":54,"props":2723,"children":2724},{},[2725,2743,2753,2769,2795],{"type":34,"tag":58,"props":2726,"children":2727},{},[2728,2733,2735,2741],{"type":34,"tag":62,"props":2729,"children":2730},{},[2731],{"type":40,"value":2732},"Non-root user",{"type":40,"value":2734}," — add ",{"type":34,"tag":195,"props":2736,"children":2738},{"className":2737},[],[2739],{"type":40,"value":2740},"USER app",{"type":40,"value":2742}," (or create a dedicated user) so a compromised container doesn't have root access to the host",{"type":34,"tag":58,"props":2744,"children":2745},{},[2746,2751],{"type":34,"tag":62,"props":2747,"children":2748},{},[2749],{"type":40,"value":2750},"Read-only filesystem",{"type":40,"value":2752}," — mount volumes only where writes are genuinely needed",{"type":34,"tag":58,"props":2754,"children":2755},{},[2756,2761,2763],{"type":34,"tag":62,"props":2757,"children":2758},{},[2759],{"type":40,"value":2760},"No secrets in image layers",{"type":40,"value":2762}," — use build secrets or runtime environment injection, never ",{"type":34,"tag":195,"props":2764,"children":2766},{"className":2765},[],[2767],{"type":40,"value":2768},"COPY .env .",{"type":34,"tag":58,"props":2770,"children":2771},{},[2772,2777,2779,2785,2787,2793],{"type":34,"tag":62,"props":2773,"children":2774},{},[2775],{"type":40,"value":2776},"Pinned base image tags",{"type":40,"value":2778}," — ",{"type":34,"tag":195,"props":2780,"children":2782},{"className":2781},[],[2783],{"type":40,"value":2784},"FROM node:20.14.0-alpine3.20",{"type":40,"value":2786}," is reproducible; ",{"type":34,"tag":195,"props":2788,"children":2790},{"className":2789},[],[2791],{"type":40,"value":2792},"FROM node:latest",{"type":40,"value":2794}," is a reliability hazard",{"type":34,"tag":58,"props":2796,"children":2797},{},[2798,2803],{"type":34,"tag":62,"props":2799,"children":2800},{},[2801],{"type":40,"value":2802},"Vulnerability scanning",{"type":40,"value":2804}," — integrate Trivy or Grype into your CI pipeline; fail the build on HIGH or CRITICAL findings",{"type":34,"tag":188,"props":2806,"children":2810},{"className":2807,"code":2808,"language":2809,"meta":7,"style":7},"language-yaml shiki shiki-themes github-light","# GitHub Actions step — fails PR if critical CVEs found\n- name: Scan image for vulnerabilities\n  uses: aquasecurity/trivy-action@master\n  with:\n    image-ref: ${{ env.IMAGE }}\n    exit-code: '1'\n    severity: 'CRITICAL,HIGH'\n","yaml",[2811],{"type":34,"tag":195,"props":2812,"children":2813},{"__ignoreMap":7},[2814,2822,2846,2863,2876,2893,2910],{"type":34,"tag":199,"props":2815,"children":2816},{"class":201,"line":202},[2817],{"type":34,"tag":199,"props":2818,"children":2819},{"style":206},[2820],{"type":40,"value":2821},"# GitHub Actions step — fails PR if critical CVEs found\n",{"type":34,"tag":199,"props":2823,"children":2824},{"class":201,"line":212},[2825,2830,2836,2841],{"type":34,"tag":199,"props":2826,"children":2827},{"style":233},[2828],{"type":40,"value":2829},"- ",{"type":34,"tag":199,"props":2831,"children":2833},{"style":2832},"--shiki-default:#22863A",[2834],{"type":40,"value":2835},"name",{"type":34,"tag":199,"props":2837,"children":2838},{"style":233},[2839],{"type":40,"value":2840},": ",{"type":34,"tag":199,"props":2842,"children":2843},{"style":883},[2844],{"type":40,"value":2845},"Scan image for vulnerabilities\n",{"type":34,"tag":199,"props":2847,"children":2848},{"class":201,"line":278},[2849,2854,2858],{"type":34,"tag":199,"props":2850,"children":2851},{"style":2832},[2852],{"type":40,"value":2853},"  uses",{"type":34,"tag":199,"props":2855,"children":2856},{"style":233},[2857],{"type":40,"value":2840},{"type":34,"tag":199,"props":2859,"children":2860},{"style":883},[2861],{"type":40,"value":2862},"aquasecurity/trivy-action@master\n",{"type":34,"tag":199,"props":2864,"children":2865},{"class":201,"line":287},[2866,2871],{"type":34,"tag":199,"props":2867,"children":2868},{"style":2832},[2869],{"type":40,"value":2870},"  with",{"type":34,"tag":199,"props":2872,"children":2873},{"style":233},[2874],{"type":40,"value":2875},":\n",{"type":34,"tag":199,"props":2877,"children":2878},{"class":201,"line":316},[2879,2884,2888],{"type":34,"tag":199,"props":2880,"children":2881},{"style":2832},[2882],{"type":40,"value":2883},"    image-ref",{"type":34,"tag":199,"props":2885,"children":2886},{"style":233},[2887],{"type":40,"value":2840},{"type":34,"tag":199,"props":2889,"children":2890},{"style":883},[2891],{"type":40,"value":2892},"${{ env.IMAGE }}\n",{"type":34,"tag":199,"props":2894,"children":2895},{"class":201,"line":342},[2896,2901,2905],{"type":34,"tag":199,"props":2897,"children":2898},{"style":2832},[2899],{"type":40,"value":2900},"    exit-code",{"type":34,"tag":199,"props":2902,"children":2903},{"style":233},[2904],{"type":40,"value":2840},{"type":34,"tag":199,"props":2906,"children":2907},{"style":883},[2908],{"type":40,"value":2909},"'1'\n",{"type":34,"tag":199,"props":2911,"children":2912},{"class":201,"line":352},[2913,2918,2922],{"type":34,"tag":199,"props":2914,"children":2915},{"style":2832},[2916],{"type":40,"value":2917},"    severity",{"type":34,"tag":199,"props":2919,"children":2920},{"style":233},[2921],{"type":40,"value":2840},{"type":34,"tag":199,"props":2923,"children":2924},{"style":883},[2925],{"type":40,"value":2926},"'CRITICAL,HIGH'\n",{"type":34,"tag":35,"props":2928,"children":2930},{"id":2929},"composing-services-locally-with-docker-compose",[2931],{"type":40,"value":2932},"Composing Services Locally with Docker Compose",{"type":34,"tag":43,"props":2934,"children":2935},{},[2936],{"type":40,"value":2937},"Docker Compose is the right tool for local development and integration testing. Here's a production-mirroring setup with secrets management:",{"type":34,"tag":188,"props":2939,"children":2941},{"className":2807,"code":2940,"language":2809,"meta":7,"style":7},"services:\n  api:\n    build: ./api\n    ports: [\"8080:8080\"]\n    environment:\n      DB_HOST: db\n      DB_PASSWORD_FILE: /run/secrets/db_password\n    depends_on:\n      db:\n        condition: service_healthy\n    secrets: [db_password]\n    healthcheck:\n      test: [\"CMD\", \"curl\", \"-f\", \"http://localhost:8080/health\"]\n      interval: 30s\n      timeout: 5s\n      retries: 3\n      start_period: 10s\n\n  db:\n    image: postgres:16-alpine\n    volumes: [db_data:/var/lib/postgresql/data]\n    environment:\n      POSTGRES_PASSWORD_FILE: /run/secrets/db_password\n    secrets: [db_password]\n    healthcheck:\n      test: [\"CMD\", \"pg_isready\", \"-U\", \"postgres\"]\n      interval: 10s\n\nvolumes:\n  db_data:\n\nsecrets:\n  db_password:\n    file: ./secrets/db_password.txt\n",[2942],{"type":34,"tag":195,"props":2943,"children":2944},{"__ignoreMap":7},[2945,2957,2969,2986,3009,3021,3038,3055,3067,3079,3096,3117,3129,3177,3194,3211,3228,3245,3252,3264,3281,3302,3313,3329,3348,3359,3405,3420,3427,3439,3451,3458,3470,3482],{"type":34,"tag":199,"props":2946,"children":2947},{"class":201,"line":202},[2948,2953],{"type":34,"tag":199,"props":2949,"children":2950},{"style":2832},[2951],{"type":40,"value":2952},"services",{"type":34,"tag":199,"props":2954,"children":2955},{"style":233},[2956],{"type":40,"value":2875},{"type":34,"tag":199,"props":2958,"children":2959},{"class":201,"line":212},[2960,2965],{"type":34,"tag":199,"props":2961,"children":2962},{"style":2832},[2963],{"type":40,"value":2964},"  api",{"type":34,"tag":199,"props":2966,"children":2967},{"style":233},[2968],{"type":40,"value":2875},{"type":34,"tag":199,"props":2970,"children":2971},{"class":201,"line":278},[2972,2977,2981],{"type":34,"tag":199,"props":2973,"children":2974},{"style":2832},[2975],{"type":40,"value":2976},"    build",{"type":34,"tag":199,"props":2978,"children":2979},{"style":233},[2980],{"type":40,"value":2840},{"type":34,"tag":199,"props":2982,"children":2983},{"style":883},[2984],{"type":40,"value":2985},"./api\n",{"type":34,"tag":199,"props":2987,"children":2988},{"class":201,"line":287},[2989,2994,2999,3004],{"type":34,"tag":199,"props":2990,"children":2991},{"style":2832},[2992],{"type":40,"value":2993},"    ports",{"type":34,"tag":199,"props":2995,"children":2996},{"style":233},[2997],{"type":40,"value":2998},": [",{"type":34,"tag":199,"props":3000,"children":3001},{"style":883},[3002],{"type":40,"value":3003},"\"8080:8080\"",{"type":34,"tag":199,"props":3005,"children":3006},{"style":233},[3007],{"type":40,"value":3008},"]\n",{"type":34,"tag":199,"props":3010,"children":3011},{"class":201,"line":316},[3012,3017],{"type":34,"tag":199,"props":3013,"children":3014},{"style":2832},[3015],{"type":40,"value":3016},"    environment",{"type":34,"tag":199,"props":3018,"children":3019},{"style":233},[3020],{"type":40,"value":2875},{"type":34,"tag":199,"props":3022,"children":3023},{"class":201,"line":342},[3024,3029,3033],{"type":34,"tag":199,"props":3025,"children":3026},{"style":2832},[3027],{"type":40,"value":3028},"      DB_HOST",{"type":34,"tag":199,"props":3030,"children":3031},{"style":233},[3032],{"type":40,"value":2840},{"type":34,"tag":199,"props":3034,"children":3035},{"style":883},[3036],{"type":40,"value":3037},"db\n",{"type":34,"tag":199,"props":3039,"children":3040},{"class":201,"line":352},[3041,3046,3050],{"type":34,"tag":199,"props":3042,"children":3043},{"style":2832},[3044],{"type":40,"value":3045},"      DB_PASSWORD_FILE",{"type":34,"tag":199,"props":3047,"children":3048},{"style":233},[3049],{"type":40,"value":2840},{"type":34,"tag":199,"props":3051,"children":3052},{"style":883},[3053],{"type":40,"value":3054},"/run/secrets/db_password\n",{"type":34,"tag":199,"props":3056,"children":3057},{"class":201,"line":402},[3058,3063],{"type":34,"tag":199,"props":3059,"children":3060},{"style":2832},[3061],{"type":40,"value":3062},"    depends_on",{"type":34,"tag":199,"props":3064,"children":3065},{"style":233},[3066],{"type":40,"value":2875},{"type":34,"tag":199,"props":3068,"children":3069},{"class":201,"line":421},[3070,3075],{"type":34,"tag":199,"props":3071,"children":3072},{"style":2832},[3073],{"type":40,"value":3074},"      db",{"type":34,"tag":199,"props":3076,"children":3077},{"style":233},[3078],{"type":40,"value":2875},{"type":34,"tag":199,"props":3080,"children":3081},{"class":201,"line":440},[3082,3087,3091],{"type":34,"tag":199,"props":3083,"children":3084},{"style":2832},[3085],{"type":40,"value":3086},"        condition",{"type":34,"tag":199,"props":3088,"children":3089},{"style":233},[3090],{"type":40,"value":2840},{"type":34,"tag":199,"props":3092,"children":3093},{"style":883},[3094],{"type":40,"value":3095},"service_healthy\n",{"type":34,"tag":199,"props":3097,"children":3098},{"class":201,"line":449},[3099,3104,3108,3113],{"type":34,"tag":199,"props":3100,"children":3101},{"style":2832},[3102],{"type":40,"value":3103},"    secrets",{"type":34,"tag":199,"props":3105,"children":3106},{"style":233},[3107],{"type":40,"value":2998},{"type":34,"tag":199,"props":3109,"children":3110},{"style":883},[3111],{"type":40,"value":3112},"db_password",{"type":34,"tag":199,"props":3114,"children":3115},{"style":233},[3116],{"type":40,"value":3008},{"type":34,"tag":199,"props":3118,"children":3119},{"class":201,"line":483},[3120,3125],{"type":34,"tag":199,"props":3121,"children":3122},{"style":2832},[3123],{"type":40,"value":3124},"    healthcheck",{"type":34,"tag":199,"props":3126,"children":3127},{"style":233},[3128],{"type":40,"value":2875},{"type":34,"tag":199,"props":3130,"children":3131},{"class":201,"line":491},[3132,3137,3141,3146,3150,3155,3159,3164,3168,3173],{"type":34,"tag":199,"props":3133,"children":3134},{"style":2832},[3135],{"type":40,"value":3136},"      test",{"type":34,"tag":199,"props":3138,"children":3139},{"style":233},[3140],{"type":40,"value":2998},{"type":34,"tag":199,"props":3142,"children":3143},{"style":883},[3144],{"type":40,"value":3145},"\"CMD\"",{"type":34,"tag":199,"props":3147,"children":3148},{"style":233},[3149],{"type":40,"value":256},{"type":34,"tag":199,"props":3151,"children":3152},{"style":883},[3153],{"type":40,"value":3154},"\"curl\"",{"type":34,"tag":199,"props":3156,"children":3157},{"style":233},[3158],{"type":40,"value":256},{"type":34,"tag":199,"props":3160,"children":3161},{"style":883},[3162],{"type":40,"value":3163},"\"-f\"",{"type":34,"tag":199,"props":3165,"children":3166},{"style":233},[3167],{"type":40,"value":256},{"type":34,"tag":199,"props":3169,"children":3170},{"style":883},[3171],{"type":40,"value":3172},"\"http://localhost:8080/health\"",{"type":34,"tag":199,"props":3174,"children":3175},{"style":233},[3176],{"type":40,"value":3008},{"type":34,"tag":199,"props":3178,"children":3179},{"class":201,"line":505},[3180,3185,3189],{"type":34,"tag":199,"props":3181,"children":3182},{"style":2832},[3183],{"type":40,"value":3184},"      interval",{"type":34,"tag":199,"props":3186,"children":3187},{"style":233},[3188],{"type":40,"value":2840},{"type":34,"tag":199,"props":3190,"children":3191},{"style":883},[3192],{"type":40,"value":3193},"30s\n",{"type":34,"tag":199,"props":3195,"children":3196},{"class":201,"line":537},[3197,3202,3206],{"type":34,"tag":199,"props":3198,"children":3199},{"style":2832},[3200],{"type":40,"value":3201},"      timeout",{"type":34,"tag":199,"props":3203,"children":3204},{"style":233},[3205],{"type":40,"value":2840},{"type":34,"tag":199,"props":3207,"children":3208},{"style":883},[3209],{"type":40,"value":3210},"5s\n",{"type":34,"tag":199,"props":3212,"children":3213},{"class":201,"line":545},[3214,3219,3223],{"type":34,"tag":199,"props":3215,"children":3216},{"style":2832},[3217],{"type":40,"value":3218},"      retries",{"type":34,"tag":199,"props":3220,"children":3221},{"style":233},[3222],{"type":40,"value":2840},{"type":34,"tag":199,"props":3224,"children":3225},{"style":1010},[3226],{"type":40,"value":3227},"3\n",{"type":34,"tag":199,"props":3229,"children":3230},{"class":201,"line":569},[3231,3236,3240],{"type":34,"tag":199,"props":3232,"children":3233},{"style":2832},[3234],{"type":40,"value":3235},"      start_period",{"type":34,"tag":199,"props":3237,"children":3238},{"style":233},[3239],{"type":40,"value":2840},{"type":34,"tag":199,"props":3241,"children":3242},{"style":883},[3243],{"type":40,"value":3244},"10s\n",{"type":34,"tag":199,"props":3246,"children":3247},{"class":201,"line":607},[3248],{"type":34,"tag":199,"props":3249,"children":3250},{"emptyLinePlaceholder":346},[3251],{"type":40,"value":349},{"type":34,"tag":199,"props":3253,"children":3254},{"class":201,"line":615},[3255,3260],{"type":34,"tag":199,"props":3256,"children":3257},{"style":2832},[3258],{"type":40,"value":3259},"  db",{"type":34,"tag":199,"props":3261,"children":3262},{"style":233},[3263],{"type":40,"value":2875},{"type":34,"tag":199,"props":3265,"children":3266},{"class":201,"line":638},[3267,3272,3276],{"type":34,"tag":199,"props":3268,"children":3269},{"style":2832},[3270],{"type":40,"value":3271},"    image",{"type":34,"tag":199,"props":3273,"children":3274},{"style":233},[3275],{"type":40,"value":2840},{"type":34,"tag":199,"props":3277,"children":3278},{"style":883},[3279],{"type":40,"value":3280},"postgres:16-alpine\n",{"type":34,"tag":199,"props":3282,"children":3283},{"class":201,"line":647},[3284,3289,3293,3298],{"type":34,"tag":199,"props":3285,"children":3286},{"style":2832},[3287],{"type":40,"value":3288},"    volumes",{"type":34,"tag":199,"props":3290,"children":3291},{"style":233},[3292],{"type":40,"value":2998},{"type":34,"tag":199,"props":3294,"children":3295},{"style":883},[3296],{"type":40,"value":3297},"db_data:/var/lib/postgresql/data",{"type":34,"tag":199,"props":3299,"children":3300},{"style":233},[3301],{"type":40,"value":3008},{"type":34,"tag":199,"props":3303,"children":3304},{"class":201,"line":656},[3305,3309],{"type":34,"tag":199,"props":3306,"children":3307},{"style":2832},[3308],{"type":40,"value":3016},{"type":34,"tag":199,"props":3310,"children":3311},{"style":233},[3312],{"type":40,"value":2875},{"type":34,"tag":199,"props":3314,"children":3315},{"class":201,"line":664},[3316,3321,3325],{"type":34,"tag":199,"props":3317,"children":3318},{"style":2832},[3319],{"type":40,"value":3320},"      POSTGRES_PASSWORD_FILE",{"type":34,"tag":199,"props":3322,"children":3323},{"style":233},[3324],{"type":40,"value":2840},{"type":34,"tag":199,"props":3326,"children":3327},{"style":883},[3328],{"type":40,"value":3054},{"type":34,"tag":199,"props":3330,"children":3331},{"class":201,"line":673},[3332,3336,3340,3344],{"type":34,"tag":199,"props":3333,"children":3334},{"style":2832},[3335],{"type":40,"value":3103},{"type":34,"tag":199,"props":3337,"children":3338},{"style":233},[3339],{"type":40,"value":2998},{"type":34,"tag":199,"props":3341,"children":3342},{"style":883},[3343],{"type":40,"value":3112},{"type":34,"tag":199,"props":3345,"children":3346},{"style":233},[3347],{"type":40,"value":3008},{"type":34,"tag":199,"props":3349,"children":3350},{"class":201,"line":721},[3351,3355],{"type":34,"tag":199,"props":3352,"children":3353},{"style":2832},[3354],{"type":40,"value":3124},{"type":34,"tag":199,"props":3356,"children":3357},{"style":233},[3358],{"type":40,"value":2875},{"type":34,"tag":199,"props":3360,"children":3361},{"class":201,"line":729},[3362,3366,3370,3374,3378,3383,3387,3392,3396,3401],{"type":34,"tag":199,"props":3363,"children":3364},{"style":2832},[3365],{"type":40,"value":3136},{"type":34,"tag":199,"props":3367,"children":3368},{"style":233},[3369],{"type":40,"value":2998},{"type":34,"tag":199,"props":3371,"children":3372},{"style":883},[3373],{"type":40,"value":3145},{"type":34,"tag":199,"props":3375,"children":3376},{"style":233},[3377],{"type":40,"value":256},{"type":34,"tag":199,"props":3379,"children":3380},{"style":883},[3381],{"type":40,"value":3382},"\"pg_isready\"",{"type":34,"tag":199,"props":3384,"children":3385},{"style":233},[3386],{"type":40,"value":256},{"type":34,"tag":199,"props":3388,"children":3389},{"style":883},[3390],{"type":40,"value":3391},"\"-U\"",{"type":34,"tag":199,"props":3393,"children":3394},{"style":233},[3395],{"type":40,"value":256},{"type":34,"tag":199,"props":3397,"children":3398},{"style":883},[3399],{"type":40,"value":3400},"\"postgres\"",{"type":34,"tag":199,"props":3402,"children":3403},{"style":233},[3404],{"type":40,"value":3008},{"type":34,"tag":199,"props":3406,"children":3407},{"class":201,"line":755},[3408,3412,3416],{"type":34,"tag":199,"props":3409,"children":3410},{"style":2832},[3411],{"type":40,"value":3184},{"type":34,"tag":199,"props":3413,"children":3414},{"style":233},[3415],{"type":40,"value":2840},{"type":34,"tag":199,"props":3417,"children":3418},{"style":883},[3419],{"type":40,"value":3244},{"type":34,"tag":199,"props":3421,"children":3422},{"class":201,"line":763},[3423],{"type":34,"tag":199,"props":3424,"children":3425},{"emptyLinePlaceholder":346},[3426],{"type":40,"value":349},{"type":34,"tag":199,"props":3428,"children":3429},{"class":201,"line":826},[3430,3435],{"type":34,"tag":199,"props":3431,"children":3432},{"style":2832},[3433],{"type":40,"value":3434},"volumes",{"type":34,"tag":199,"props":3436,"children":3437},{"style":233},[3438],{"type":40,"value":2875},{"type":34,"tag":199,"props":3440,"children":3441},{"class":201,"line":834},[3442,3447],{"type":34,"tag":199,"props":3443,"children":3444},{"style":2832},[3445],{"type":40,"value":3446},"  db_data",{"type":34,"tag":199,"props":3448,"children":3449},{"style":233},[3450],{"type":40,"value":2875},{"type":34,"tag":199,"props":3452,"children":3453},{"class":201,"line":843},[3454],{"type":34,"tag":199,"props":3455,"children":3456},{"emptyLinePlaceholder":346},[3457],{"type":40,"value":349},{"type":34,"tag":199,"props":3459,"children":3460},{"class":201,"line":879},[3461,3466],{"type":34,"tag":199,"props":3462,"children":3463},{"style":2832},[3464],{"type":40,"value":3465},"secrets",{"type":34,"tag":199,"props":3467,"children":3468},{"style":233},[3469],{"type":40,"value":2875},{"type":34,"tag":199,"props":3471,"children":3472},{"class":201,"line":893},[3473,3478],{"type":34,"tag":199,"props":3474,"children":3475},{"style":2832},[3476],{"type":40,"value":3477},"  db_password",{"type":34,"tag":199,"props":3479,"children":3480},{"style":233},[3481],{"type":40,"value":2875},{"type":34,"tag":199,"props":3483,"children":3484},{"class":201,"line":907},[3485,3490,3494],{"type":34,"tag":199,"props":3486,"children":3487},{"style":2832},[3488],{"type":40,"value":3489},"    file",{"type":34,"tag":199,"props":3491,"children":3492},{"style":233},[3493],{"type":40,"value":2840},{"type":34,"tag":199,"props":3495,"children":3496},{"style":883},[3497],{"type":40,"value":3498},"./secrets/db_password.txt\n",{"type":34,"tag":43,"props":3500,"children":3501},{},[3502,3504,3510,3512,3518],{"type":40,"value":3503},"Two things worth highlighting here: ",{"type":34,"tag":195,"props":3505,"children":3507},{"className":3506},[],[3508],{"type":40,"value":3509},"depends_on",{"type":40,"value":3511}," with ",{"type":34,"tag":195,"props":3513,"children":3515},{"className":3514},[],[3516],{"type":40,"value":3517},"condition: service_healthy",{"type":40,"value":3519}," ensures the API only starts once the database is truly ready (not just the container process), and secrets are mounted as files rather than plain environment variables—reducing the risk of accidental exposure in logs.",{"type":34,"tag":35,"props":3521,"children":3523},{"id":3522},"kubernetes-orchestration-that-scales",[3524],{"type":40,"value":3525},"Kubernetes: Orchestration That Scales",{"type":34,"tag":43,"props":3527,"children":3528},{},[3529],{"type":40,"value":3530},"Kubernetes (K8s) takes over where Docker Compose leaves off. When you need automatic self-healing, zero-downtime deploys, and the ability to run hundreds of container replicas across a cluster, Kubernetes is the answer.",{"type":34,"tag":176,"props":3532,"children":3534},{"id":3533},"core-kubernetes-primitives",[3535],{"type":40,"value":3536},"Core Kubernetes Primitives",{"type":34,"tag":1342,"props":3538,"children":3539},{},[3540,3556],{"type":34,"tag":1346,"props":3541,"children":3542},{},[3543],{"type":34,"tag":1350,"props":3544,"children":3545},{},[3546,3551],{"type":34,"tag":1354,"props":3547,"children":3548},{},[3549],{"type":40,"value":3550},"Object",{"type":34,"tag":1354,"props":3552,"children":3553},{},[3554],{"type":40,"value":3555},"Purpose",{"type":34,"tag":1375,"props":3557,"children":3558},{},[3559,3575,3591,3606,3622],{"type":34,"tag":1350,"props":3560,"children":3561},{},[3562,3570],{"type":34,"tag":1382,"props":3563,"children":3564},{},[3565],{"type":34,"tag":62,"props":3566,"children":3567},{},[3568],{"type":40,"value":3569},"Pod",{"type":34,"tag":1382,"props":3571,"children":3572},{},[3573],{"type":40,"value":3574},"Smallest deployable unit; one or more containers sharing networking and storage",{"type":34,"tag":1350,"props":3576,"children":3577},{},[3578,3586],{"type":34,"tag":1382,"props":3579,"children":3580},{},[3581],{"type":34,"tag":62,"props":3582,"children":3583},{},[3584],{"type":40,"value":3585},"Deployment",{"type":34,"tag":1382,"props":3587,"children":3588},{},[3589],{"type":40,"value":3590},"Declares desired state; manages rolling updates and rollbacks",{"type":34,"tag":1350,"props":3592,"children":3593},{},[3594,3601],{"type":34,"tag":1382,"props":3595,"children":3596},{},[3597],{"type":34,"tag":62,"props":3598,"children":3599},{},[3600],{"type":40,"value":1911},{"type":34,"tag":1382,"props":3602,"children":3603},{},[3604],{"type":40,"value":3605},"Stable network endpoint in front of a set of pods",{"type":34,"tag":1350,"props":3607,"children":3608},{},[3609,3617],{"type":34,"tag":1382,"props":3610,"children":3611},{},[3612],{"type":34,"tag":62,"props":3613,"children":3614},{},[3615],{"type":40,"value":3616},"ConfigMap / Secret",{"type":34,"tag":1382,"props":3618,"children":3619},{},[3620],{"type":40,"value":3621},"Externalise configuration and credentials from images",{"type":34,"tag":1350,"props":3623,"children":3624},{},[3625,3633],{"type":34,"tag":1382,"props":3626,"children":3627},{},[3628],{"type":34,"tag":62,"props":3629,"children":3630},{},[3631],{"type":40,"value":3632},"HorizontalPodAutoscaler",{"type":34,"tag":1382,"props":3634,"children":3635},{},[3636],{"type":40,"value":3637},"Automatically scales replica count based on CPU, memory, or custom metrics",{"type":34,"tag":176,"props":3639,"children":3641},{"id":3640},"a-production-deployment-manifest",[3642],{"type":40,"value":3643},"A Production Deployment Manifest",{"type":34,"tag":188,"props":3645,"children":3647},{"className":2807,"code":3646,"language":2809,"meta":7,"style":7},"apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: order-service\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: order-service\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxUnavailable: 0       # Never take a pod down before a new one is ready\n      maxSurge: 1\n  template:\n    metadata:\n      labels:\n        app: order-service\n    spec:\n      containers:\n      - name: order-service\n        image: registry.example.com/order-service:v2.4.1\n        ports: [{containerPort: 8080}]\n        resources:\n          requests:\n            cpu: \"250m\"\n            memory: \"256Mi\"\n          limits:\n            cpu: \"500m\"\n            memory: \"512Mi\"\n        livenessProbe:\n          httpGet:\n            path: /health/live\n            port: 8080\n          initialDelaySeconds: 10\n          periodSeconds: 15\n        readinessProbe:\n          httpGet:\n            path: /health/ready\n            port: 8080\n          initialDelaySeconds: 5\n          periodSeconds: 10\n        securityContext:\n          runAsNonRoot: true\n          readOnlyRootFilesystem: true\n",[3648],{"type":34,"tag":195,"props":3649,"children":3650},{"__ignoreMap":7},[3651,3668,3685,3697,3714,3726,3742,3754,3766,3782,3794,3811,3823,3845,3862,3874,3886,3898,3914,3926,3938,3958,3975,4007,4019,4031,4048,4065,4077,4093,4109,4121,4133,4150,4167,4184,4202,4215,4227,4244,4260,4277,4293,4306,4324],{"type":34,"tag":199,"props":3652,"children":3653},{"class":201,"line":202},[3654,3659,3663],{"type":34,"tag":199,"props":3655,"children":3656},{"style":2832},[3657],{"type":40,"value":3658},"apiVersion",{"type":34,"tag":199,"props":3660,"children":3661},{"style":233},[3662],{"type":40,"value":2840},{"type":34,"tag":199,"props":3664,"children":3665},{"style":883},[3666],{"type":40,"value":3667},"apps/v1\n",{"type":34,"tag":199,"props":3669,"children":3670},{"class":201,"line":212},[3671,3676,3680],{"type":34,"tag":199,"props":3672,"children":3673},{"style":2832},[3674],{"type":40,"value":3675},"kind",{"type":34,"tag":199,"props":3677,"children":3678},{"style":233},[3679],{"type":40,"value":2840},{"type":34,"tag":199,"props":3681,"children":3682},{"style":883},[3683],{"type":40,"value":3684},"Deployment\n",{"type":34,"tag":199,"props":3686,"children":3687},{"class":201,"line":278},[3688,3693],{"type":34,"tag":199,"props":3689,"children":3690},{"style":2832},[3691],{"type":40,"value":3692},"metadata",{"type":34,"tag":199,"props":3694,"children":3695},{"style":233},[3696],{"type":40,"value":2875},{"type":34,"tag":199,"props":3698,"children":3699},{"class":201,"line":287},[3700,3705,3709],{"type":34,"tag":199,"props":3701,"children":3702},{"style":2832},[3703],{"type":40,"value":3704},"  name",{"type":34,"tag":199,"props":3706,"children":3707},{"style":233},[3708],{"type":40,"value":2840},{"type":34,"tag":199,"props":3710,"children":3711},{"style":883},[3712],{"type":40,"value":3713},"order-service\n",{"type":34,"tag":199,"props":3715,"children":3716},{"class":201,"line":316},[3717,3722],{"type":34,"tag":199,"props":3718,"children":3719},{"style":2832},[3720],{"type":40,"value":3721},"spec",{"type":34,"tag":199,"props":3723,"children":3724},{"style":233},[3725],{"type":40,"value":2875},{"type":34,"tag":199,"props":3727,"children":3728},{"class":201,"line":342},[3729,3734,3738],{"type":34,"tag":199,"props":3730,"children":3731},{"style":2832},[3732],{"type":40,"value":3733},"  replicas",{"type":34,"tag":199,"props":3735,"children":3736},{"style":233},[3737],{"type":40,"value":2840},{"type":34,"tag":199,"props":3739,"children":3740},{"style":1010},[3741],{"type":40,"value":3227},{"type":34,"tag":199,"props":3743,"children":3744},{"class":201,"line":352},[3745,3750],{"type":34,"tag":199,"props":3746,"children":3747},{"style":2832},[3748],{"type":40,"value":3749},"  selector",{"type":34,"tag":199,"props":3751,"children":3752},{"style":233},[3753],{"type":40,"value":2875},{"type":34,"tag":199,"props":3755,"children":3756},{"class":201,"line":402},[3757,3762],{"type":34,"tag":199,"props":3758,"children":3759},{"style":2832},[3760],{"type":40,"value":3761},"    matchLabels",{"type":34,"tag":199,"props":3763,"children":3764},{"style":233},[3765],{"type":40,"value":2875},{"type":34,"tag":199,"props":3767,"children":3768},{"class":201,"line":421},[3769,3774,3778],{"type":34,"tag":199,"props":3770,"children":3771},{"style":2832},[3772],{"type":40,"value":3773},"      app",{"type":34,"tag":199,"props":3775,"children":3776},{"style":233},[3777],{"type":40,"value":2840},{"type":34,"tag":199,"props":3779,"children":3780},{"style":883},[3781],{"type":40,"value":3713},{"type":34,"tag":199,"props":3783,"children":3784},{"class":201,"line":440},[3785,3790],{"type":34,"tag":199,"props":3786,"children":3787},{"style":2832},[3788],{"type":40,"value":3789},"  strategy",{"type":34,"tag":199,"props":3791,"children":3792},{"style":233},[3793],{"type":40,"value":2875},{"type":34,"tag":199,"props":3795,"children":3796},{"class":201,"line":449},[3797,3802,3806],{"type":34,"tag":199,"props":3798,"children":3799},{"style":2832},[3800],{"type":40,"value":3801},"    type",{"type":34,"tag":199,"props":3803,"children":3804},{"style":233},[3805],{"type":40,"value":2840},{"type":34,"tag":199,"props":3807,"children":3808},{"style":883},[3809],{"type":40,"value":3810},"RollingUpdate\n",{"type":34,"tag":199,"props":3812,"children":3813},{"class":201,"line":483},[3814,3819],{"type":34,"tag":199,"props":3815,"children":3816},{"style":2832},[3817],{"type":40,"value":3818},"    rollingUpdate",{"type":34,"tag":199,"props":3820,"children":3821},{"style":233},[3822],{"type":40,"value":2875},{"type":34,"tag":199,"props":3824,"children":3825},{"class":201,"line":491},[3826,3831,3835,3840],{"type":34,"tag":199,"props":3827,"children":3828},{"style":2832},[3829],{"type":40,"value":3830},"      maxUnavailable",{"type":34,"tag":199,"props":3832,"children":3833},{"style":233},[3834],{"type":40,"value":2840},{"type":34,"tag":199,"props":3836,"children":3837},{"style":1010},[3838],{"type":40,"value":3839},"0",{"type":34,"tag":199,"props":3841,"children":3842},{"style":206},[3843],{"type":40,"value":3844},"       # Never take a pod down before a new one is ready\n",{"type":34,"tag":199,"props":3846,"children":3847},{"class":201,"line":505},[3848,3853,3857],{"type":34,"tag":199,"props":3849,"children":3850},{"style":2832},[3851],{"type":40,"value":3852},"      maxSurge",{"type":34,"tag":199,"props":3854,"children":3855},{"style":233},[3856],{"type":40,"value":2840},{"type":34,"tag":199,"props":3858,"children":3859},{"style":1010},[3860],{"type":40,"value":3861},"1\n",{"type":34,"tag":199,"props":3863,"children":3864},{"class":201,"line":537},[3865,3870],{"type":34,"tag":199,"props":3866,"children":3867},{"style":2832},[3868],{"type":40,"value":3869},"  template",{"type":34,"tag":199,"props":3871,"children":3872},{"style":233},[3873],{"type":40,"value":2875},{"type":34,"tag":199,"props":3875,"children":3876},{"class":201,"line":545},[3877,3882],{"type":34,"tag":199,"props":3878,"children":3879},{"style":2832},[3880],{"type":40,"value":3881},"    metadata",{"type":34,"tag":199,"props":3883,"children":3884},{"style":233},[3885],{"type":40,"value":2875},{"type":34,"tag":199,"props":3887,"children":3888},{"class":201,"line":569},[3889,3894],{"type":34,"tag":199,"props":3890,"children":3891},{"style":2832},[3892],{"type":40,"value":3893},"      labels",{"type":34,"tag":199,"props":3895,"children":3896},{"style":233},[3897],{"type":40,"value":2875},{"type":34,"tag":199,"props":3899,"children":3900},{"class":201,"line":607},[3901,3906,3910],{"type":34,"tag":199,"props":3902,"children":3903},{"style":2832},[3904],{"type":40,"value":3905},"        app",{"type":34,"tag":199,"props":3907,"children":3908},{"style":233},[3909],{"type":40,"value":2840},{"type":34,"tag":199,"props":3911,"children":3912},{"style":883},[3913],{"type":40,"value":3713},{"type":34,"tag":199,"props":3915,"children":3916},{"class":201,"line":615},[3917,3922],{"type":34,"tag":199,"props":3918,"children":3919},{"style":2832},[3920],{"type":40,"value":3921},"    spec",{"type":34,"tag":199,"props":3923,"children":3924},{"style":233},[3925],{"type":40,"value":2875},{"type":34,"tag":199,"props":3927,"children":3928},{"class":201,"line":638},[3929,3934],{"type":34,"tag":199,"props":3930,"children":3931},{"style":2832},[3932],{"type":40,"value":3933},"      containers",{"type":34,"tag":199,"props":3935,"children":3936},{"style":233},[3937],{"type":40,"value":2875},{"type":34,"tag":199,"props":3939,"children":3940},{"class":201,"line":647},[3941,3946,3950,3954],{"type":34,"tag":199,"props":3942,"children":3943},{"style":233},[3944],{"type":40,"value":3945},"      - ",{"type":34,"tag":199,"props":3947,"children":3948},{"style":2832},[3949],{"type":40,"value":2835},{"type":34,"tag":199,"props":3951,"children":3952},{"style":233},[3953],{"type":40,"value":2840},{"type":34,"tag":199,"props":3955,"children":3956},{"style":883},[3957],{"type":40,"value":3713},{"type":34,"tag":199,"props":3959,"children":3960},{"class":201,"line":656},[3961,3966,3970],{"type":34,"tag":199,"props":3962,"children":3963},{"style":2832},[3964],{"type":40,"value":3965},"        image",{"type":34,"tag":199,"props":3967,"children":3968},{"style":233},[3969],{"type":40,"value":2840},{"type":34,"tag":199,"props":3971,"children":3972},{"style":883},[3973],{"type":40,"value":3974},"registry.example.com/order-service:v2.4.1\n",{"type":34,"tag":199,"props":3976,"children":3977},{"class":201,"line":664},[3978,3983,3988,3993,3997,4002],{"type":34,"tag":199,"props":3979,"children":3980},{"style":2832},[3981],{"type":40,"value":3982},"        ports",{"type":34,"tag":199,"props":3984,"children":3985},{"style":233},[3986],{"type":40,"value":3987},": [{",{"type":34,"tag":199,"props":3989,"children":3990},{"style":2832},[3991],{"type":40,"value":3992},"containerPort",{"type":34,"tag":199,"props":3994,"children":3995},{"style":233},[3996],{"type":40,"value":2840},{"type":34,"tag":199,"props":3998,"children":3999},{"style":1010},[4000],{"type":40,"value":4001},"8080",{"type":34,"tag":199,"props":4003,"children":4004},{"style":233},[4005],{"type":40,"value":4006},"}]\n",{"type":34,"tag":199,"props":4008,"children":4009},{"class":201,"line":673},[4010,4015],{"type":34,"tag":199,"props":4011,"children":4012},{"style":2832},[4013],{"type":40,"value":4014},"        resources",{"type":34,"tag":199,"props":4016,"children":4017},{"style":233},[4018],{"type":40,"value":2875},{"type":34,"tag":199,"props":4020,"children":4021},{"class":201,"line":721},[4022,4027],{"type":34,"tag":199,"props":4023,"children":4024},{"style":2832},[4025],{"type":40,"value":4026},"          requests",{"type":34,"tag":199,"props":4028,"children":4029},{"style":233},[4030],{"type":40,"value":2875},{"type":34,"tag":199,"props":4032,"children":4033},{"class":201,"line":729},[4034,4039,4043],{"type":34,"tag":199,"props":4035,"children":4036},{"style":2832},[4037],{"type":40,"value":4038},"            cpu",{"type":34,"tag":199,"props":4040,"children":4041},{"style":233},[4042],{"type":40,"value":2840},{"type":34,"tag":199,"props":4044,"children":4045},{"style":883},[4046],{"type":40,"value":4047},"\"250m\"\n",{"type":34,"tag":199,"props":4049,"children":4050},{"class":201,"line":755},[4051,4056,4060],{"type":34,"tag":199,"props":4052,"children":4053},{"style":2832},[4054],{"type":40,"value":4055},"            memory",{"type":34,"tag":199,"props":4057,"children":4058},{"style":233},[4059],{"type":40,"value":2840},{"type":34,"tag":199,"props":4061,"children":4062},{"style":883},[4063],{"type":40,"value":4064},"\"256Mi\"\n",{"type":34,"tag":199,"props":4066,"children":4067},{"class":201,"line":763},[4068,4073],{"type":34,"tag":199,"props":4069,"children":4070},{"style":2832},[4071],{"type":40,"value":4072},"          limits",{"type":34,"tag":199,"props":4074,"children":4075},{"style":233},[4076],{"type":40,"value":2875},{"type":34,"tag":199,"props":4078,"children":4079},{"class":201,"line":826},[4080,4084,4088],{"type":34,"tag":199,"props":4081,"children":4082},{"style":2832},[4083],{"type":40,"value":4038},{"type":34,"tag":199,"props":4085,"children":4086},{"style":233},[4087],{"type":40,"value":2840},{"type":34,"tag":199,"props":4089,"children":4090},{"style":883},[4091],{"type":40,"value":4092},"\"500m\"\n",{"type":34,"tag":199,"props":4094,"children":4095},{"class":201,"line":834},[4096,4100,4104],{"type":34,"tag":199,"props":4097,"children":4098},{"style":2832},[4099],{"type":40,"value":4055},{"type":34,"tag":199,"props":4101,"children":4102},{"style":233},[4103],{"type":40,"value":2840},{"type":34,"tag":199,"props":4105,"children":4106},{"style":883},[4107],{"type":40,"value":4108},"\"512Mi\"\n",{"type":34,"tag":199,"props":4110,"children":4111},{"class":201,"line":843},[4112,4117],{"type":34,"tag":199,"props":4113,"children":4114},{"style":2832},[4115],{"type":40,"value":4116},"        livenessProbe",{"type":34,"tag":199,"props":4118,"children":4119},{"style":233},[4120],{"type":40,"value":2875},{"type":34,"tag":199,"props":4122,"children":4123},{"class":201,"line":879},[4124,4129],{"type":34,"tag":199,"props":4125,"children":4126},{"style":2832},[4127],{"type":40,"value":4128},"          httpGet",{"type":34,"tag":199,"props":4130,"children":4131},{"style":233},[4132],{"type":40,"value":2875},{"type":34,"tag":199,"props":4134,"children":4135},{"class":201,"line":893},[4136,4141,4145],{"type":34,"tag":199,"props":4137,"children":4138},{"style":2832},[4139],{"type":40,"value":4140},"            path",{"type":34,"tag":199,"props":4142,"children":4143},{"style":233},[4144],{"type":40,"value":2840},{"type":34,"tag":199,"props":4146,"children":4147},{"style":883},[4148],{"type":40,"value":4149},"/health/live\n",{"type":34,"tag":199,"props":4151,"children":4152},{"class":201,"line":907},[4153,4158,4162],{"type":34,"tag":199,"props":4154,"children":4155},{"style":2832},[4156],{"type":40,"value":4157},"            port",{"type":34,"tag":199,"props":4159,"children":4160},{"style":233},[4161],{"type":40,"value":2840},{"type":34,"tag":199,"props":4163,"children":4164},{"style":1010},[4165],{"type":40,"value":4166},"8080\n",{"type":34,"tag":199,"props":4168,"children":4169},{"class":201,"line":915},[4170,4175,4179],{"type":34,"tag":199,"props":4171,"children":4172},{"style":2832},[4173],{"type":40,"value":4174},"          initialDelaySeconds",{"type":34,"tag":199,"props":4176,"children":4177},{"style":233},[4178],{"type":40,"value":2840},{"type":34,"tag":199,"props":4180,"children":4181},{"style":1010},[4182],{"type":40,"value":4183},"10\n",{"type":34,"tag":199,"props":4185,"children":4187},{"class":201,"line":4186},36,[4188,4193,4197],{"type":34,"tag":199,"props":4189,"children":4190},{"style":2832},[4191],{"type":40,"value":4192},"          periodSeconds",{"type":34,"tag":199,"props":4194,"children":4195},{"style":233},[4196],{"type":40,"value":2840},{"type":34,"tag":199,"props":4198,"children":4199},{"style":1010},[4200],{"type":40,"value":4201},"15\n",{"type":34,"tag":199,"props":4203,"children":4205},{"class":201,"line":4204},37,[4206,4211],{"type":34,"tag":199,"props":4207,"children":4208},{"style":2832},[4209],{"type":40,"value":4210},"        readinessProbe",{"type":34,"tag":199,"props":4212,"children":4213},{"style":233},[4214],{"type":40,"value":2875},{"type":34,"tag":199,"props":4216,"children":4218},{"class":201,"line":4217},38,[4219,4223],{"type":34,"tag":199,"props":4220,"children":4221},{"style":2832},[4222],{"type":40,"value":4128},{"type":34,"tag":199,"props":4224,"children":4225},{"style":233},[4226],{"type":40,"value":2875},{"type":34,"tag":199,"props":4228,"children":4230},{"class":201,"line":4229},39,[4231,4235,4239],{"type":34,"tag":199,"props":4232,"children":4233},{"style":2832},[4234],{"type":40,"value":4140},{"type":34,"tag":199,"props":4236,"children":4237},{"style":233},[4238],{"type":40,"value":2840},{"type":34,"tag":199,"props":4240,"children":4241},{"style":883},[4242],{"type":40,"value":4243},"/health/ready\n",{"type":34,"tag":199,"props":4245,"children":4247},{"class":201,"line":4246},40,[4248,4252,4256],{"type":34,"tag":199,"props":4249,"children":4250},{"style":2832},[4251],{"type":40,"value":4157},{"type":34,"tag":199,"props":4253,"children":4254},{"style":233},[4255],{"type":40,"value":2840},{"type":34,"tag":199,"props":4257,"children":4258},{"style":1010},[4259],{"type":40,"value":4166},{"type":34,"tag":199,"props":4261,"children":4263},{"class":201,"line":4262},41,[4264,4268,4272],{"type":34,"tag":199,"props":4265,"children":4266},{"style":2832},[4267],{"type":40,"value":4174},{"type":34,"tag":199,"props":4269,"children":4270},{"style":233},[4271],{"type":40,"value":2840},{"type":34,"tag":199,"props":4273,"children":4274},{"style":1010},[4275],{"type":40,"value":4276},"5\n",{"type":34,"tag":199,"props":4278,"children":4280},{"class":201,"line":4279},42,[4281,4285,4289],{"type":34,"tag":199,"props":4282,"children":4283},{"style":2832},[4284],{"type":40,"value":4192},{"type":34,"tag":199,"props":4286,"children":4287},{"style":233},[4288],{"type":40,"value":2840},{"type":34,"tag":199,"props":4290,"children":4291},{"style":1010},[4292],{"type":40,"value":4183},{"type":34,"tag":199,"props":4294,"children":4296},{"class":201,"line":4295},43,[4297,4302],{"type":34,"tag":199,"props":4298,"children":4299},{"style":2832},[4300],{"type":40,"value":4301},"        securityContext",{"type":34,"tag":199,"props":4303,"children":4304},{"style":233},[4305],{"type":40,"value":2875},{"type":34,"tag":199,"props":4307,"children":4309},{"class":201,"line":4308},44,[4310,4315,4319],{"type":34,"tag":199,"props":4311,"children":4312},{"style":2832},[4313],{"type":40,"value":4314},"          runAsNonRoot",{"type":34,"tag":199,"props":4316,"children":4317},{"style":233},[4318],{"type":40,"value":2840},{"type":34,"tag":199,"props":4320,"children":4321},{"style":1010},[4322],{"type":40,"value":4323},"true\n",{"type":34,"tag":199,"props":4325,"children":4327},{"class":201,"line":4326},45,[4328,4333,4337],{"type":34,"tag":199,"props":4329,"children":4330},{"style":2832},[4331],{"type":40,"value":4332},"          readOnlyRootFilesystem",{"type":34,"tag":199,"props":4334,"children":4335},{"style":233},[4336],{"type":40,"value":2840},{"type":34,"tag":199,"props":4338,"children":4339},{"style":1010},[4340],{"type":40,"value":4323},{"type":34,"tag":43,"props":4342,"children":4343},{},[4344,4346,4352,4354,4360],{"type":40,"value":4345},"Setting ",{"type":34,"tag":195,"props":4347,"children":4349},{"className":4348},[],[4350],{"type":40,"value":4351},"maxUnavailable: 0",{"type":40,"value":4353}," and ",{"type":34,"tag":195,"props":4355,"children":4357},{"className":4356},[],[4358],{"type":40,"value":4359},"maxSurge: 1",{"type":40,"value":4361}," means Kubernetes always keeps the full replica count healthy during a rollout — zero-downtime deploys become the default.",{"type":34,"tag":35,"props":4363,"children":4365},{"id":4364},"case-study-containerising-a-legacy-net-platform",[4366],{"type":40,"value":4367},"Case Study: Containerising a Legacy .NET Platform",{"type":34,"tag":43,"props":4369,"children":4370},{},[4371],{"type":40,"value":4372},"A financial services client came to us with a Windows-server monolith that took three hours to deploy and consistently caused configuration drift between environments. Our containerisation project over eight weeks delivered:",{"type":34,"tag":1342,"props":4374,"children":4375},{},[4376,4394],{"type":34,"tag":1346,"props":4377,"children":4378},{},[4379],{"type":34,"tag":1350,"props":4380,"children":4381},{},[4382,4386,4390],{"type":34,"tag":1354,"props":4383,"children":4384},{},[4385],{"type":40,"value":1358},{"type":34,"tag":1354,"props":4387,"children":4388},{},[4389],{"type":40,"value":1363},{"type":34,"tag":1354,"props":4391,"children":4392},{},[4393],{"type":40,"value":1368},{"type":34,"tag":1375,"props":4395,"children":4396},{},[4397,4415,4433,4450],{"type":34,"tag":1350,"props":4398,"children":4399},{},[4400,4405,4410],{"type":34,"tag":1382,"props":4401,"children":4402},{},[4403],{"type":40,"value":4404},"Deployment time",{"type":34,"tag":1382,"props":4406,"children":4407},{},[4408],{"type":40,"value":4409},"~3 hours",{"type":34,"tag":1382,"props":4411,"children":4412},{},[4413],{"type":40,"value":4414},"~8 minutes",{"type":34,"tag":1350,"props":4416,"children":4417},{},[4418,4423,4428],{"type":34,"tag":1382,"props":4419,"children":4420},{},[4421],{"type":40,"value":4422},"Environment parity",{"type":34,"tag":1382,"props":4424,"children":4425},{},[4426],{"type":40,"value":4427},"❌ frequent drift",{"type":34,"tag":1382,"props":4429,"children":4430},{},[4431],{"type":40,"value":4432},"✅ identical images",{"type":34,"tag":1350,"props":4434,"children":4435},{},[4436,4441,4445],{"type":34,"tag":1382,"props":4437,"children":4438},{},[4439],{"type":40,"value":4440},"Infrastructure cost",{"type":34,"tag":1382,"props":4442,"children":4443},{},[4444],{"type":40,"value":1526},{"type":34,"tag":1382,"props":4446,"children":4447},{},[4448],{"type":40,"value":4449},"−40%",{"type":34,"tag":1350,"props":4451,"children":4452},{},[4453,4458,4462],{"type":34,"tag":1382,"props":4454,"children":4455},{},[4456],{"type":40,"value":4457},"Release cadence",{"type":34,"tag":1382,"props":4459,"children":4460},{},[4461],{"type":40,"value":1647},{"type":34,"tag":1382,"props":4463,"children":4464},{},[4465],{"type":40,"value":4466},"weekly",{"type":34,"tag":43,"props":4468,"children":4469},{},[4470],{"type":40,"value":4471},"The key steps: extracting configuration into environment variables, adding structured health-check endpoints the probes could target, building images in CI using multi-stage Dockerfiles, and deploying to AKS with Helm charts versioned alongside the application code.",{"type":34,"tag":35,"props":4473,"children":4475},{"id":4474},"what-to-containerise-first",[4476],{"type":40,"value":4477},"What to Containerise First",{"type":34,"tag":43,"props":4479,"children":4480},{},[4481],{"type":40,"value":4482},"Not everything benefits equally from containerisation. Start here:",{"type":34,"tag":121,"props":4484,"children":4485},{},[4486,4496,4506],{"type":34,"tag":58,"props":4487,"children":4488},{},[4489,4494],{"type":34,"tag":62,"props":4490,"children":4491},{},[4492],{"type":40,"value":4493},"Stateless HTTP services",{"type":40,"value":4495}," — the easiest wins with the highest immediate benefit",{"type":34,"tag":58,"props":4497,"children":4498},{},[4499,4504],{"type":34,"tag":62,"props":4500,"children":4501},{},[4502],{"type":40,"value":4503},"Background workers and scheduled jobs",{"type":40,"value":4505}," — clean separation of concerns from your main API",{"type":34,"tag":58,"props":4507,"children":4508},{},[4509,4514],{"type":34,"tag":62,"props":4510,"children":4511},{},[4512],{"type":40,"value":4513},"Third-party dependencies in dev",{"type":40,"value":4515}," (databases, queues, email servers) — Compose makes local parity trivial",{"type":34,"tag":43,"props":4517,"children":4518},{},[4519],{"type":40,"value":4520},"Tackle stateful services (primary databases, file stores) last, and only when you have a solid understanding of volume management and backup strategies in your target cluster.",{"type":34,"tag":43,"props":4522,"children":4523},{},[4524],{"type":40,"value":4525},"Containerisation isn't a destination—it's the foundation for everything from zero-downtime deployments to auto-scaling to disaster recovery. Build the discipline into your workflow from day one.",{"type":34,"tag":1748,"props":4527,"children":4528},{},[4529],{"type":40,"value":1752},{"title":7,"searchDepth":278,"depth":278,"links":4531},[4532,4533,4534,4538,4539,4543,4544],{"id":2450,"depth":212,"text":2453},{"id":2482,"depth":212,"text":2485},{"id":2541,"depth":212,"text":2544,"children":4535},[4536,4537],{"id":2552,"depth":278,"text":2555},{"id":2713,"depth":278,"text":2716},{"id":2929,"depth":212,"text":2932},{"id":3522,"depth":212,"text":3525,"children":4540},[4541,4542],{"id":3533,"depth":278,"text":3536},{"id":3640,"depth":278,"text":3643},{"id":4364,"depth":212,"text":4367},{"id":4474,"depth":212,"text":4477},"content:blog:containerization-guide.md","blog/containerization-guide.md","blog/containerization-guide",{"_path":4549,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":4550,"description":4551,"slug":4552,"date":4553,"readTime":4554,"category":4555,"image":4556,"imageCaption":4557,"author":4558,"tags":4560,"body":4566,"_type":1767,"_id":7304,"_source":1769,"_file":7305,"_stem":7306,"_extension":1772},"/blog/database-optimization","Database Performance Optimisation: How We Cut Query Time from 1200ms to 85ms","A deep-dive into the indexing strategies, query rewrites, and caching techniques that tripled throughput for a 50,000+ orders/day e-commerce platform—and the systematic process you can replicate.","database-optimization","2025-01-30","13 min","Backend","https://images.unsplash.com/photo-1544383835-bda2bc66a55d?w=1200&h=600&fit=crop&auto=format","Server infrastructure powering high-throughput database operations",{"name":17,"role":18,"avatar":19,"bio":20,"social":4559},{"github":22,"twitter":23,"linkedin":24},[4561,4562,4563,4564,4565],"Databases","PostgreSQL","Performance","Optimisation","Scalability",{"type":31,"children":4567,"toc":7283},[4568,4574,4579,4584,4590,4595,4649,4854,4859,4865,4871,4876,5188,5193,5247,5253,5258,5390,5396,5401,5687,5693,5698,5704,5709,5753,5758,5784,5790,5795,5973,5993,5999,6004,6087,6092,6098,6103,6230,6235,6241,6246,6252,6774,6779,6785,6790,7054,7065,7071,7076,7171,7176,7182,7187,7274,7279],{"type":34,"tag":35,"props":4569,"children":4571},{"id":4570},"the-problem-no-one-sees-until-its-too-late",[4572],{"type":40,"value":4573},"The Problem No One Sees Until It's Too Late",{"type":34,"tag":43,"props":4575,"children":4576},{},[4577],{"type":40,"value":4578},"Database performance rarely degrades all at once. It creeps up gradually: a query that took 80ms at launch takes 300ms after six months of data growth, then 900ms a year later. By the time users notice slowness, the problem is already severe.",{"type":34,"tag":43,"props":4580,"children":4581},{},[4582],{"type":40,"value":4583},"We see this pattern repeatedly at MediaFront. The good news: most database performance issues stem from the same handful of root causes, and fixing them systematically delivers dramatic improvements without hardware upgrades.",{"type":34,"tag":35,"props":4585,"children":4587},{"id":4586},"start-with-measurement-not-guesses",[4588],{"type":40,"value":4589},"Start With Measurement, Not Guesses",{"type":34,"tag":43,"props":4591,"children":4592},{},[4593],{"type":40,"value":4594},"Every optimisation project begins the same way: instrument before you optimise. Guessing which query is slow wastes weeks. Your tools:",{"type":34,"tag":54,"props":4596,"children":4597},{},[4598,4614,4639],{"type":34,"tag":58,"props":4599,"children":4600},{},[4601,4605,4606,4612],{"type":34,"tag":62,"props":4602,"children":4603},{},[4604],{"type":40,"value":4562},{"type":40,"value":2778},{"type":34,"tag":195,"props":4607,"children":4609},{"className":4608},[],[4610],{"type":40,"value":4611},"pg_stat_statements",{"type":40,"value":4613}," extension tracks cumulative query execution time across all calls",{"type":34,"tag":58,"props":4615,"children":4616},{},[4617,4622,4624,4630,4631,4637],{"type":34,"tag":62,"props":4618,"children":4619},{},[4620],{"type":40,"value":4621},"MySQL",{"type":40,"value":4623}," — the ",{"type":34,"tag":195,"props":4625,"children":4627},{"className":4626},[],[4628],{"type":40,"value":4629},"slow_query_log",{"type":40,"value":3511},{"type":34,"tag":195,"props":4632,"children":4634},{"className":4633},[],[4635],{"type":40,"value":4636},"long_query_time = 0.1",{"type":40,"value":4638}," captures everything above 100ms",{"type":34,"tag":58,"props":4640,"children":4641},{},[4642,4647],{"type":34,"tag":62,"props":4643,"children":4644},{},[4645],{"type":40,"value":4646},"SQL Server",{"type":40,"value":4648}," — Query Store provides a GUI over the same data",{"type":34,"tag":188,"props":4650,"children":4654},{"className":4651,"code":4652,"language":4653,"meta":7,"style":7},"language-sql shiki shiki-themes github-light","-- Find your 10 most expensive queries in PostgreSQL\nSELECT\n  query,\n  calls,\n  round(total_exec_time::numeric, 2) AS total_ms,\n  round(mean_exec_time::numeric, 2)  AS avg_ms,\n  round(stddev_exec_time::numeric, 2) AS stddev_ms\nFROM pg_stat_statements\nORDER BY total_exec_time DESC\nLIMIT 10;\n","sql",[4655],{"type":34,"tag":195,"props":4656,"children":4657},{"__ignoreMap":7},[4658,4666,4674,4682,4690,4731,4769,4806,4819,4837],{"type":34,"tag":199,"props":4659,"children":4660},{"class":201,"line":202},[4661],{"type":34,"tag":199,"props":4662,"children":4663},{"style":206},[4664],{"type":40,"value":4665},"-- Find your 10 most expensive queries in PostgreSQL\n",{"type":34,"tag":199,"props":4667,"children":4668},{"class":201,"line":212},[4669],{"type":34,"tag":199,"props":4670,"children":4671},{"style":216},[4672],{"type":40,"value":4673},"SELECT\n",{"type":34,"tag":199,"props":4675,"children":4676},{"class":201,"line":278},[4677],{"type":34,"tag":199,"props":4678,"children":4679},{"style":233},[4680],{"type":40,"value":4681},"  query,\n",{"type":34,"tag":199,"props":4683,"children":4684},{"class":201,"line":287},[4685],{"type":34,"tag":199,"props":4686,"children":4687},{"style":233},[4688],{"type":40,"value":4689},"  calls,\n",{"type":34,"tag":199,"props":4691,"children":4692},{"class":201,"line":316},[4693,4698,4703,4708,4712,4717,4721,4726],{"type":34,"tag":199,"props":4694,"children":4695},{"style":1010},[4696],{"type":40,"value":4697},"  round",{"type":34,"tag":199,"props":4699,"children":4700},{"style":233},[4701],{"type":40,"value":4702},"(total_exec_time::",{"type":34,"tag":199,"props":4704,"children":4705},{"style":216},[4706],{"type":40,"value":4707},"numeric",{"type":34,"tag":199,"props":4709,"children":4710},{"style":233},[4711],{"type":40,"value":256},{"type":34,"tag":199,"props":4713,"children":4714},{"style":1010},[4715],{"type":40,"value":4716},"2",{"type":34,"tag":199,"props":4718,"children":4719},{"style":233},[4720],{"type":40,"value":1018},{"type":34,"tag":199,"props":4722,"children":4723},{"style":216},[4724],{"type":40,"value":4725},"AS",{"type":34,"tag":199,"props":4727,"children":4728},{"style":233},[4729],{"type":40,"value":4730}," total_ms,\n",{"type":34,"tag":199,"props":4732,"children":4733},{"class":201,"line":342},[4734,4738,4743,4747,4751,4755,4760,4764],{"type":34,"tag":199,"props":4735,"children":4736},{"style":1010},[4737],{"type":40,"value":4697},{"type":34,"tag":199,"props":4739,"children":4740},{"style":233},[4741],{"type":40,"value":4742},"(mean_exec_time::",{"type":34,"tag":199,"props":4744,"children":4745},{"style":216},[4746],{"type":40,"value":4707},{"type":34,"tag":199,"props":4748,"children":4749},{"style":233},[4750],{"type":40,"value":256},{"type":34,"tag":199,"props":4752,"children":4753},{"style":1010},[4754],{"type":40,"value":4716},{"type":34,"tag":199,"props":4756,"children":4757},{"style":233},[4758],{"type":40,"value":4759},")  ",{"type":34,"tag":199,"props":4761,"children":4762},{"style":216},[4763],{"type":40,"value":4725},{"type":34,"tag":199,"props":4765,"children":4766},{"style":233},[4767],{"type":40,"value":4768}," avg_ms,\n",{"type":34,"tag":199,"props":4770,"children":4771},{"class":201,"line":352},[4772,4776,4781,4785,4789,4793,4797,4801],{"type":34,"tag":199,"props":4773,"children":4774},{"style":1010},[4775],{"type":40,"value":4697},{"type":34,"tag":199,"props":4777,"children":4778},{"style":233},[4779],{"type":40,"value":4780},"(stddev_exec_time::",{"type":34,"tag":199,"props":4782,"children":4783},{"style":216},[4784],{"type":40,"value":4707},{"type":34,"tag":199,"props":4786,"children":4787},{"style":233},[4788],{"type":40,"value":256},{"type":34,"tag":199,"props":4790,"children":4791},{"style":1010},[4792],{"type":40,"value":4716},{"type":34,"tag":199,"props":4794,"children":4795},{"style":233},[4796],{"type":40,"value":1018},{"type":34,"tag":199,"props":4798,"children":4799},{"style":216},[4800],{"type":40,"value":4725},{"type":34,"tag":199,"props":4802,"children":4803},{"style":233},[4804],{"type":40,"value":4805}," stddev_ms\n",{"type":34,"tag":199,"props":4807,"children":4808},{"class":201,"line":402},[4809,4814],{"type":34,"tag":199,"props":4810,"children":4811},{"style":216},[4812],{"type":40,"value":4813},"FROM",{"type":34,"tag":199,"props":4815,"children":4816},{"style":233},[4817],{"type":40,"value":4818}," pg_stat_statements\n",{"type":34,"tag":199,"props":4820,"children":4821},{"class":201,"line":421},[4822,4827,4832],{"type":34,"tag":199,"props":4823,"children":4824},{"style":216},[4825],{"type":40,"value":4826},"ORDER BY",{"type":34,"tag":199,"props":4828,"children":4829},{"style":233},[4830],{"type":40,"value":4831}," total_exec_time ",{"type":34,"tag":199,"props":4833,"children":4834},{"style":216},[4835],{"type":40,"value":4836},"DESC\n",{"type":34,"tag":199,"props":4838,"children":4839},{"class":201,"line":440},[4840,4845,4850],{"type":34,"tag":199,"props":4841,"children":4842},{"style":216},[4843],{"type":40,"value":4844},"LIMIT",{"type":34,"tag":199,"props":4846,"children":4847},{"style":1010},[4848],{"type":40,"value":4849}," 10",{"type":34,"tag":199,"props":4851,"children":4852},{"style":233},[4853],{"type":40,"value":313},{"type":34,"tag":43,"props":4855,"children":4856},{},[4857],{"type":40,"value":4858},"Fix the queries at the top of this list first. A 10× improvement on a query called 10,000 times per day is worth far more than a 100× improvement on one called 20 times.",{"type":34,"tag":35,"props":4860,"children":4862},{"id":4861},"query-optimisation-the-high-roi-fixes",[4863],{"type":40,"value":4864},"Query Optimisation: The High-ROI Fixes",{"type":34,"tag":176,"props":4866,"children":4868},{"id":4867},"always-run-explain-analyze",[4869],{"type":40,"value":4870},"Always Run EXPLAIN ANALYZE",{"type":34,"tag":43,"props":4872,"children":4873},{},[4874],{"type":40,"value":4875},"Before touching an index or schema, understand how the database executes the query:",{"type":34,"tag":188,"props":4877,"children":4879},{"className":4651,"code":4878,"language":4653,"meta":7,"style":7},"EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)\nSELECT\n    c.customer_id,\n    c.name,\n    COUNT(o.order_id)     AS order_count,\n    SUM(o.total_amount)   AS total_spent\nFROM customers c\nLEFT JOIN orders o ON c.customer_id = o.customer_id\nWHERE c.signup_date > '2024-01-01'\nGROUP BY c.customer_id, c.name\nORDER BY total_spent DESC\nLIMIT 100;\n",[4880],{"type":34,"tag":195,"props":4881,"children":4882},{"__ignoreMap":7},[4883,4900,4907,4928,4947,4987,5026,5038,5087,5118,5156,5172],{"type":34,"tag":199,"props":4884,"children":4885},{"class":201,"line":202},[4886,4891,4896],{"type":34,"tag":199,"props":4887,"children":4888},{"style":233},[4889],{"type":40,"value":4890},"EXPLAIN (ANALYZE, BUFFERS, FORMAT ",{"type":34,"tag":199,"props":4892,"children":4893},{"style":216},[4894],{"type":40,"value":4895},"TEXT",{"type":34,"tag":199,"props":4897,"children":4898},{"style":233},[4899],{"type":40,"value":437},{"type":34,"tag":199,"props":4901,"children":4902},{"class":201,"line":212},[4903],{"type":34,"tag":199,"props":4904,"children":4905},{"style":216},[4906],{"type":40,"value":4673},{"type":34,"tag":199,"props":4908,"children":4909},{"class":201,"line":278},[4910,4915,4919,4924],{"type":34,"tag":199,"props":4911,"children":4912},{"style":1010},[4913],{"type":40,"value":4914},"    c",{"type":34,"tag":199,"props":4916,"children":4917},{"style":233},[4918],{"type":40,"value":2474},{"type":34,"tag":199,"props":4920,"children":4921},{"style":1010},[4922],{"type":40,"value":4923},"customer_id",{"type":34,"tag":199,"props":4925,"children":4926},{"style":233},[4927],{"type":40,"value":418},{"type":34,"tag":199,"props":4929,"children":4930},{"class":201,"line":287},[4931,4935,4939,4943],{"type":34,"tag":199,"props":4932,"children":4933},{"style":1010},[4934],{"type":40,"value":4914},{"type":34,"tag":199,"props":4936,"children":4937},{"style":233},[4938],{"type":40,"value":2474},{"type":34,"tag":199,"props":4940,"children":4941},{"style":1010},[4942],{"type":40,"value":2835},{"type":34,"tag":199,"props":4944,"children":4945},{"style":233},[4946],{"type":40,"value":418},{"type":34,"tag":199,"props":4948,"children":4949},{"class":201,"line":316},[4950,4955,4959,4964,4968,4973,4978,4982],{"type":34,"tag":199,"props":4951,"children":4952},{"style":1010},[4953],{"type":40,"value":4954},"    COUNT",{"type":34,"tag":199,"props":4956,"children":4957},{"style":233},[4958],{"type":40,"value":589},{"type":34,"tag":199,"props":4960,"children":4961},{"style":1010},[4962],{"type":40,"value":4963},"o",{"type":34,"tag":199,"props":4965,"children":4966},{"style":233},[4967],{"type":40,"value":2474},{"type":34,"tag":199,"props":4969,"children":4970},{"style":1010},[4971],{"type":40,"value":4972},"order_id",{"type":34,"tag":199,"props":4974,"children":4975},{"style":233},[4976],{"type":40,"value":4977},")     ",{"type":34,"tag":199,"props":4979,"children":4980},{"style":216},[4981],{"type":40,"value":4725},{"type":34,"tag":199,"props":4983,"children":4984},{"style":233},[4985],{"type":40,"value":4986}," order_count,\n",{"type":34,"tag":199,"props":4988,"children":4989},{"class":201,"line":342},[4990,4995,4999,5003,5007,5012,5017,5021],{"type":34,"tag":199,"props":4991,"children":4992},{"style":1010},[4993],{"type":40,"value":4994},"    SUM",{"type":34,"tag":199,"props":4996,"children":4997},{"style":233},[4998],{"type":40,"value":589},{"type":34,"tag":199,"props":5000,"children":5001},{"style":1010},[5002],{"type":40,"value":4963},{"type":34,"tag":199,"props":5004,"children":5005},{"style":233},[5006],{"type":40,"value":2474},{"type":34,"tag":199,"props":5008,"children":5009},{"style":1010},[5010],{"type":40,"value":5011},"total_amount",{"type":34,"tag":199,"props":5013,"children":5014},{"style":233},[5015],{"type":40,"value":5016},")   ",{"type":34,"tag":199,"props":5018,"children":5019},{"style":216},[5020],{"type":40,"value":4725},{"type":34,"tag":199,"props":5022,"children":5023},{"style":233},[5024],{"type":40,"value":5025}," total_spent\n",{"type":34,"tag":199,"props":5027,"children":5028},{"class":201,"line":352},[5029,5033],{"type":34,"tag":199,"props":5030,"children":5031},{"style":216},[5032],{"type":40,"value":4813},{"type":34,"tag":199,"props":5034,"children":5035},{"style":233},[5036],{"type":40,"value":5037}," customers c\n",{"type":34,"tag":199,"props":5039,"children":5040},{"class":201,"line":402},[5041,5046,5051,5056,5061,5065,5069,5073,5078,5082],{"type":34,"tag":199,"props":5042,"children":5043},{"style":216},[5044],{"type":40,"value":5045},"LEFT JOIN",{"type":34,"tag":199,"props":5047,"children":5048},{"style":233},[5049],{"type":40,"value":5050}," orders o ",{"type":34,"tag":199,"props":5052,"children":5053},{"style":216},[5054],{"type":40,"value":5055},"ON",{"type":34,"tag":199,"props":5057,"children":5058},{"style":1010},[5059],{"type":40,"value":5060}," c",{"type":34,"tag":199,"props":5062,"children":5063},{"style":233},[5064],{"type":40,"value":2474},{"type":34,"tag":199,"props":5066,"children":5067},{"style":1010},[5068],{"type":40,"value":4923},{"type":34,"tag":199,"props":5070,"children":5071},{"style":216},[5072],{"type":40,"value":465},{"type":34,"tag":199,"props":5074,"children":5075},{"style":1010},[5076],{"type":40,"value":5077}," o",{"type":34,"tag":199,"props":5079,"children":5080},{"style":233},[5081],{"type":40,"value":2474},{"type":34,"tag":199,"props":5083,"children":5084},{"style":1010},[5085],{"type":40,"value":5086},"customer_id\n",{"type":34,"tag":199,"props":5088,"children":5089},{"class":201,"line":421},[5090,5095,5099,5103,5108,5113],{"type":34,"tag":199,"props":5091,"children":5092},{"style":216},[5093],{"type":40,"value":5094},"WHERE",{"type":34,"tag":199,"props":5096,"children":5097},{"style":1010},[5098],{"type":40,"value":5060},{"type":34,"tag":199,"props":5100,"children":5101},{"style":233},[5102],{"type":40,"value":2474},{"type":34,"tag":199,"props":5104,"children":5105},{"style":1010},[5106],{"type":40,"value":5107},"signup_date",{"type":34,"tag":199,"props":5109,"children":5110},{"style":216},[5111],{"type":40,"value":5112}," >",{"type":34,"tag":199,"props":5114,"children":5115},{"style":883},[5116],{"type":40,"value":5117}," '2024-01-01'\n",{"type":34,"tag":199,"props":5119,"children":5120},{"class":201,"line":440},[5121,5126,5130,5134,5138,5142,5147,5151],{"type":34,"tag":199,"props":5122,"children":5123},{"style":216},[5124],{"type":40,"value":5125},"GROUP BY",{"type":34,"tag":199,"props":5127,"children":5128},{"style":1010},[5129],{"type":40,"value":5060},{"type":34,"tag":199,"props":5131,"children":5132},{"style":233},[5133],{"type":40,"value":2474},{"type":34,"tag":199,"props":5135,"children":5136},{"style":1010},[5137],{"type":40,"value":4923},{"type":34,"tag":199,"props":5139,"children":5140},{"style":233},[5141],{"type":40,"value":256},{"type":34,"tag":199,"props":5143,"children":5144},{"style":1010},[5145],{"type":40,"value":5146},"c",{"type":34,"tag":199,"props":5148,"children":5149},{"style":233},[5150],{"type":40,"value":2474},{"type":34,"tag":199,"props":5152,"children":5153},{"style":1010},[5154],{"type":40,"value":5155},"name\n",{"type":34,"tag":199,"props":5157,"children":5158},{"class":201,"line":449},[5159,5163,5168],{"type":34,"tag":199,"props":5160,"children":5161},{"style":216},[5162],{"type":40,"value":4826},{"type":34,"tag":199,"props":5164,"children":5165},{"style":233},[5166],{"type":40,"value":5167}," total_spent ",{"type":34,"tag":199,"props":5169,"children":5170},{"style":216},[5171],{"type":40,"value":4836},{"type":34,"tag":199,"props":5173,"children":5174},{"class":201,"line":483},[5175,5179,5184],{"type":34,"tag":199,"props":5176,"children":5177},{"style":216},[5178],{"type":40,"value":4844},{"type":34,"tag":199,"props":5180,"children":5181},{"style":1010},[5182],{"type":40,"value":5183}," 100",{"type":34,"tag":199,"props":5185,"children":5186},{"style":233},[5187],{"type":40,"value":313},{"type":34,"tag":43,"props":5189,"children":5190},{},[5191],{"type":40,"value":5192},"Red flags in the output:",{"type":34,"tag":54,"props":5194,"children":5195},{},[5196,5207,5234],{"type":34,"tag":58,"props":5197,"children":5198},{},[5199,5205],{"type":34,"tag":195,"props":5200,"children":5202},{"className":5201},[],[5203],{"type":40,"value":5204},"Seq Scan",{"type":40,"value":5206}," on a large table — almost always an index opportunity",{"type":34,"tag":58,"props":5208,"children":5209},{},[5210,5216,5218,5224,5226,5232],{"type":34,"tag":195,"props":5211,"children":5213},{"className":5212},[],[5214],{"type":40,"value":5215},"Hash Join",{"type":40,"value":5217}," with large ",{"type":34,"tag":195,"props":5219,"children":5221},{"className":5220},[],[5222],{"type":40,"value":5223},"Batches",{"type":40,"value":5225}," — memory pressure, increase ",{"type":34,"tag":195,"props":5227,"children":5229},{"className":5228},[],[5230],{"type":40,"value":5231},"work_mem",{"type":40,"value":5233}," or add an index",{"type":34,"tag":58,"props":5235,"children":5236},{},[5237,5239,5245],{"type":40,"value":5238},"High ",{"type":34,"tag":195,"props":5240,"children":5242},{"className":5241},[],[5243],{"type":40,"value":5244},"Buffers: shared read",{"type":40,"value":5246}," — data not in cache, consider a covering index",{"type":34,"tag":176,"props":5248,"children":5250},{"id":5249},"stop-using-select",[5251],{"type":40,"value":5252},"Stop Using SELECT *",{"type":34,"tag":43,"props":5254,"children":5255},{},[5256],{"type":40,"value":5257},"This single habit kills performance in multiple ways: it fetches columns you'll never use, prevents covering-index optimisation, and bloats network payloads.",{"type":34,"tag":188,"props":5259,"children":5261},{"className":4651,"code":5260,"language":4653,"meta":7,"style":7},"-- ❌ Fetches all 22 columns including large TEXT fields\nSELECT * FROM products WHERE category_id = 5;\n\n-- ✅ Fetches exactly what the UI renders\nSELECT product_id, name, price, stock_qty\nFROM products\nWHERE category_id = 5;\n",[5262],{"type":34,"tag":195,"props":5263,"children":5264},{"__ignoreMap":7},[5265,5273,5319,5326,5334,5355,5367],{"type":34,"tag":199,"props":5266,"children":5267},{"class":201,"line":202},[5268],{"type":34,"tag":199,"props":5269,"children":5270},{"style":206},[5271],{"type":40,"value":5272},"-- ❌ Fetches all 22 columns including large TEXT fields\n",{"type":34,"tag":199,"props":5274,"children":5275},{"class":201,"line":212},[5276,5281,5286,5291,5296,5300,5305,5310,5315],{"type":34,"tag":199,"props":5277,"children":5278},{"style":216},[5279],{"type":40,"value":5280},"SELECT",{"type":34,"tag":199,"props":5282,"children":5283},{"style":216},[5284],{"type":40,"value":5285}," *",{"type":34,"tag":199,"props":5287,"children":5288},{"style":216},[5289],{"type":40,"value":5290}," FROM",{"type":34,"tag":199,"props":5292,"children":5293},{"style":233},[5294],{"type":40,"value":5295}," products ",{"type":34,"tag":199,"props":5297,"children":5298},{"style":216},[5299],{"type":40,"value":5094},{"type":34,"tag":199,"props":5301,"children":5302},{"style":233},[5303],{"type":40,"value":5304}," category_id ",{"type":34,"tag":199,"props":5306,"children":5307},{"style":216},[5308],{"type":40,"value":5309},"=",{"type":34,"tag":199,"props":5311,"children":5312},{"style":1010},[5313],{"type":40,"value":5314}," 5",{"type":34,"tag":199,"props":5316,"children":5317},{"style":233},[5318],{"type":40,"value":313},{"type":34,"tag":199,"props":5320,"children":5321},{"class":201,"line":278},[5322],{"type":34,"tag":199,"props":5323,"children":5324},{"emptyLinePlaceholder":346},[5325],{"type":40,"value":349},{"type":34,"tag":199,"props":5327,"children":5328},{"class":201,"line":287},[5329],{"type":34,"tag":199,"props":5330,"children":5331},{"style":206},[5332],{"type":40,"value":5333},"-- ✅ Fetches exactly what the UI renders\n",{"type":34,"tag":199,"props":5335,"children":5336},{"class":201,"line":316},[5337,5341,5346,5350],{"type":34,"tag":199,"props":5338,"children":5339},{"style":216},[5340],{"type":40,"value":5280},{"type":34,"tag":199,"props":5342,"children":5343},{"style":233},[5344],{"type":40,"value":5345}," product_id, ",{"type":34,"tag":199,"props":5347,"children":5348},{"style":216},[5349],{"type":40,"value":2835},{"type":34,"tag":199,"props":5351,"children":5352},{"style":233},[5353],{"type":40,"value":5354},", price, stock_qty\n",{"type":34,"tag":199,"props":5356,"children":5357},{"class":201,"line":342},[5358,5362],{"type":34,"tag":199,"props":5359,"children":5360},{"style":216},[5361],{"type":40,"value":4813},{"type":34,"tag":199,"props":5363,"children":5364},{"style":233},[5365],{"type":40,"value":5366}," products\n",{"type":34,"tag":199,"props":5368,"children":5369},{"class":201,"line":352},[5370,5374,5378,5382,5386],{"type":34,"tag":199,"props":5371,"children":5372},{"style":216},[5373],{"type":40,"value":5094},{"type":34,"tag":199,"props":5375,"children":5376},{"style":233},[5377],{"type":40,"value":5304},{"type":34,"tag":199,"props":5379,"children":5380},{"style":216},[5381],{"type":40,"value":5309},{"type":34,"tag":199,"props":5383,"children":5384},{"style":1010},[5385],{"type":40,"value":5314},{"type":34,"tag":199,"props":5387,"children":5388},{"style":233},[5389],{"type":40,"value":313},{"type":34,"tag":176,"props":5391,"children":5393},{"id":5392},"rewrite-correlated-subqueries-as-joins",[5394],{"type":40,"value":5395},"Rewrite Correlated Subqueries as Joins",{"type":34,"tag":43,"props":5397,"children":5398},{},[5399],{"type":40,"value":5400},"Correlated subqueries execute once per row of the outer query. On a table with 500,000 rows, a correlated subquery that takes 0.5ms runs for 250 seconds total.",{"type":34,"tag":188,"props":5402,"children":5404},{"className":4651,"code":5403,"language":4653,"meta":7,"style":7},"-- ❌ Correlated subquery — O(n) database calls\nSELECT name,\n  (SELECT MAX(order_date) FROM orders WHERE customer_id = c.id) AS last_order\nFROM customers c;\n\n-- ✅ Single-pass join\nSELECT c.name, o.last_order\nFROM customers c\nLEFT JOIN (\n  SELECT customer_id, MAX(order_date) AS last_order\n  FROM orders\n  GROUP BY customer_id\n) o ON c.id = o.customer_id;\n",[5405],{"type":34,"tag":195,"props":5406,"children":5407},{"__ignoreMap":7},[5408,5416,5432,5501,5513,5520,5528,5564,5575,5587,5617,5630,5643],{"type":34,"tag":199,"props":5409,"children":5410},{"class":201,"line":202},[5411],{"type":34,"tag":199,"props":5412,"children":5413},{"style":206},[5414],{"type":40,"value":5415},"-- ❌ Correlated subquery — O(n) database calls\n",{"type":34,"tag":199,"props":5417,"children":5418},{"class":201,"line":212},[5419,5423,5428],{"type":34,"tag":199,"props":5420,"children":5421},{"style":216},[5422],{"type":40,"value":5280},{"type":34,"tag":199,"props":5424,"children":5425},{"style":216},[5426],{"type":40,"value":5427}," name",{"type":34,"tag":199,"props":5429,"children":5430},{"style":233},[5431],{"type":40,"value":418},{"type":34,"tag":199,"props":5433,"children":5434},{"class":201,"line":278},[5435,5440,5444,5449,5454,5458,5463,5467,5472,5476,5480,5484,5488,5492,5496],{"type":34,"tag":199,"props":5436,"children":5437},{"style":233},[5438],{"type":40,"value":5439},"  (",{"type":34,"tag":199,"props":5441,"children":5442},{"style":216},[5443],{"type":40,"value":5280},{"type":34,"tag":199,"props":5445,"children":5446},{"style":1010},[5447],{"type":40,"value":5448}," MAX",{"type":34,"tag":199,"props":5450,"children":5451},{"style":233},[5452],{"type":40,"value":5453},"(order_date) ",{"type":34,"tag":199,"props":5455,"children":5456},{"style":216},[5457],{"type":40,"value":4813},{"type":34,"tag":199,"props":5459,"children":5460},{"style":233},[5461],{"type":40,"value":5462}," orders ",{"type":34,"tag":199,"props":5464,"children":5465},{"style":216},[5466],{"type":40,"value":5094},{"type":34,"tag":199,"props":5468,"children":5469},{"style":233},[5470],{"type":40,"value":5471}," customer_id ",{"type":34,"tag":199,"props":5473,"children":5474},{"style":216},[5475],{"type":40,"value":5309},{"type":34,"tag":199,"props":5477,"children":5478},{"style":1010},[5479],{"type":40,"value":5060},{"type":34,"tag":199,"props":5481,"children":5482},{"style":233},[5483],{"type":40,"value":2474},{"type":34,"tag":199,"props":5485,"children":5486},{"style":1010},[5487],{"type":40,"value":1002},{"type":34,"tag":199,"props":5489,"children":5490},{"style":233},[5491],{"type":40,"value":1018},{"type":34,"tag":199,"props":5493,"children":5494},{"style":216},[5495],{"type":40,"value":4725},{"type":34,"tag":199,"props":5497,"children":5498},{"style":233},[5499],{"type":40,"value":5500}," last_order\n",{"type":34,"tag":199,"props":5502,"children":5503},{"class":201,"line":287},[5504,5508],{"type":34,"tag":199,"props":5505,"children":5506},{"style":216},[5507],{"type":40,"value":4813},{"type":34,"tag":199,"props":5509,"children":5510},{"style":233},[5511],{"type":40,"value":5512}," customers c;\n",{"type":34,"tag":199,"props":5514,"children":5515},{"class":201,"line":316},[5516],{"type":34,"tag":199,"props":5517,"children":5518},{"emptyLinePlaceholder":346},[5519],{"type":40,"value":349},{"type":34,"tag":199,"props":5521,"children":5522},{"class":201,"line":342},[5523],{"type":34,"tag":199,"props":5524,"children":5525},{"style":206},[5526],{"type":40,"value":5527},"-- ✅ Single-pass join\n",{"type":34,"tag":199,"props":5529,"children":5530},{"class":201,"line":352},[5531,5535,5539,5543,5547,5551,5555,5559],{"type":34,"tag":199,"props":5532,"children":5533},{"style":216},[5534],{"type":40,"value":5280},{"type":34,"tag":199,"props":5536,"children":5537},{"style":1010},[5538],{"type":40,"value":5060},{"type":34,"tag":199,"props":5540,"children":5541},{"style":233},[5542],{"type":40,"value":2474},{"type":34,"tag":199,"props":5544,"children":5545},{"style":1010},[5546],{"type":40,"value":2835},{"type":34,"tag":199,"props":5548,"children":5549},{"style":233},[5550],{"type":40,"value":256},{"type":34,"tag":199,"props":5552,"children":5553},{"style":1010},[5554],{"type":40,"value":4963},{"type":34,"tag":199,"props":5556,"children":5557},{"style":233},[5558],{"type":40,"value":2474},{"type":34,"tag":199,"props":5560,"children":5561},{"style":1010},[5562],{"type":40,"value":5563},"last_order\n",{"type":34,"tag":199,"props":5565,"children":5566},{"class":201,"line":402},[5567,5571],{"type":34,"tag":199,"props":5568,"children":5569},{"style":216},[5570],{"type":40,"value":4813},{"type":34,"tag":199,"props":5572,"children":5573},{"style":233},[5574],{"type":40,"value":5037},{"type":34,"tag":199,"props":5576,"children":5577},{"class":201,"line":421},[5578,5582],{"type":34,"tag":199,"props":5579,"children":5580},{"style":216},[5581],{"type":40,"value":5045},{"type":34,"tag":199,"props":5583,"children":5584},{"style":233},[5585],{"type":40,"value":5586}," (\n",{"type":34,"tag":199,"props":5588,"children":5589},{"class":201,"line":440},[5590,5595,5600,5605,5609,5613],{"type":34,"tag":199,"props":5591,"children":5592},{"style":216},[5593],{"type":40,"value":5594},"  SELECT",{"type":34,"tag":199,"props":5596,"children":5597},{"style":233},[5598],{"type":40,"value":5599}," customer_id, ",{"type":34,"tag":199,"props":5601,"children":5602},{"style":1010},[5603],{"type":40,"value":5604},"MAX",{"type":34,"tag":199,"props":5606,"children":5607},{"style":233},[5608],{"type":40,"value":5453},{"type":34,"tag":199,"props":5610,"children":5611},{"style":216},[5612],{"type":40,"value":4725},{"type":34,"tag":199,"props":5614,"children":5615},{"style":233},[5616],{"type":40,"value":5500},{"type":34,"tag":199,"props":5618,"children":5619},{"class":201,"line":449},[5620,5625],{"type":34,"tag":199,"props":5621,"children":5622},{"style":216},[5623],{"type":40,"value":5624},"  FROM",{"type":34,"tag":199,"props":5626,"children":5627},{"style":233},[5628],{"type":40,"value":5629}," orders\n",{"type":34,"tag":199,"props":5631,"children":5632},{"class":201,"line":483},[5633,5638],{"type":34,"tag":199,"props":5634,"children":5635},{"style":216},[5636],{"type":40,"value":5637},"  GROUP BY",{"type":34,"tag":199,"props":5639,"children":5640},{"style":233},[5641],{"type":40,"value":5642}," customer_id\n",{"type":34,"tag":199,"props":5644,"children":5645},{"class":201,"line":491},[5646,5651,5655,5659,5663,5667,5671,5675,5679,5683],{"type":34,"tag":199,"props":5647,"children":5648},{"style":233},[5649],{"type":40,"value":5650},") o ",{"type":34,"tag":199,"props":5652,"children":5653},{"style":216},[5654],{"type":40,"value":5055},{"type":34,"tag":199,"props":5656,"children":5657},{"style":1010},[5658],{"type":40,"value":5060},{"type":34,"tag":199,"props":5660,"children":5661},{"style":233},[5662],{"type":40,"value":2474},{"type":34,"tag":199,"props":5664,"children":5665},{"style":1010},[5666],{"type":40,"value":1002},{"type":34,"tag":199,"props":5668,"children":5669},{"style":216},[5670],{"type":40,"value":465},{"type":34,"tag":199,"props":5672,"children":5673},{"style":1010},[5674],{"type":40,"value":5077},{"type":34,"tag":199,"props":5676,"children":5677},{"style":233},[5678],{"type":40,"value":2474},{"type":34,"tag":199,"props":5680,"children":5681},{"style":1010},[5682],{"type":40,"value":4923},{"type":34,"tag":199,"props":5684,"children":5685},{"style":233},[5686],{"type":40,"value":313},{"type":34,"tag":35,"props":5688,"children":5690},{"id":5689},"indexing-strategy",[5691],{"type":40,"value":5692},"Indexing Strategy",{"type":34,"tag":43,"props":5694,"children":5695},{},[5696],{"type":40,"value":5697},"Indexes are the single highest-leverage tool in your optimisation arsenal—but only when used intentionally.",{"type":34,"tag":176,"props":5699,"children":5701},{"id":5700},"the-index-decision-framework",[5702],{"type":40,"value":5703},"The Index Decision Framework",{"type":34,"tag":43,"props":5705,"children":5706},{},[5707],{"type":40,"value":5708},"Create an index when:",{"type":34,"tag":121,"props":5710,"children":5711},{},[5712,5738,5743,5748],{"type":34,"tag":58,"props":5713,"children":5714},{},[5715,5717,5722,5723,5729,5731,5736],{"type":40,"value":5716},"The column appears in a ",{"type":34,"tag":195,"props":5718,"children":5720},{"className":5719},[],[5721],{"type":40,"value":5094},{"type":40,"value":256},{"type":34,"tag":195,"props":5724,"children":5726},{"className":5725},[],[5727],{"type":40,"value":5728},"JOIN ON",{"type":40,"value":5730},", or ",{"type":34,"tag":195,"props":5732,"children":5734},{"className":5733},[],[5735],{"type":40,"value":4826},{"type":40,"value":5737}," clause",{"type":34,"tag":58,"props":5739,"children":5740},{},[5741],{"type":40,"value":5742},"The column has high cardinality (many distinct values)",{"type":34,"tag":58,"props":5744,"children":5745},{},[5746],{"type":40,"value":5747},"The table has more than ~10,000 rows",{"type":34,"tag":58,"props":5749,"children":5750},{},[5751],{"type":40,"value":5752},"The read/write ratio for this table favours reads",{"type":34,"tag":43,"props":5754,"children":5755},{},[5756],{"type":40,"value":5757},"Avoid indexes when:",{"type":34,"tag":54,"props":5759,"children":5760},{},[5761,5766,5779],{"type":34,"tag":58,"props":5762,"children":5763},{},[5764],{"type":40,"value":5765},"The table is write-heavy (each index slows every INSERT/UPDATE/DELETE)",{"type":34,"tag":58,"props":5767,"children":5768},{},[5769,5771,5777],{"type":40,"value":5770},"The column has very low cardinality (e.g., a boolean ",{"type":34,"tag":195,"props":5772,"children":5774},{"className":5773},[],[5775],{"type":40,"value":5776},"is_active",{"type":40,"value":5778},")",{"type":34,"tag":58,"props":5780,"children":5781},{},[5782],{"type":40,"value":5783},"The query planner already uses a more selective index",{"type":34,"tag":176,"props":5785,"children":5787},{"id":5786},"covering-indexes-eliminate-table-lookups",[5788],{"type":40,"value":5789},"Covering Indexes Eliminate Table Lookups",{"type":34,"tag":43,"props":5791,"children":5792},{},[5793],{"type":40,"value":5794},"A covering index includes all columns a query needs, so PostgreSQL never touches the main table:",{"type":34,"tag":188,"props":5796,"children":5798},{"className":4651,"code":5797,"language":4653,"meta":7,"style":7},"-- Query: find a customer's recent orders by status\nSELECT order_id, order_date, total_amount\nFROM orders\nWHERE customer_id = 12345\n  AND status = 'pending'\nORDER BY order_date DESC;\n\n-- Covering index — all queried columns live in the index\nCREATE INDEX idx_orders_customer_status_date_amount\n  ON orders (customer_id, status, order_date DESC)\n  INCLUDE (total_amount);\n",[5799],{"type":34,"tag":195,"props":5800,"children":5801},{"__ignoreMap":7},[5802,5810,5822,5833,5853,5875,5896,5903,5911,5929,5960],{"type":34,"tag":199,"props":5803,"children":5804},{"class":201,"line":202},[5805],{"type":34,"tag":199,"props":5806,"children":5807},{"style":206},[5808],{"type":40,"value":5809},"-- Query: find a customer's recent orders by status\n",{"type":34,"tag":199,"props":5811,"children":5812},{"class":201,"line":212},[5813,5817],{"type":34,"tag":199,"props":5814,"children":5815},{"style":216},[5816],{"type":40,"value":5280},{"type":34,"tag":199,"props":5818,"children":5819},{"style":233},[5820],{"type":40,"value":5821}," order_id, order_date, total_amount\n",{"type":34,"tag":199,"props":5823,"children":5824},{"class":201,"line":278},[5825,5829],{"type":34,"tag":199,"props":5826,"children":5827},{"style":216},[5828],{"type":40,"value":4813},{"type":34,"tag":199,"props":5830,"children":5831},{"style":233},[5832],{"type":40,"value":5629},{"type":34,"tag":199,"props":5834,"children":5835},{"class":201,"line":287},[5836,5840,5844,5848],{"type":34,"tag":199,"props":5837,"children":5838},{"style":216},[5839],{"type":40,"value":5094},{"type":34,"tag":199,"props":5841,"children":5842},{"style":233},[5843],{"type":40,"value":5471},{"type":34,"tag":199,"props":5845,"children":5846},{"style":216},[5847],{"type":40,"value":5309},{"type":34,"tag":199,"props":5849,"children":5850},{"style":1010},[5851],{"type":40,"value":5852}," 12345\n",{"type":34,"tag":199,"props":5854,"children":5855},{"class":201,"line":316},[5856,5861,5866,5870],{"type":34,"tag":199,"props":5857,"children":5858},{"style":216},[5859],{"type":40,"value":5860},"  AND",{"type":34,"tag":199,"props":5862,"children":5863},{"style":216},[5864],{"type":40,"value":5865}," status",{"type":34,"tag":199,"props":5867,"children":5868},{"style":216},[5869],{"type":40,"value":465},{"type":34,"tag":199,"props":5871,"children":5872},{"style":883},[5873],{"type":40,"value":5874}," 'pending'\n",{"type":34,"tag":199,"props":5876,"children":5877},{"class":201,"line":342},[5878,5882,5887,5892],{"type":34,"tag":199,"props":5879,"children":5880},{"style":216},[5881],{"type":40,"value":4826},{"type":34,"tag":199,"props":5883,"children":5884},{"style":233},[5885],{"type":40,"value":5886}," order_date ",{"type":34,"tag":199,"props":5888,"children":5889},{"style":216},[5890],{"type":40,"value":5891},"DESC",{"type":34,"tag":199,"props":5893,"children":5894},{"style":233},[5895],{"type":40,"value":313},{"type":34,"tag":199,"props":5897,"children":5898},{"class":201,"line":352},[5899],{"type":34,"tag":199,"props":5900,"children":5901},{"emptyLinePlaceholder":346},[5902],{"type":40,"value":349},{"type":34,"tag":199,"props":5904,"children":5905},{"class":201,"line":402},[5906],{"type":34,"tag":199,"props":5907,"children":5908},{"style":206},[5909],{"type":40,"value":5910},"-- Covering index — all queried columns live in the index\n",{"type":34,"tag":199,"props":5912,"children":5913},{"class":201,"line":421},[5914,5919,5924],{"type":34,"tag":199,"props":5915,"children":5916},{"style":216},[5917],{"type":40,"value":5918},"CREATE",{"type":34,"tag":199,"props":5920,"children":5921},{"style":216},[5922],{"type":40,"value":5923}," INDEX",{"type":34,"tag":199,"props":5925,"children":5926},{"style":227},[5927],{"type":40,"value":5928}," idx_orders_customer_status_date_amount\n",{"type":34,"tag":199,"props":5930,"children":5931},{"class":201,"line":440},[5932,5937,5942,5947,5952,5956],{"type":34,"tag":199,"props":5933,"children":5934},{"style":216},[5935],{"type":40,"value":5936},"  ON",{"type":34,"tag":199,"props":5938,"children":5939},{"style":233},[5940],{"type":40,"value":5941}," orders (customer_id, ",{"type":34,"tag":199,"props":5943,"children":5944},{"style":216},[5945],{"type":40,"value":5946},"status",{"type":34,"tag":199,"props":5948,"children":5949},{"style":233},[5950],{"type":40,"value":5951},", order_date ",{"type":34,"tag":199,"props":5953,"children":5954},{"style":216},[5955],{"type":40,"value":5891},{"type":34,"tag":199,"props":5957,"children":5958},{"style":233},[5959],{"type":40,"value":437},{"type":34,"tag":199,"props":5961,"children":5962},{"class":201,"line":449},[5963,5968],{"type":34,"tag":199,"props":5964,"children":5965},{"style":216},[5966],{"type":40,"value":5967},"  INCLUDE",{"type":34,"tag":199,"props":5969,"children":5970},{"style":233},[5971],{"type":40,"value":5972}," (total_amount);\n",{"type":34,"tag":43,"props":5974,"children":5975},{},[5976,5978,5984,5986,5991],{"type":40,"value":5977},"The ",{"type":34,"tag":195,"props":5979,"children":5981},{"className":5980},[],[5982],{"type":40,"value":5983},"INCLUDE",{"type":40,"value":5985}," clause (PostgreSQL 11+) adds ",{"type":34,"tag":195,"props":5987,"children":5989},{"className":5988},[],[5990],{"type":40,"value":5011},{"type":40,"value":5992}," to leaf pages without affecting sort order, making this a true zero-heap-access query.",{"type":34,"tag":176,"props":5994,"children":5996},{"id":5995},"partial-indexes-for-selective-conditions",[5997],{"type":40,"value":5998},"Partial Indexes for Selective Conditions",{"type":34,"tag":43,"props":6000,"children":6001},{},[6002],{"type":40,"value":6003},"When you only ever query a subset of rows, index only that subset:",{"type":34,"tag":188,"props":6005,"children":6007},{"className":4651,"code":6006,"language":4653,"meta":7,"style":7},"-- Only active, unfulfilled orders matter for the operations dashboard\nCREATE INDEX idx_orders_unfulfilled\n  ON orders (customer_id, created_at)\n  WHERE status IN ('pending', 'processing');\n",[6008],{"type":34,"tag":195,"props":6009,"children":6010},{"__ignoreMap":7},[6011,6019,6035,6047],{"type":34,"tag":199,"props":6012,"children":6013},{"class":201,"line":202},[6014],{"type":34,"tag":199,"props":6015,"children":6016},{"style":206},[6017],{"type":40,"value":6018},"-- Only active, unfulfilled orders matter for the operations dashboard\n",{"type":34,"tag":199,"props":6020,"children":6021},{"class":201,"line":212},[6022,6026,6030],{"type":34,"tag":199,"props":6023,"children":6024},{"style":216},[6025],{"type":40,"value":5918},{"type":34,"tag":199,"props":6027,"children":6028},{"style":216},[6029],{"type":40,"value":5923},{"type":34,"tag":199,"props":6031,"children":6032},{"style":227},[6033],{"type":40,"value":6034}," idx_orders_unfulfilled\n",{"type":34,"tag":199,"props":6036,"children":6037},{"class":201,"line":278},[6038,6042],{"type":34,"tag":199,"props":6039,"children":6040},{"style":216},[6041],{"type":40,"value":5936},{"type":34,"tag":199,"props":6043,"children":6044},{"style":233},[6045],{"type":40,"value":6046}," orders (customer_id, created_at)\n",{"type":34,"tag":199,"props":6048,"children":6049},{"class":201,"line":287},[6050,6055,6059,6064,6068,6073,6077,6082],{"type":34,"tag":199,"props":6051,"children":6052},{"style":216},[6053],{"type":40,"value":6054},"  WHERE",{"type":34,"tag":199,"props":6056,"children":6057},{"style":216},[6058],{"type":40,"value":5865},{"type":34,"tag":199,"props":6060,"children":6061},{"style":216},[6062],{"type":40,"value":6063}," IN",{"type":34,"tag":199,"props":6065,"children":6066},{"style":233},[6067],{"type":40,"value":996},{"type":34,"tag":199,"props":6069,"children":6070},{"style":883},[6071],{"type":40,"value":6072},"'pending'",{"type":34,"tag":199,"props":6074,"children":6075},{"style":233},[6076],{"type":40,"value":256},{"type":34,"tag":199,"props":6078,"children":6079},{"style":883},[6080],{"type":40,"value":6081},"'processing'",{"type":34,"tag":199,"props":6083,"children":6084},{"style":233},[6085],{"type":40,"value":6086},");\n",{"type":34,"tag":43,"props":6088,"children":6089},{},[6090],{"type":40,"value":6091},"This index is a fraction of the size of a full index on those columns, making it faster to build, cheaper to maintain, and more likely to stay in memory.",{"type":34,"tag":176,"props":6093,"children":6095},{"id":6094},"prune-dead-indexes",[6096],{"type":40,"value":6097},"Prune Dead Indexes",{"type":34,"tag":43,"props":6099,"children":6100},{},[6101],{"type":40,"value":6102},"Unused indexes are pure cost: they consume disk, slow writes, and confuse the planner. Find them:",{"type":34,"tag":188,"props":6104,"children":6106},{"className":4651,"code":6105,"language":4653,"meta":7,"style":7},"SELECT\n  schemaname,\n  tablename,\n  indexname,\n  idx_scan AS scans_since_restart\nFROM pg_stat_user_indexes\nWHERE idx_scan = 0\n  AND indexrelname NOT LIKE '%_pkey'\nORDER BY schemaname, tablename;\n",[6107],{"type":34,"tag":195,"props":6108,"children":6109},{"__ignoreMap":7},[6110,6117,6125,6133,6141,6158,6170,6191,6218],{"type":34,"tag":199,"props":6111,"children":6112},{"class":201,"line":202},[6113],{"type":34,"tag":199,"props":6114,"children":6115},{"style":216},[6116],{"type":40,"value":4673},{"type":34,"tag":199,"props":6118,"children":6119},{"class":201,"line":212},[6120],{"type":34,"tag":199,"props":6121,"children":6122},{"style":233},[6123],{"type":40,"value":6124},"  schemaname,\n",{"type":34,"tag":199,"props":6126,"children":6127},{"class":201,"line":278},[6128],{"type":34,"tag":199,"props":6129,"children":6130},{"style":233},[6131],{"type":40,"value":6132},"  tablename,\n",{"type":34,"tag":199,"props":6134,"children":6135},{"class":201,"line":287},[6136],{"type":34,"tag":199,"props":6137,"children":6138},{"style":233},[6139],{"type":40,"value":6140},"  indexname,\n",{"type":34,"tag":199,"props":6142,"children":6143},{"class":201,"line":316},[6144,6149,6153],{"type":34,"tag":199,"props":6145,"children":6146},{"style":233},[6147],{"type":40,"value":6148},"  idx_scan ",{"type":34,"tag":199,"props":6150,"children":6151},{"style":216},[6152],{"type":40,"value":4725},{"type":34,"tag":199,"props":6154,"children":6155},{"style":233},[6156],{"type":40,"value":6157}," scans_since_restart\n",{"type":34,"tag":199,"props":6159,"children":6160},{"class":201,"line":342},[6161,6165],{"type":34,"tag":199,"props":6162,"children":6163},{"style":216},[6164],{"type":40,"value":4813},{"type":34,"tag":199,"props":6166,"children":6167},{"style":233},[6168],{"type":40,"value":6169}," pg_stat_user_indexes\n",{"type":34,"tag":199,"props":6171,"children":6172},{"class":201,"line":352},[6173,6177,6182,6186],{"type":34,"tag":199,"props":6174,"children":6175},{"style":216},[6176],{"type":40,"value":5094},{"type":34,"tag":199,"props":6178,"children":6179},{"style":233},[6180],{"type":40,"value":6181}," idx_scan ",{"type":34,"tag":199,"props":6183,"children":6184},{"style":216},[6185],{"type":40,"value":5309},{"type":34,"tag":199,"props":6187,"children":6188},{"style":1010},[6189],{"type":40,"value":6190}," 0\n",{"type":34,"tag":199,"props":6192,"children":6193},{"class":201,"line":402},[6194,6198,6203,6208,6213],{"type":34,"tag":199,"props":6195,"children":6196},{"style":216},[6197],{"type":40,"value":5860},{"type":34,"tag":199,"props":6199,"children":6200},{"style":233},[6201],{"type":40,"value":6202}," indexrelname ",{"type":34,"tag":199,"props":6204,"children":6205},{"style":216},[6206],{"type":40,"value":6207},"NOT",{"type":34,"tag":199,"props":6209,"children":6210},{"style":216},[6211],{"type":40,"value":6212}," LIKE",{"type":34,"tag":199,"props":6214,"children":6215},{"style":883},[6216],{"type":40,"value":6217}," '%_pkey'\n",{"type":34,"tag":199,"props":6219,"children":6220},{"class":201,"line":421},[6221,6225],{"type":34,"tag":199,"props":6222,"children":6223},{"style":216},[6224],{"type":40,"value":4826},{"type":34,"tag":199,"props":6226,"children":6227},{"style":233},[6228],{"type":40,"value":6229}," schemaname, tablename;\n",{"type":34,"tag":43,"props":6231,"children":6232},{},[6233],{"type":40,"value":6234},"Drop any index that shows zero scans and wasn't created in the last 24 hours.",{"type":34,"tag":35,"props":6236,"children":6238},{"id":6237},"caching-the-force-multiplier",[6239],{"type":40,"value":6240},"Caching: The Force Multiplier",{"type":34,"tag":43,"props":6242,"children":6243},{},[6244],{"type":40,"value":6245},"Once queries are fast, caching keeps frequently-read data out of the database entirely.",{"type":34,"tag":176,"props":6247,"children":6249},{"id":6248},"application-level-caching-with-redis",[6250],{"type":40,"value":6251},"Application-Level Caching with Redis",{"type":34,"tag":188,"props":6253,"children":6255},{"className":190,"code":6254,"language":192,"meta":7,"style":7},"public async Task\u003CProduct> GetProductAsync(int id)\n{\n    var cacheKey = $\"product:{id}\";\n\n    var cached = await _cache.GetStringAsync(cacheKey);\n    if (cached is not null)\n        return JsonSerializer.Deserialize\u003CProduct>(cached)!;\n\n    var product = await _db.Products\n        .AsNoTracking()\n        .Include(p => p.Category)\n        .FirstOrDefaultAsync(p => p.Id == id);\n\n    if (product is not null)\n    {\n        await _cache.SetStringAsync(\n            cacheKey,\n            JsonSerializer.Serialize(product),\n            new DistributedCacheEntryOptions\n            {\n                AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(15)\n            });\n    }\n\n    return product!;\n}\n",[6256],{"type":34,"tag":195,"props":6257,"children":6258},{"__ignoreMap":7},[6259,6308,6315,6350,6357,6392,6424,6463,6470,6495,6513,6543,6582,6589,6617,6624,6644,6652,6670,6682,6690,6725,6733,6740,6747,6767],{"type":34,"tag":199,"props":6260,"children":6261},{"class":201,"line":202},[6262,6266,6270,6274,6278,6282,6286,6291,6295,6299,6304],{"type":34,"tag":199,"props":6263,"children":6264},{"style":216},[6265],{"type":40,"value":219},{"type":34,"tag":199,"props":6267,"children":6268},{"style":216},[6269],{"type":40,"value":363},{"type":34,"tag":199,"props":6271,"children":6272},{"style":227},[6273],{"type":40,"value":368},{"type":34,"tag":199,"props":6275,"children":6276},{"style":233},[6277],{"type":40,"value":246},{"type":34,"tag":199,"props":6279,"children":6280},{"style":227},[6281],{"type":40,"value":1092},{"type":34,"tag":199,"props":6283,"children":6284},{"style":233},[6285],{"type":40,"value":789},{"type":34,"tag":199,"props":6287,"children":6288},{"style":227},[6289],{"type":40,"value":6290},"GetProductAsync",{"type":34,"tag":199,"props":6292,"children":6293},{"style":233},[6294],{"type":40,"value":589},{"type":34,"tag":199,"props":6296,"children":6297},{"style":216},[6298],{"type":40,"value":270},{"type":34,"tag":199,"props":6300,"children":6301},{"style":227},[6302],{"type":40,"value":6303}," id",{"type":34,"tag":199,"props":6305,"children":6306},{"style":233},[6307],{"type":40,"value":437},{"type":34,"tag":199,"props":6309,"children":6310},{"class":201,"line":212},[6311],{"type":34,"tag":199,"props":6312,"children":6313},{"style":233},[6314],{"type":40,"value":284},{"type":34,"tag":199,"props":6316,"children":6317},{"class":201,"line":278},[6318,6323,6328,6332,6337,6341,6346],{"type":34,"tag":199,"props":6319,"children":6320},{"style":216},[6321],{"type":40,"value":6322},"    var",{"type":34,"tag":199,"props":6324,"children":6325},{"style":227},[6326],{"type":40,"value":6327}," cacheKey",{"type":34,"tag":199,"props":6329,"children":6330},{"style":216},[6331],{"type":40,"value":465},{"type":34,"tag":199,"props":6333,"children":6334},{"style":883},[6335],{"type":40,"value":6336}," $\"product:{",{"type":34,"tag":199,"props":6338,"children":6339},{"style":233},[6340],{"type":40,"value":1002},{"type":34,"tag":199,"props":6342,"children":6343},{"style":883},[6344],{"type":40,"value":6345},"}\"",{"type":34,"tag":199,"props":6347,"children":6348},{"style":233},[6349],{"type":40,"value":313},{"type":34,"tag":199,"props":6351,"children":6352},{"class":201,"line":287},[6353],{"type":34,"tag":199,"props":6354,"children":6355},{"emptyLinePlaceholder":346},[6356],{"type":40,"value":349},{"type":34,"tag":199,"props":6358,"children":6359},{"class":201,"line":316},[6360,6364,6369,6373,6377,6382,6387],{"type":34,"tag":199,"props":6361,"children":6362},{"style":216},[6363],{"type":40,"value":6322},{"type":34,"tag":199,"props":6365,"children":6366},{"style":227},[6367],{"type":40,"value":6368}," cached",{"type":34,"tag":199,"props":6370,"children":6371},{"style":216},[6372],{"type":40,"value":465},{"type":34,"tag":199,"props":6374,"children":6375},{"style":216},[6376],{"type":40,"value":853},{"type":34,"tag":199,"props":6378,"children":6379},{"style":233},[6380],{"type":40,"value":6381}," _cache.",{"type":34,"tag":199,"props":6383,"children":6384},{"style":227},[6385],{"type":40,"value":6386},"GetStringAsync",{"type":34,"tag":199,"props":6388,"children":6389},{"style":233},[6390],{"type":40,"value":6391},"(cacheKey);\n",{"type":34,"tag":199,"props":6393,"children":6394},{"class":201,"line":342},[6395,6400,6405,6410,6415,6420],{"type":34,"tag":199,"props":6396,"children":6397},{"style":216},[6398],{"type":40,"value":6399},"    if",{"type":34,"tag":199,"props":6401,"children":6402},{"style":233},[6403],{"type":40,"value":6404}," (cached ",{"type":34,"tag":199,"props":6406,"children":6407},{"style":216},[6408],{"type":40,"value":6409},"is",{"type":34,"tag":199,"props":6411,"children":6412},{"style":216},[6413],{"type":40,"value":6414}," not",{"type":34,"tag":199,"props":6416,"children":6417},{"style":1010},[6418],{"type":40,"value":6419}," null",{"type":34,"tag":199,"props":6421,"children":6422},{"style":233},[6423],{"type":40,"value":437},{"type":34,"tag":199,"props":6425,"children":6426},{"class":201,"line":352},[6427,6431,6436,6441,6445,6449,6454,6459],{"type":34,"tag":199,"props":6428,"children":6429},{"style":216},[6430],{"type":40,"value":621},{"type":34,"tag":199,"props":6432,"children":6433},{"style":233},[6434],{"type":40,"value":6435}," JsonSerializer.",{"type":34,"tag":199,"props":6437,"children":6438},{"style":227},[6439],{"type":40,"value":6440},"Deserialize",{"type":34,"tag":199,"props":6442,"children":6443},{"style":233},[6444],{"type":40,"value":246},{"type":34,"tag":199,"props":6446,"children":6447},{"style":227},[6448],{"type":40,"value":1092},{"type":34,"tag":199,"props":6450,"children":6451},{"style":233},[6452],{"type":40,"value":6453},">(cached)",{"type":34,"tag":199,"props":6455,"children":6456},{"style":216},[6457],{"type":40,"value":6458},"!",{"type":34,"tag":199,"props":6460,"children":6461},{"style":233},[6462],{"type":40,"value":313},{"type":34,"tag":199,"props":6464,"children":6465},{"class":201,"line":402},[6466],{"type":34,"tag":199,"props":6467,"children":6468},{"emptyLinePlaceholder":346},[6469],{"type":40,"value":349},{"type":34,"tag":199,"props":6471,"children":6472},{"class":201,"line":421},[6473,6477,6482,6486,6490],{"type":34,"tag":199,"props":6474,"children":6475},{"style":216},[6476],{"type":40,"value":6322},{"type":34,"tag":199,"props":6478,"children":6479},{"style":227},[6480],{"type":40,"value":6481}," product",{"type":34,"tag":199,"props":6483,"children":6484},{"style":216},[6485],{"type":40,"value":465},{"type":34,"tag":199,"props":6487,"children":6488},{"style":216},[6489],{"type":40,"value":853},{"type":34,"tag":199,"props":6491,"children":6492},{"style":233},[6493],{"type":40,"value":6494}," _db.Products\n",{"type":34,"tag":199,"props":6496,"children":6497},{"class":201,"line":440},[6498,6503,6508],{"type":34,"tag":199,"props":6499,"children":6500},{"style":233},[6501],{"type":40,"value":6502},"        .",{"type":34,"tag":199,"props":6504,"children":6505},{"style":227},[6506],{"type":40,"value":6507},"AsNoTracking",{"type":34,"tag":199,"props":6509,"children":6510},{"style":233},[6511],{"type":40,"value":6512},"()\n",{"type":34,"tag":199,"props":6514,"children":6515},{"class":201,"line":449},[6516,6520,6525,6529,6533,6538],{"type":34,"tag":199,"props":6517,"children":6518},{"style":233},[6519],{"type":40,"value":6502},{"type":34,"tag":199,"props":6521,"children":6522},{"style":227},[6523],{"type":40,"value":6524},"Include",{"type":34,"tag":199,"props":6526,"children":6527},{"style":233},[6528],{"type":40,"value":589},{"type":34,"tag":199,"props":6530,"children":6531},{"style":227},[6532],{"type":40,"value":43},{"type":34,"tag":199,"props":6534,"children":6535},{"style":216},[6536],{"type":40,"value":6537}," =>",{"type":34,"tag":199,"props":6539,"children":6540},{"style":233},[6541],{"type":40,"value":6542}," p.Category)\n",{"type":34,"tag":199,"props":6544,"children":6545},{"class":201,"line":483},[6546,6550,6555,6559,6563,6567,6572,6577],{"type":34,"tag":199,"props":6547,"children":6548},{"style":233},[6549],{"type":40,"value":6502},{"type":34,"tag":199,"props":6551,"children":6552},{"style":227},[6553],{"type":40,"value":6554},"FirstOrDefaultAsync",{"type":34,"tag":199,"props":6556,"children":6557},{"style":233},[6558],{"type":40,"value":589},{"type":34,"tag":199,"props":6560,"children":6561},{"style":227},[6562],{"type":40,"value":43},{"type":34,"tag":199,"props":6564,"children":6565},{"style":216},[6566],{"type":40,"value":6537},{"type":34,"tag":199,"props":6568,"children":6569},{"style":233},[6570],{"type":40,"value":6571}," p.Id ",{"type":34,"tag":199,"props":6573,"children":6574},{"style":216},[6575],{"type":40,"value":6576},"==",{"type":34,"tag":199,"props":6578,"children":6579},{"style":233},[6580],{"type":40,"value":6581}," id);\n",{"type":34,"tag":199,"props":6583,"children":6584},{"class":201,"line":491},[6585],{"type":34,"tag":199,"props":6586,"children":6587},{"emptyLinePlaceholder":346},[6588],{"type":40,"value":349},{"type":34,"tag":199,"props":6590,"children":6591},{"class":201,"line":505},[6592,6596,6601,6605,6609,6613],{"type":34,"tag":199,"props":6593,"children":6594},{"style":216},[6595],{"type":40,"value":6399},{"type":34,"tag":199,"props":6597,"children":6598},{"style":233},[6599],{"type":40,"value":6600}," (product ",{"type":34,"tag":199,"props":6602,"children":6603},{"style":216},[6604],{"type":40,"value":6409},{"type":34,"tag":199,"props":6606,"children":6607},{"style":216},[6608],{"type":40,"value":6414},{"type":34,"tag":199,"props":6610,"children":6611},{"style":1010},[6612],{"type":40,"value":6419},{"type":34,"tag":199,"props":6614,"children":6615},{"style":233},[6616],{"type":40,"value":437},{"type":34,"tag":199,"props":6618,"children":6619},{"class":201,"line":537},[6620],{"type":34,"tag":199,"props":6621,"children":6622},{"style":233},[6623],{"type":40,"value":446},{"type":34,"tag":199,"props":6625,"children":6626},{"class":201,"line":545},[6627,6631,6635,6640],{"type":34,"tag":199,"props":6628,"children":6629},{"style":216},[6630],{"type":40,"value":551},{"type":34,"tag":199,"props":6632,"children":6633},{"style":233},[6634],{"type":40,"value":6381},{"type":34,"tag":199,"props":6636,"children":6637},{"style":227},[6638],{"type":40,"value":6639},"SetStringAsync",{"type":34,"tag":199,"props":6641,"children":6642},{"style":233},[6643],{"type":40,"value":399},{"type":34,"tag":199,"props":6645,"children":6646},{"class":201,"line":569},[6647],{"type":34,"tag":199,"props":6648,"children":6649},{"style":233},[6650],{"type":40,"value":6651},"            cacheKey,\n",{"type":34,"tag":199,"props":6653,"children":6654},{"class":201,"line":607},[6655,6660,6665],{"type":34,"tag":199,"props":6656,"children":6657},{"style":233},[6658],{"type":40,"value":6659},"            JsonSerializer.",{"type":34,"tag":199,"props":6661,"children":6662},{"style":227},[6663],{"type":40,"value":6664},"Serialize",{"type":34,"tag":199,"props":6666,"children":6667},{"style":233},[6668],{"type":40,"value":6669},"(product),\n",{"type":34,"tag":199,"props":6671,"children":6672},{"class":201,"line":615},[6673,6677],{"type":34,"tag":199,"props":6674,"children":6675},{"style":216},[6676],{"type":40,"value":899},{"type":34,"tag":199,"props":6678,"children":6679},{"style":227},[6680],{"type":40,"value":6681}," DistributedCacheEntryOptions\n",{"type":34,"tag":199,"props":6683,"children":6684},{"class":201,"line":638},[6685],{"type":34,"tag":199,"props":6686,"children":6687},{"style":233},[6688],{"type":40,"value":6689},"            {\n",{"type":34,"tag":199,"props":6691,"children":6692},{"class":201,"line":647},[6693,6698,6702,6707,6712,6716,6721],{"type":34,"tag":199,"props":6694,"children":6695},{"style":233},[6696],{"type":40,"value":6697},"                AbsoluteExpirationRelativeToNow ",{"type":34,"tag":199,"props":6699,"children":6700},{"style":216},[6701],{"type":40,"value":5309},{"type":34,"tag":199,"props":6703,"children":6704},{"style":233},[6705],{"type":40,"value":6706}," TimeSpan.",{"type":34,"tag":199,"props":6708,"children":6709},{"style":227},[6710],{"type":40,"value":6711},"FromMinutes",{"type":34,"tag":199,"props":6713,"children":6714},{"style":233},[6715],{"type":40,"value":589},{"type":34,"tag":199,"props":6717,"children":6718},{"style":1010},[6719],{"type":40,"value":6720},"15",{"type":34,"tag":199,"props":6722,"children":6723},{"style":233},[6724],{"type":40,"value":437},{"type":34,"tag":199,"props":6726,"children":6727},{"class":201,"line":656},[6728],{"type":34,"tag":199,"props":6729,"children":6730},{"style":233},[6731],{"type":40,"value":6732},"            });\n",{"type":34,"tag":199,"props":6734,"children":6735},{"class":201,"line":664},[6736],{"type":34,"tag":199,"props":6737,"children":6738},{"style":233},[6739],{"type":40,"value":644},{"type":34,"tag":199,"props":6741,"children":6742},{"class":201,"line":673},[6743],{"type":34,"tag":199,"props":6744,"children":6745},{"emptyLinePlaceholder":346},[6746],{"type":40,"value":349},{"type":34,"tag":199,"props":6748,"children":6749},{"class":201,"line":721},[6750,6755,6759,6763],{"type":34,"tag":199,"props":6751,"children":6752},{"style":216},[6753],{"type":40,"value":6754},"    return",{"type":34,"tag":199,"props":6756,"children":6757},{"style":233},[6758],{"type":40,"value":6481},{"type":34,"tag":199,"props":6760,"children":6761},{"style":216},[6762],{"type":40,"value":6458},{"type":34,"tag":199,"props":6764,"children":6765},{"style":233},[6766],{"type":40,"value":313},{"type":34,"tag":199,"props":6768,"children":6769},{"class":201,"line":729},[6770],{"type":34,"tag":199,"props":6771,"children":6772},{"style":233},[6773],{"type":40,"value":653},{"type":34,"tag":43,"props":6775,"children":6776},{},[6777],{"type":40,"value":6778},"Cache TTL is the hardest decision. Our rule of thumb: start at half the expected staleness tolerance, then tune based on cache-hit ratio monitoring.",{"type":34,"tag":176,"props":6780,"children":6782},{"id":6781},"materialised-views-for-analytics",[6783],{"type":40,"value":6784},"Materialised Views for Analytics",{"type":34,"tag":43,"props":6786,"children":6787},{},[6788],{"type":40,"value":6789},"Complex analytical queries over large tables should never run live against OLTP data. Materialise the result:",{"type":34,"tag":188,"props":6791,"children":6793},{"className":4651,"code":6792,"language":4653,"meta":7,"style":7},"CREATE MATERIALIZED VIEW mv_monthly_revenue AS\nSELECT\n    DATE_TRUNC('month', order_date)  AS month,\n    product_category,\n    SUM(amount)                       AS revenue,\n    COUNT(*)                          AS orders\nFROM orders o\nJOIN products p ON o.product_id = p.id\nGROUP BY 1, 2;\n\nCREATE INDEX ON mv_monthly_revenue (month);\n\n-- Refresh nightly (or on-demand after large data loads)\nREFRESH MATERIALIZED VIEW CONCURRENTLY mv_monthly_revenue;\n",[6794],{"type":34,"tag":195,"props":6795,"children":6796},{"__ignoreMap":7},[6797,6814,6821,6852,6860,6881,6910,6922,6970,6994,7001,7031,7038,7046],{"type":34,"tag":199,"props":6798,"children":6799},{"class":201,"line":202},[6800,6804,6809],{"type":34,"tag":199,"props":6801,"children":6802},{"style":216},[6803],{"type":40,"value":5918},{"type":34,"tag":199,"props":6805,"children":6806},{"style":233},[6807],{"type":40,"value":6808}," MATERIALIZED VIEW mv_monthly_revenue ",{"type":34,"tag":199,"props":6810,"children":6811},{"style":216},[6812],{"type":40,"value":6813},"AS\n",{"type":34,"tag":199,"props":6815,"children":6816},{"class":201,"line":212},[6817],{"type":34,"tag":199,"props":6818,"children":6819},{"style":216},[6820],{"type":40,"value":4673},{"type":34,"tag":199,"props":6822,"children":6823},{"class":201,"line":278},[6824,6829,6834,6839,6843,6848],{"type":34,"tag":199,"props":6825,"children":6826},{"style":233},[6827],{"type":40,"value":6828},"    DATE_TRUNC(",{"type":34,"tag":199,"props":6830,"children":6831},{"style":883},[6832],{"type":40,"value":6833},"'month'",{"type":34,"tag":199,"props":6835,"children":6836},{"style":233},[6837],{"type":40,"value":6838},", order_date)  ",{"type":34,"tag":199,"props":6840,"children":6841},{"style":216},[6842],{"type":40,"value":4725},{"type":34,"tag":199,"props":6844,"children":6845},{"style":216},[6846],{"type":40,"value":6847}," month",{"type":34,"tag":199,"props":6849,"children":6850},{"style":233},[6851],{"type":40,"value":418},{"type":34,"tag":199,"props":6853,"children":6854},{"class":201,"line":287},[6855],{"type":34,"tag":199,"props":6856,"children":6857},{"style":233},[6858],{"type":40,"value":6859},"    product_category,\n",{"type":34,"tag":199,"props":6861,"children":6862},{"class":201,"line":316},[6863,6867,6872,6876],{"type":34,"tag":199,"props":6864,"children":6865},{"style":1010},[6866],{"type":40,"value":4994},{"type":34,"tag":199,"props":6868,"children":6869},{"style":233},[6870],{"type":40,"value":6871},"(amount)                       ",{"type":34,"tag":199,"props":6873,"children":6874},{"style":216},[6875],{"type":40,"value":4725},{"type":34,"tag":199,"props":6877,"children":6878},{"style":233},[6879],{"type":40,"value":6880}," revenue,\n",{"type":34,"tag":199,"props":6882,"children":6883},{"class":201,"line":342},[6884,6888,6892,6897,6902,6906],{"type":34,"tag":199,"props":6885,"children":6886},{"style":1010},[6887],{"type":40,"value":4954},{"type":34,"tag":199,"props":6889,"children":6890},{"style":233},[6891],{"type":40,"value":589},{"type":34,"tag":199,"props":6893,"children":6894},{"style":216},[6895],{"type":40,"value":6896},"*",{"type":34,"tag":199,"props":6898,"children":6899},{"style":233},[6900],{"type":40,"value":6901},")                          ",{"type":34,"tag":199,"props":6903,"children":6904},{"style":216},[6905],{"type":40,"value":4725},{"type":34,"tag":199,"props":6907,"children":6908},{"style":233},[6909],{"type":40,"value":5629},{"type":34,"tag":199,"props":6911,"children":6912},{"class":201,"line":352},[6913,6917],{"type":34,"tag":199,"props":6914,"children":6915},{"style":216},[6916],{"type":40,"value":4813},{"type":34,"tag":199,"props":6918,"children":6919},{"style":233},[6920],{"type":40,"value":6921}," orders o\n",{"type":34,"tag":199,"props":6923,"children":6924},{"class":201,"line":402},[6925,6930,6935,6939,6943,6947,6952,6956,6961,6965],{"type":34,"tag":199,"props":6926,"children":6927},{"style":216},[6928],{"type":40,"value":6929},"JOIN",{"type":34,"tag":199,"props":6931,"children":6932},{"style":233},[6933],{"type":40,"value":6934}," products p ",{"type":34,"tag":199,"props":6936,"children":6937},{"style":216},[6938],{"type":40,"value":5055},{"type":34,"tag":199,"props":6940,"children":6941},{"style":1010},[6942],{"type":40,"value":5077},{"type":34,"tag":199,"props":6944,"children":6945},{"style":233},[6946],{"type":40,"value":2474},{"type":34,"tag":199,"props":6948,"children":6949},{"style":1010},[6950],{"type":40,"value":6951},"product_id",{"type":34,"tag":199,"props":6953,"children":6954},{"style":216},[6955],{"type":40,"value":465},{"type":34,"tag":199,"props":6957,"children":6958},{"style":1010},[6959],{"type":40,"value":6960}," p",{"type":34,"tag":199,"props":6962,"children":6963},{"style":233},[6964],{"type":40,"value":2474},{"type":34,"tag":199,"props":6966,"children":6967},{"style":1010},[6968],{"type":40,"value":6969},"id\n",{"type":34,"tag":199,"props":6971,"children":6972},{"class":201,"line":421},[6973,6977,6982,6986,6990],{"type":34,"tag":199,"props":6974,"children":6975},{"style":216},[6976],{"type":40,"value":5125},{"type":34,"tag":199,"props":6978,"children":6979},{"style":1010},[6980],{"type":40,"value":6981}," 1",{"type":34,"tag":199,"props":6983,"children":6984},{"style":233},[6985],{"type":40,"value":256},{"type":34,"tag":199,"props":6987,"children":6988},{"style":1010},[6989],{"type":40,"value":4716},{"type":34,"tag":199,"props":6991,"children":6992},{"style":233},[6993],{"type":40,"value":313},{"type":34,"tag":199,"props":6995,"children":6996},{"class":201,"line":440},[6997],{"type":34,"tag":199,"props":6998,"children":6999},{"emptyLinePlaceholder":346},[7000],{"type":40,"value":349},{"type":34,"tag":199,"props":7002,"children":7003},{"class":201,"line":449},[7004,7008,7012,7017,7022,7027],{"type":34,"tag":199,"props":7005,"children":7006},{"style":216},[7007],{"type":40,"value":5918},{"type":34,"tag":199,"props":7009,"children":7010},{"style":216},[7011],{"type":40,"value":5923},{"type":34,"tag":199,"props":7013,"children":7014},{"style":227},[7015],{"type":40,"value":7016}," ON",{"type":34,"tag":199,"props":7018,"children":7019},{"style":233},[7020],{"type":40,"value":7021}," mv_monthly_revenue (",{"type":34,"tag":199,"props":7023,"children":7024},{"style":216},[7025],{"type":40,"value":7026},"month",{"type":34,"tag":199,"props":7028,"children":7029},{"style":233},[7030],{"type":40,"value":6086},{"type":34,"tag":199,"props":7032,"children":7033},{"class":201,"line":483},[7034],{"type":34,"tag":199,"props":7035,"children":7036},{"emptyLinePlaceholder":346},[7037],{"type":40,"value":349},{"type":34,"tag":199,"props":7039,"children":7040},{"class":201,"line":491},[7041],{"type":34,"tag":199,"props":7042,"children":7043},{"style":206},[7044],{"type":40,"value":7045},"-- Refresh nightly (or on-demand after large data loads)\n",{"type":34,"tag":199,"props":7047,"children":7048},{"class":201,"line":505},[7049],{"type":34,"tag":199,"props":7050,"children":7051},{"style":233},[7052],{"type":40,"value":7053},"REFRESH MATERIALIZED VIEW CONCURRENTLY mv_monthly_revenue;\n",{"type":34,"tag":43,"props":7055,"children":7056},{},[7057,7063],{"type":34,"tag":195,"props":7058,"children":7060},{"className":7059},[],[7061],{"type":40,"value":7062},"CONCURRENTLY",{"type":40,"value":7064}," lets reads continue during the refresh — zero downtime.",{"type":34,"tag":35,"props":7066,"children":7068},{"id":7067},"real-world-results-e-commerce-platform-optimisation",[7069],{"type":40,"value":7070},"Real-World Results: E-Commerce Platform Optimisation",{"type":34,"tag":43,"props":7072,"children":7073},{},[7074],{"type":40,"value":7075},"An e-commerce client came to us handling 50,000+ daily orders with page timeouts during flash sales. Our four-week audit and remediation:",{"type":34,"tag":1342,"props":7077,"children":7078},{},[7079,7095],{"type":34,"tag":1346,"props":7080,"children":7081},{},[7082],{"type":34,"tag":1350,"props":7083,"children":7084},{},[7085,7090],{"type":34,"tag":1354,"props":7086,"children":7087},{},[7088],{"type":40,"value":7089},"Action",{"type":34,"tag":1354,"props":7091,"children":7092},{},[7093],{"type":40,"value":7094},"Impact",{"type":34,"tag":1375,"props":7096,"children":7097},{},[7098,7111,7124,7137,7150],{"type":34,"tag":1350,"props":7099,"children":7100},{},[7101,7106],{"type":34,"tag":1382,"props":7102,"children":7103},{},[7104],{"type":40,"value":7105},"Rewrote 15 highest-cost queries",{"type":34,"tag":1382,"props":7107,"children":7108},{},[7109],{"type":40,"value":7110},"−60% DB CPU usage",{"type":34,"tag":1350,"props":7112,"children":7113},{},[7114,7119],{"type":34,"tag":1382,"props":7115,"children":7116},{},[7117],{"type":40,"value":7118},"Added 8 strategic covering indexes",{"type":34,"tag":1382,"props":7120,"children":7121},{},[7122],{"type":40,"value":7123},"Avg query time: 1200ms → 85ms",{"type":34,"tag":1350,"props":7125,"children":7126},{},[7127,7132],{"type":34,"tag":1382,"props":7128,"children":7129},{},[7130],{"type":40,"value":7131},"Removed 5 unused indexes",{"type":34,"tag":1382,"props":7133,"children":7134},{},[7135],{"type":40,"value":7136},"Write throughput +18%",{"type":34,"tag":1350,"props":7138,"children":7139},{},[7140,7145],{"type":34,"tag":1382,"props":7141,"children":7142},{},[7143],{"type":40,"value":7144},"Added Redis for product catalogue",{"type":34,"tag":1382,"props":7146,"children":7147},{},[7148],{"type":40,"value":7149},"Cache hit rate 94%",{"type":34,"tag":1350,"props":7151,"children":7152},{},[7153,7166],{"type":34,"tag":1382,"props":7154,"children":7155},{},[7156,7158,7164],{"type":40,"value":7157},"Partitioned ",{"type":34,"tag":195,"props":7159,"children":7161},{"className":7160},[],[7162],{"type":40,"value":7163},"orders",{"type":40,"value":7165}," table by month",{"type":34,"tag":1382,"props":7167,"children":7168},{},[7169],{"type":40,"value":7170},"Flash sale timeouts eliminated",{"type":34,"tag":43,"props":7172,"children":7173},{},[7174],{"type":40,"value":7175},"The business outcome: a 24% increase in conversion rate—driven entirely by improved responsiveness. No new hardware was purchased.",{"type":34,"tag":35,"props":7177,"children":7179},{"id":7178},"schema-design-getting-it-right-upstream",[7180],{"type":40,"value":7181},"Schema Design: Getting It Right Upstream",{"type":34,"tag":43,"props":7183,"children":7184},{},[7185],{"type":40,"value":7186},"Optimising a poorly designed schema is fighting uphill. Principles that pay off long-term:",{"type":34,"tag":54,"props":7188,"children":7189},{},[7190,7200,7210,7234],{"type":34,"tag":58,"props":7191,"children":7192},{},[7193,7198],{"type":34,"tag":62,"props":7194,"children":7195},{},[7196],{"type":40,"value":7197},"Normalise transactional tables",{"type":40,"value":7199}," — eliminating update anomalies is worth the occasional join",{"type":34,"tag":58,"props":7201,"children":7202},{},[7203,7208],{"type":34,"tag":62,"props":7204,"children":7205},{},[7206],{"type":40,"value":7207},"Denormalise for reporting",{"type":40,"value":7209}," — create dedicated summary tables or materialised views rather than forcing complex joins into every report query",{"type":34,"tag":58,"props":7211,"children":7212},{},[7213,7218,7220,7225,7226,7232],{"type":34,"tag":62,"props":7214,"children":7215},{},[7216],{"type":40,"value":7217},"Partition large tables",{"type":40,"value":7219}," — partition ",{"type":34,"tag":195,"props":7221,"children":7223},{"className":7222},[],[7224],{"type":40,"value":7163},{"type":40,"value":4353},{"type":34,"tag":195,"props":7227,"children":7229},{"className":7228},[],[7230],{"type":40,"value":7231},"events",{"type":40,"value":7233}," tables by date range so old data never slows current queries",{"type":34,"tag":58,"props":7235,"children":7236},{},[7237,7242,7243,7249,7251,7257,7259,7265,7267,7273],{"type":34,"tag":62,"props":7238,"children":7239},{},[7240],{"type":40,"value":7241},"Use appropriate data types",{"type":40,"value":2778},{"type":34,"tag":195,"props":7244,"children":7246},{"className":7245},[],[7247],{"type":40,"value":7248},"BIGINT",{"type":40,"value":7250}," for IDs that will exceed 2 billion, ",{"type":34,"tag":195,"props":7252,"children":7254},{"className":7253},[],[7255],{"type":40,"value":7256},"TIMESTAMPTZ",{"type":40,"value":7258}," for timestamps (always store UTC), ",{"type":34,"tag":195,"props":7260,"children":7262},{"className":7261},[],[7263],{"type":40,"value":7264},"NUMERIC(10,2)",{"type":40,"value":7266}," for money (never ",{"type":34,"tag":195,"props":7268,"children":7270},{"className":7269},[],[7271],{"type":40,"value":7272},"FLOAT",{"type":40,"value":5778},{"type":34,"tag":43,"props":7275,"children":7276},{},[7277],{"type":40,"value":7278},"Database performance is a product of schema design, query patterns, and infrastructure working together. Fix all three, and you'll handle 10× the traffic on the same hardware.",{"type":34,"tag":1748,"props":7280,"children":7281},{},[7282],{"type":40,"value":1752},{"title":7,"searchDepth":278,"depth":278,"links":7284},[7285,7286,7287,7292,7298,7302,7303],{"id":4570,"depth":212,"text":4573},{"id":4586,"depth":212,"text":4589},{"id":4861,"depth":212,"text":4864,"children":7288},[7289,7290,7291],{"id":4867,"depth":278,"text":4870},{"id":5249,"depth":278,"text":5252},{"id":5392,"depth":278,"text":5395},{"id":5689,"depth":212,"text":5692,"children":7293},[7294,7295,7296,7297],{"id":5700,"depth":278,"text":5703},{"id":5786,"depth":278,"text":5789},{"id":5995,"depth":278,"text":5998},{"id":6094,"depth":278,"text":6097},{"id":6237,"depth":212,"text":6240,"children":7299},[7300,7301],{"id":6248,"depth":278,"text":6251},{"id":6781,"depth":278,"text":6784},{"id":7067,"depth":212,"text":7070},{"id":7178,"depth":212,"text":7181},"content:blog:database-optimization.md","blog/database-optimization.md","blog/database-optimization",{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"slug":10,"date":11,"readTime":12,"category":13,"image":14,"imageCaption":15,"author":7308,"tags":7310,"body":7311,"_type":1767,"_id":1768,"_source":1769,"_file":1770,"_stem":1771,"_extension":1772},{"name":17,"role":18,"avatar":19,"bio":20,"social":7309},{"github":22,"twitter":23,"linkedin":24},[26,27,28,29,13],{"type":31,"children":7312,"toc":8736},[7313,7317,7321,7325,7356,7360,7364,7368,7372,7376,7411,7415,7419,7423,7427,8034,8053,8057,8061,8372,8376,8380,8384,8388,8501,8505,8612,8616,8700,8704,8712,8720,8728,8732],{"type":34,"tag":35,"props":7314,"children":7315},{"id":37},[7316],{"type":40,"value":41},{"type":34,"tag":43,"props":7318,"children":7319},{},[7320],{"type":40,"value":47},{"type":34,"tag":43,"props":7322,"children":7323},{},[7324],{"type":40,"value":52},{"type":34,"tag":54,"props":7326,"children":7327},{},[7328,7336,7344,7352],{"type":34,"tag":58,"props":7329,"children":7330},{},[7331,7335],{"type":34,"tag":62,"props":7332,"children":7333},{},[7334],{"type":40,"value":66},{"type":40,"value":68},{"type":34,"tag":58,"props":7337,"children":7338},{},[7339,7343],{"type":34,"tag":62,"props":7340,"children":7341},{},[7342],{"type":40,"value":76},{"type":40,"value":78},{"type":34,"tag":58,"props":7345,"children":7346},{},[7347,7351],{"type":34,"tag":62,"props":7348,"children":7349},{},[7350],{"type":40,"value":86},{"type":40,"value":88},{"type":34,"tag":58,"props":7353,"children":7354},{},[7355],{"type":40,"value":93},{"type":34,"tag":43,"props":7357,"children":7358},{},[7359],{"type":40,"value":98},{"type":34,"tag":35,"props":7361,"children":7362},{"id":101},[7363],{"type":40,"value":104},{"type":34,"tag":43,"props":7365,"children":7366},{},[7367],{"type":40,"value":109},{"type":34,"tag":43,"props":7369,"children":7370},{},[7371],{"type":40,"value":114},{"type":34,"tag":43,"props":7373,"children":7374},{},[7375],{"type":40,"value":119},{"type":34,"tag":121,"props":7377,"children":7378},{},[7379,7387,7395,7403],{"type":34,"tag":58,"props":7380,"children":7381},{},[7382,7386],{"type":34,"tag":62,"props":7383,"children":7384},{},[7385],{"type":40,"value":131},{"type":40,"value":133},{"type":34,"tag":58,"props":7388,"children":7389},{},[7390,7394],{"type":34,"tag":62,"props":7391,"children":7392},{},[7393],{"type":40,"value":141},{"type":40,"value":143},{"type":34,"tag":58,"props":7396,"children":7397},{},[7398,7402],{"type":34,"tag":62,"props":7399,"children":7400},{},[7401],{"type":40,"value":151},{"type":40,"value":153},{"type":34,"tag":58,"props":7404,"children":7405},{},[7406,7410],{"type":34,"tag":62,"props":7407,"children":7408},{},[7409],{"type":40,"value":161},{"type":40,"value":163},{"type":34,"tag":43,"props":7412,"children":7413},{},[7414],{"type":40,"value":168},{"type":34,"tag":35,"props":7416,"children":7417},{"id":171},[7418],{"type":40,"value":174},{"type":34,"tag":176,"props":7420,"children":7421},{"id":178},[7422],{"type":40,"value":181},{"type":34,"tag":43,"props":7424,"children":7425},{},[7426],{"type":40,"value":186},{"type":34,"tag":188,"props":7428,"children":7429},{"className":190,"code":191,"language":192,"meta":7,"style":7},[7430],{"type":34,"tag":195,"props":7431,"children":7432},{"__ignoreMap":7},[7433,7440,7491,7498,7521,7544,7551,7594,7609,7624,7631,7658,7665,7676,7703,7710,7729,7760,7767,7786,7793,7800,7807,7814,7857,7864,7887,7894,7953,7960,7967,7998,8009,8020,8027],{"type":34,"tag":199,"props":7434,"children":7435},{"class":201,"line":202},[7436],{"type":34,"tag":199,"props":7437,"children":7438},{"style":206},[7439],{"type":40,"value":209},{"type":34,"tag":199,"props":7441,"children":7442},{"class":201,"line":212},[7443,7447,7451,7455,7459,7463,7467,7471,7475,7479,7483,7487],{"type":34,"tag":199,"props":7444,"children":7445},{"style":216},[7446],{"type":40,"value":219},{"type":34,"tag":199,"props":7448,"children":7449},{"style":216},[7450],{"type":40,"value":224},{"type":34,"tag":199,"props":7452,"children":7453},{"style":227},[7454],{"type":40,"value":230},{"type":34,"tag":199,"props":7456,"children":7457},{"style":233},[7458],{"type":40,"value":236},{"type":34,"tag":199,"props":7460,"children":7461},{"style":227},[7462],{"type":40,"value":241},{"type":34,"tag":199,"props":7464,"children":7465},{"style":233},[7466],{"type":40,"value":246},{"type":34,"tag":199,"props":7468,"children":7469},{"style":227},[7470],{"type":40,"value":251},{"type":34,"tag":199,"props":7472,"children":7473},{"style":233},[7474],{"type":40,"value":256},{"type":34,"tag":199,"props":7476,"children":7477},{"style":227},[7478],{"type":40,"value":261},{"type":34,"tag":199,"props":7480,"children":7481},{"style":233},[7482],{"type":40,"value":246},{"type":34,"tag":199,"props":7484,"children":7485},{"style":216},[7486],{"type":40,"value":270},{"type":34,"tag":199,"props":7488,"children":7489},{"style":233},[7490],{"type":40,"value":275},{"type":34,"tag":199,"props":7492,"children":7493},{"class":201,"line":278},[7494],{"type":34,"tag":199,"props":7495,"children":7496},{"style":233},[7497],{"type":40,"value":284},{"type":34,"tag":199,"props":7499,"children":7500},{"class":201,"line":287},[7501,7505,7509,7513,7517],{"type":34,"tag":199,"props":7502,"children":7503},{"style":216},[7504],{"type":40,"value":293},{"type":34,"tag":199,"props":7506,"children":7507},{"style":216},[7508],{"type":40,"value":298},{"type":34,"tag":199,"props":7510,"children":7511},{"style":227},[7512],{"type":40,"value":303},{"type":34,"tag":199,"props":7514,"children":7515},{"style":227},[7516],{"type":40,"value":308},{"type":34,"tag":199,"props":7518,"children":7519},{"style":233},[7520],{"type":40,"value":313},{"type":34,"tag":199,"props":7522,"children":7523},{"class":201,"line":316},[7524,7528,7532,7536,7540],{"type":34,"tag":199,"props":7525,"children":7526},{"style":216},[7527],{"type":40,"value":293},{"type":34,"tag":199,"props":7529,"children":7530},{"style":216},[7531],{"type":40,"value":298},{"type":34,"tag":199,"props":7533,"children":7534},{"style":227},[7535],{"type":40,"value":330},{"type":34,"tag":199,"props":7537,"children":7538},{"style":227},[7539],{"type":40,"value":335},{"type":34,"tag":199,"props":7541,"children":7542},{"style":233},[7543],{"type":40,"value":313},{"type":34,"tag":199,"props":7545,"children":7546},{"class":201,"line":342},[7547],{"type":34,"tag":199,"props":7548,"children":7549},{"emptyLinePlaceholder":346},[7550],{"type":40,"value":349},{"type":34,"tag":199,"props":7552,"children":7553},{"class":201,"line":352},[7554,7558,7562,7566,7570,7574,7578,7582,7586,7590],{"type":34,"tag":199,"props":7555,"children":7556},{"style":216},[7557],{"type":40,"value":358},{"type":34,"tag":199,"props":7559,"children":7560},{"style":216},[7561],{"type":40,"value":363},{"type":34,"tag":199,"props":7563,"children":7564},{"style":227},[7565],{"type":40,"value":368},{"type":34,"tag":199,"props":7567,"children":7568},{"style":233},[7569],{"type":40,"value":246},{"type":34,"tag":199,"props":7571,"children":7572},{"style":227},[7573],{"type":40,"value":261},{"type":34,"tag":199,"props":7575,"children":7576},{"style":233},[7577],{"type":40,"value":246},{"type":34,"tag":199,"props":7579,"children":7580},{"style":216},[7581],{"type":40,"value":270},{"type":34,"tag":199,"props":7583,"children":7584},{"style":233},[7585],{"type":40,"value":389},{"type":34,"tag":199,"props":7587,"children":7588},{"style":227},[7589],{"type":40,"value":394},{"type":34,"tag":199,"props":7591,"children":7592},{"style":233},[7593],{"type":40,"value":399},{"type":34,"tag":199,"props":7595,"children":7596},{"class":201,"line":402},[7597,7601,7605],{"type":34,"tag":199,"props":7598,"children":7599},{"style":227},[7600],{"type":40,"value":408},{"type":34,"tag":199,"props":7602,"children":7603},{"style":227},[7604],{"type":40,"value":413},{"type":34,"tag":199,"props":7606,"children":7607},{"style":233},[7608],{"type":40,"value":418},{"type":34,"tag":199,"props":7610,"children":7611},{"class":201,"line":421},[7612,7616,7620],{"type":34,"tag":199,"props":7613,"children":7614},{"style":227},[7615],{"type":40,"value":427},{"type":34,"tag":199,"props":7617,"children":7618},{"style":227},[7619],{"type":40,"value":432},{"type":34,"tag":199,"props":7621,"children":7622},{"style":233},[7623],{"type":40,"value":437},{"type":34,"tag":199,"props":7625,"children":7626},{"class":201,"line":440},[7627],{"type":34,"tag":199,"props":7628,"children":7629},{"style":233},[7630],{"type":40,"value":446},{"type":34,"tag":199,"props":7632,"children":7633},{"class":201,"line":449},[7634,7638,7642,7646,7650,7654],{"type":34,"tag":199,"props":7635,"children":7636},{"style":216},[7637],{"type":40,"value":455},{"type":34,"tag":199,"props":7639,"children":7640},{"style":227},[7641],{"type":40,"value":460},{"type":34,"tag":199,"props":7643,"children":7644},{"style":216},[7645],{"type":40,"value":465},{"type":34,"tag":199,"props":7647,"children":7648},{"style":233},[7649],{"type":40,"value":470},{"type":34,"tag":199,"props":7651,"children":7652},{"style":227},[7653],{"type":40,"value":475},{"type":34,"tag":199,"props":7655,"children":7656},{"style":233},[7657],{"type":40,"value":480},{"type":34,"tag":199,"props":7659,"children":7660},{"class":201,"line":483},[7661],{"type":34,"tag":199,"props":7662,"children":7663},{"emptyLinePlaceholder":346},[7664],{"type":40,"value":349},{"type":34,"tag":199,"props":7666,"children":7667},{"class":201,"line":491},[7668,7672],{"type":34,"tag":199,"props":7669,"children":7670},{"style":216},[7671],{"type":40,"value":497},{"type":34,"tag":199,"props":7673,"children":7674},{"style":233},[7675],{"type":40,"value":502},{"type":34,"tag":199,"props":7677,"children":7678},{"class":201,"line":505},[7679,7683,7687,7691,7695,7699],{"type":34,"tag":199,"props":7680,"children":7681},{"style":216},[7682],{"type":40,"value":511},{"type":34,"tag":199,"props":7684,"children":7685},{"style":233},[7686],{"type":40,"value":516},{"type":34,"tag":199,"props":7688,"children":7689},{"style":227},[7690],{"type":40,"value":521},{"type":34,"tag":199,"props":7692,"children":7693},{"style":233},[7694],{"type":40,"value":246},{"type":34,"tag":199,"props":7696,"children":7697},{"style":216},[7698],{"type":40,"value":270},{"type":34,"tag":199,"props":7700,"children":7701},{"style":233},[7702],{"type":40,"value":534},{"type":34,"tag":199,"props":7704,"children":7705},{"class":201,"line":537},[7706],{"type":34,"tag":199,"props":7707,"children":7708},{"emptyLinePlaceholder":346},[7709],{"type":40,"value":349},{"type":34,"tag":199,"props":7711,"children":7712},{"class":201,"line":545},[7713,7717,7721,7725],{"type":34,"tag":199,"props":7714,"children":7715},{"style":216},[7716],{"type":40,"value":551},{"type":34,"tag":199,"props":7718,"children":7719},{"style":233},[7720],{"type":40,"value":556},{"type":34,"tag":199,"props":7722,"children":7723},{"style":227},[7724],{"type":40,"value":561},{"type":34,"tag":199,"props":7726,"children":7727},{"style":233},[7728],{"type":40,"value":566},{"type":34,"tag":199,"props":7730,"children":7731},{"class":201,"line":569},[7732,7736,7740,7744,7748,7752,7756],{"type":34,"tag":199,"props":7733,"children":7734},{"style":216},[7735],{"type":40,"value":551},{"type":34,"tag":199,"props":7737,"children":7738},{"style":233},[7739],{"type":40,"value":579},{"type":34,"tag":199,"props":7741,"children":7742},{"style":227},[7743],{"type":40,"value":584},{"type":34,"tag":199,"props":7745,"children":7746},{"style":233},[7747],{"type":40,"value":589},{"type":34,"tag":199,"props":7749,"children":7750},{"style":216},[7751],{"type":40,"value":594},{"type":34,"tag":199,"props":7753,"children":7754},{"style":227},[7755],{"type":40,"value":599},{"type":34,"tag":199,"props":7757,"children":7758},{"style":233},[7759],{"type":40,"value":604},{"type":34,"tag":199,"props":7761,"children":7762},{"class":201,"line":607},[7763],{"type":34,"tag":199,"props":7764,"children":7765},{"emptyLinePlaceholder":346},[7766],{"type":40,"value":349},{"type":34,"tag":199,"props":7768,"children":7769},{"class":201,"line":615},[7770,7774,7778,7782],{"type":34,"tag":199,"props":7771,"children":7772},{"style":216},[7773],{"type":40,"value":621},{"type":34,"tag":199,"props":7775,"children":7776},{"style":233},[7777],{"type":40,"value":516},{"type":34,"tag":199,"props":7779,"children":7780},{"style":227},[7781],{"type":40,"value":630},{"type":34,"tag":199,"props":7783,"children":7784},{"style":233},[7785],{"type":40,"value":635},{"type":34,"tag":199,"props":7787,"children":7788},{"class":201,"line":638},[7789],{"type":34,"tag":199,"props":7790,"children":7791},{"style":233},[7792],{"type":40,"value":644},{"type":34,"tag":199,"props":7794,"children":7795},{"class":201,"line":647},[7796],{"type":34,"tag":199,"props":7797,"children":7798},{"style":233},[7799],{"type":40,"value":653},{"type":34,"tag":199,"props":7801,"children":7802},{"class":201,"line":656},[7803],{"type":34,"tag":199,"props":7804,"children":7805},{"emptyLinePlaceholder":346},[7806],{"type":40,"value":349},{"type":34,"tag":199,"props":7808,"children":7809},{"class":201,"line":664},[7810],{"type":34,"tag":199,"props":7811,"children":7812},{"style":206},[7813],{"type":40,"value":670},{"type":34,"tag":199,"props":7815,"children":7816},{"class":201,"line":673},[7817,7821,7825,7829,7833,7837,7841,7845,7849,7853],{"type":34,"tag":199,"props":7818,"children":7819},{"style":216},[7820],{"type":40,"value":219},{"type":34,"tag":199,"props":7822,"children":7823},{"style":216},[7824],{"type":40,"value":224},{"type":34,"tag":199,"props":7826,"children":7827},{"style":227},[7828],{"type":40,"value":687},{"type":34,"tag":199,"props":7830,"children":7831},{"style":233},[7832],{"type":40,"value":236},{"type":34,"tag":199,"props":7834,"children":7835},{"style":227},[7836],{"type":40,"value":241},{"type":34,"tag":199,"props":7838,"children":7839},{"style":233},[7840],{"type":40,"value":246},{"type":34,"tag":199,"props":7842,"children":7843},{"style":227},[7844],{"type":40,"value":704},{"type":34,"tag":199,"props":7846,"children":7847},{"style":233},[7848],{"type":40,"value":256},{"type":34,"tag":199,"props":7850,"children":7851},{"style":227},[7852],{"type":40,"value":713},{"type":34,"tag":199,"props":7854,"children":7855},{"style":233},[7856],{"type":40,"value":718},{"type":34,"tag":199,"props":7858,"children":7859},{"class":201,"line":721},[7860],{"type":34,"tag":199,"props":7861,"children":7862},{"style":233},[7863],{"type":40,"value":284},{"type":34,"tag":199,"props":7865,"children":7866},{"class":201,"line":729},[7867,7871,7875,7879,7883],{"type":34,"tag":199,"props":7868,"children":7869},{"style":216},[7870],{"type":40,"value":293},{"type":34,"tag":199,"props":7872,"children":7873},{"style":216},[7874],{"type":40,"value":298},{"type":34,"tag":199,"props":7876,"children":7877},{"style":227},[7878],{"type":40,"value":743},{"type":34,"tag":199,"props":7880,"children":7881},{"style":227},[7882],{"type":40,"value":748},{"type":34,"tag":199,"props":7884,"children":7885},{"style":233},[7886],{"type":40,"value":313},{"type":34,"tag":199,"props":7888,"children":7889},{"class":201,"line":755},[7890],{"type":34,"tag":199,"props":7891,"children":7892},{"emptyLinePlaceholder":346},[7893],{"type":40,"value":349},{"type":34,"tag":199,"props":7895,"children":7896},{"class":201,"line":763},[7897,7901,7905,7909,7913,7917,7921,7925,7929,7933,7937,7941,7945,7949],{"type":34,"tag":199,"props":7898,"children":7899},{"style":216},[7900],{"type":40,"value":358},{"type":34,"tag":199,"props":7902,"children":7903},{"style":216},[7904],{"type":40,"value":363},{"type":34,"tag":199,"props":7906,"children":7907},{"style":227},[7908],{"type":40,"value":368},{"type":34,"tag":199,"props":7910,"children":7911},{"style":233},[7912],{"type":40,"value":246},{"type":34,"tag":199,"props":7914,"children":7915},{"style":227},[7916],{"type":40,"value":713},{"type":34,"tag":199,"props":7918,"children":7919},{"style":233},[7920],{"type":40,"value":789},{"type":34,"tag":199,"props":7922,"children":7923},{"style":227},[7924],{"type":40,"value":394},{"type":34,"tag":199,"props":7926,"children":7927},{"style":233},[7928],{"type":40,"value":589},{"type":34,"tag":199,"props":7930,"children":7931},{"style":227},[7932],{"type":40,"value":704},{"type":34,"tag":199,"props":7934,"children":7935},{"style":227},[7936],{"type":40,"value":806},{"type":34,"tag":199,"props":7938,"children":7939},{"style":233},[7940],{"type":40,"value":256},{"type":34,"tag":199,"props":7942,"children":7943},{"style":227},[7944],{"type":40,"value":815},{"type":34,"tag":199,"props":7946,"children":7947},{"style":227},[7948],{"type":40,"value":432},{"type":34,"tag":199,"props":7950,"children":7951},{"style":233},[7952],{"type":40,"value":437},{"type":34,"tag":199,"props":7954,"children":7955},{"class":201,"line":826},[7956],{"type":34,"tag":199,"props":7957,"children":7958},{"style":233},[7959],{"type":40,"value":446},{"type":34,"tag":199,"props":7961,"children":7962},{"class":201,"line":834},[7963],{"type":34,"tag":199,"props":7964,"children":7965},{"style":206},[7966],{"type":40,"value":840},{"type":34,"tag":199,"props":7968,"children":7969},{"class":201,"line":843},[7970,7974,7978,7982,7986,7990,7994],{"type":34,"tag":199,"props":7971,"children":7972},{"style":216},[7973],{"type":40,"value":621},{"type":34,"tag":199,"props":7975,"children":7976},{"style":216},[7977],{"type":40,"value":853},{"type":34,"tag":199,"props":7979,"children":7980},{"style":233},[7981],{"type":40,"value":858},{"type":34,"tag":199,"props":7983,"children":7984},{"style":227},[7985],{"type":40,"value":863},{"type":34,"tag":199,"props":7987,"children":7988},{"style":233},[7989],{"type":40,"value":246},{"type":34,"tag":199,"props":7991,"children":7992},{"style":227},[7993],{"type":40,"value":713},{"type":34,"tag":199,"props":7995,"children":7996},{"style":233},[7997],{"type":40,"value":876},{"type":34,"tag":199,"props":7999,"children":8000},{"class":201,"line":879},[8001,8005],{"type":34,"tag":199,"props":8002,"children":8003},{"style":883},[8004],{"type":40,"value":886},{"type":34,"tag":199,"props":8006,"children":8007},{"style":233},[8008],{"type":40,"value":418},{"type":34,"tag":199,"props":8010,"children":8011},{"class":201,"line":893},[8012,8016],{"type":34,"tag":199,"props":8013,"children":8014},{"style":216},[8015],{"type":40,"value":899},{"type":34,"tag":199,"props":8017,"children":8018},{"style":233},[8019],{"type":40,"value":904},{"type":34,"tag":199,"props":8021,"children":8022},{"class":201,"line":907},[8023],{"type":34,"tag":199,"props":8024,"children":8025},{"style":233},[8026],{"type":40,"value":644},{"type":34,"tag":199,"props":8028,"children":8029},{"class":201,"line":915},[8030],{"type":34,"tag":199,"props":8031,"children":8032},{"style":233},[8033],{"type":40,"value":653},{"type":34,"tag":43,"props":8035,"children":8036},{},[8037,8038,8042,8043,8047,8048,8052],{"type":40,"value":925},{"type":34,"tag":62,"props":8039,"children":8040},{},[8041],{"type":40,"value":930},{"type":40,"value":932},{"type":34,"tag":62,"props":8044,"children":8045},{},[8046],{"type":40,"value":937},{"type":40,"value":939},{"type":34,"tag":62,"props":8049,"children":8050},{},[8051],{"type":40,"value":944},{"type":40,"value":946},{"type":34,"tag":176,"props":8054,"children":8055},{"id":949},[8056],{"type":40,"value":952},{"type":34,"tag":43,"props":8058,"children":8059},{},[8060],{"type":40,"value":957},{"type":34,"tag":188,"props":8062,"children":8063},{"className":960,"code":961,"language":962,"meta":7,"style":7},[8064],{"type":34,"tag":195,"props":8065,"children":8066},{"__ignoreMap":7},[8067,8074,8117,8132,8151,8194,8201,8208,8223,8250,8261,8268,8299,8314,8329,8344,8351,8358,8365],{"type":34,"tag":199,"props":8068,"children":8069},{"class":201,"line":202},[8070],{"type":34,"tag":199,"props":8071,"children":8072},{"style":206},[8073],{"type":40,"value":974},{"type":34,"tag":199,"props":8075,"children":8076},{"class":201,"line":212},[8077,8081,8085,8089,8093,8097,8101,8105,8109,8113],{"type":34,"tag":199,"props":8078,"children":8079},{"style":216},[8080],{"type":40,"value":982},{"type":34,"tag":199,"props":8082,"children":8083},{"style":227},[8084],{"type":40,"value":987},{"type":34,"tag":199,"props":8086,"children":8087},{"style":216},[8088],{"type":40,"value":465},{"type":34,"tag":199,"props":8090,"children":8091},{"style":233},[8092],{"type":40,"value":996},{"type":34,"tag":199,"props":8094,"children":8095},{"style":999},[8096],{"type":40,"value":1002},{"type":34,"tag":199,"props":8098,"children":8099},{"style":216},[8100],{"type":40,"value":1007},{"type":34,"tag":199,"props":8102,"children":8103},{"style":1010},[8104],{"type":40,"value":1013},{"type":34,"tag":199,"props":8106,"children":8107},{"style":233},[8108],{"type":40,"value":1018},{"type":34,"tag":199,"props":8110,"children":8111},{"style":216},[8112],{"type":40,"value":1023},{"type":34,"tag":199,"props":8114,"children":8115},{"style":233},[8116],{"type":40,"value":1028},{"type":34,"tag":199,"props":8118,"children":8119},{"class":201,"line":278},[8120,8124,8128],{"type":34,"tag":199,"props":8121,"children":8122},{"style":216},[8123],{"type":40,"value":1036},{"type":34,"tag":199,"props":8125,"children":8126},{"style":227},[8127],{"type":40,"value":1041},{"type":34,"tag":199,"props":8129,"children":8130},{"style":233},[8131],{"type":40,"value":399},{"type":34,"tag":199,"props":8133,"children":8134},{"class":201,"line":287},[8135,8139,8143,8147],{"type":34,"tag":199,"props":8136,"children":8137},{"style":883},[8138],{"type":40,"value":1053},{"type":34,"tag":199,"props":8140,"children":8141},{"style":233},[8142],{"type":40,"value":1002},{"type":34,"tag":199,"props":8144,"children":8145},{"style":883},[8146],{"type":40,"value":1062},{"type":34,"tag":199,"props":8148,"children":8149},{"style":233},[8150],{"type":40,"value":418},{"type":34,"tag":199,"props":8152,"children":8153},{"class":201,"line":316},[8154,8158,8162,8166,8170,8174,8178,8182,8186,8190],{"type":34,"tag":199,"props":8155,"children":8156},{"style":233},[8157],{"type":40,"value":1074},{"type":34,"tag":199,"props":8159,"children":8160},{"style":216},[8161],{"type":40,"value":1023},{"type":34,"tag":199,"props":8163,"children":8164},{"style":227},[8165],{"type":40,"value":1083},{"type":34,"tag":199,"props":8167,"children":8168},{"style":233},[8169],{"type":40,"value":246},{"type":34,"tag":199,"props":8171,"children":8172},{"style":227},[8173],{"type":40,"value":1092},{"type":34,"tag":199,"props":8175,"children":8176},{"style":233},[8177],{"type":40,"value":1097},{"type":34,"tag":199,"props":8179,"children":8180},{"style":883},[8181],{"type":40,"value":1102},{"type":34,"tag":199,"props":8183,"children":8184},{"style":233},[8185],{"type":40,"value":1002},{"type":34,"tag":199,"props":8187,"children":8188},{"style":883},[8189],{"type":40,"value":1062},{"type":34,"tag":199,"props":8191,"children":8192},{"style":233},[8193],{"type":40,"value":1115},{"type":34,"tag":199,"props":8195,"children":8196},{"class":201,"line":342},[8197],{"type":34,"tag":199,"props":8198,"children":8199},{"style":233},[8200],{"type":40,"value":446},{"type":34,"tag":199,"props":8202,"children":8203},{"class":201,"line":352},[8204],{"type":34,"tag":199,"props":8205,"children":8206},{"style":206},[8207],{"type":40,"value":1130},{"type":34,"tag":199,"props":8209,"children":8210},{"class":201,"line":402},[8211,8215,8219],{"type":34,"tag":199,"props":8212,"children":8213},{"style":233},[8214],{"type":40,"value":1138},{"type":34,"tag":199,"props":8216,"children":8217},{"style":883},[8218],{"type":40,"value":1143},{"type":34,"tag":199,"props":8220,"children":8221},{"style":233},[8222],{"type":40,"value":418},{"type":34,"tag":199,"props":8224,"children":8225},{"class":201,"line":421},[8226,8230,8234,8238,8242,8246],{"type":34,"tag":199,"props":8227,"children":8228},{"style":227},[8229],{"type":40,"value":1155},{"type":34,"tag":199,"props":8231,"children":8232},{"style":233},[8233],{"type":40,"value":1160},{"type":34,"tag":199,"props":8235,"children":8236},{"style":999},[8237],{"type":40,"value":1165},{"type":34,"tag":199,"props":8239,"children":8240},{"style":233},[8241],{"type":40,"value":1018},{"type":34,"tag":199,"props":8243,"children":8244},{"style":216},[8245],{"type":40,"value":1023},{"type":34,"tag":199,"props":8247,"children":8248},{"style":233},[8249],{"type":40,"value":1178},{"type":34,"tag":199,"props":8251,"children":8252},{"class":201,"line":440},[8253,8257],{"type":34,"tag":199,"props":8254,"children":8255},{"style":216},[8256],{"type":40,"value":1186},{"type":34,"tag":199,"props":8258,"children":8259},{"style":233},[8260],{"type":40,"value":1191},{"type":34,"tag":199,"props":8262,"children":8263},{"class":201,"line":449},[8264],{"type":34,"tag":199,"props":8265,"children":8266},{"style":206},[8267],{"type":40,"value":1199},{"type":34,"tag":199,"props":8269,"children":8270},{"class":201,"line":483},[8271,8275,8279,8283,8287,8291,8295],{"type":34,"tag":199,"props":8272,"children":8273},{"style":233},[8274],{"type":40,"value":1207},{"type":34,"tag":199,"props":8276,"children":8277},{"style":216},[8278],{"type":40,"value":594},{"type":34,"tag":199,"props":8280,"children":8281},{"style":233},[8282],{"type":40,"value":1216},{"type":34,"tag":199,"props":8284,"children":8285},{"style":227},[8286],{"type":40,"value":1221},{"type":34,"tag":199,"props":8288,"children":8289},{"style":233},[8290],{"type":40,"value":589},{"type":34,"tag":199,"props":8292,"children":8293},{"style":883},[8294],{"type":40,"value":1230},{"type":34,"tag":199,"props":8296,"children":8297},{"style":233},[8298],{"type":40,"value":1235},{"type":34,"tag":199,"props":8300,"children":8301},{"class":201,"line":491},[8302,8306,8310],{"type":34,"tag":199,"props":8303,"children":8304},{"style":233},[8305],{"type":40,"value":1243},{"type":34,"tag":199,"props":8307,"children":8308},{"style":883},[8309],{"type":40,"value":1248},{"type":34,"tag":199,"props":8311,"children":8312},{"style":233},[8313],{"type":40,"value":418},{"type":34,"tag":199,"props":8315,"children":8316},{"class":201,"line":505},[8317,8321,8325],{"type":34,"tag":199,"props":8318,"children":8319},{"style":233},[8320],{"type":40,"value":1260},{"type":34,"tag":199,"props":8322,"children":8323},{"style":883},[8324],{"type":40,"value":1265},{"type":34,"tag":199,"props":8326,"children":8327},{"style":233},[8328],{"type":40,"value":418},{"type":34,"tag":199,"props":8330,"children":8331},{"class":201,"line":537},[8332,8336,8340],{"type":34,"tag":199,"props":8333,"children":8334},{"style":233},[8335],{"type":40,"value":1277},{"type":34,"tag":199,"props":8337,"children":8338},{"style":227},[8339],{"type":40,"value":1282},{"type":34,"tag":199,"props":8341,"children":8342},{"style":233},[8343],{"type":40,"value":1287},{"type":34,"tag":199,"props":8345,"children":8346},{"class":201,"line":545},[8347],{"type":34,"tag":199,"props":8348,"children":8349},{"style":233},[8350],{"type":40,"value":1295},{"type":34,"tag":199,"props":8352,"children":8353},{"class":201,"line":569},[8354],{"type":34,"tag":199,"props":8355,"children":8356},{"style":233},[8357],{"type":40,"value":644},{"type":34,"tag":199,"props":8359,"children":8360},{"class":201,"line":607},[8361],{"type":34,"tag":199,"props":8362,"children":8363},{"style":233},[8364],{"type":40,"value":1310},{"type":34,"tag":199,"props":8366,"children":8367},{"class":201,"line":615},[8368],{"type":34,"tag":199,"props":8369,"children":8370},{"style":233},[8371],{"type":40,"value":1318},{"type":34,"tag":43,"props":8373,"children":8374},{},[8375],{"type":40,"value":1323},{"type":34,"tag":35,"props":8377,"children":8378},{"id":1326},[8379],{"type":40,"value":1329},{"type":34,"tag":43,"props":8381,"children":8382},{},[8383],{"type":40,"value":1334},{"type":34,"tag":176,"props":8385,"children":8386},{"id":1337},[8387],{"type":40,"value":1340},{"type":34,"tag":1342,"props":8389,"children":8390},{},[8391,8413],{"type":34,"tag":1346,"props":8392,"children":8393},{},[8394],{"type":34,"tag":1350,"props":8395,"children":8396},{},[8397,8401,8405,8409],{"type":34,"tag":1354,"props":8398,"children":8399},{},[8400],{"type":40,"value":1358},{"type":34,"tag":1354,"props":8402,"children":8403},{},[8404],{"type":40,"value":1363},{"type":34,"tag":1354,"props":8406,"children":8407},{},[8408],{"type":40,"value":1368},{"type":34,"tag":1354,"props":8410,"children":8411},{},[8412],{"type":40,"value":1373},{"type":34,"tag":1375,"props":8414,"children":8415},{},[8416,8438,8460,8482],{"type":34,"tag":1350,"props":8417,"children":8418},{},[8419,8423,8427,8431],{"type":34,"tag":1382,"props":8420,"children":8421},{},[8422],{"type":40,"value":1386},{"type":34,"tag":1382,"props":8424,"children":8425},{},[8426],{"type":40,"value":1391},{"type":34,"tag":1382,"props":8428,"children":8429},{},[8430],{"type":40,"value":1396},{"type":34,"tag":1382,"props":8432,"children":8433},{},[8434],{"type":34,"tag":62,"props":8435,"children":8436},{},[8437],{"type":40,"value":1404},{"type":34,"tag":1350,"props":8439,"children":8440},{},[8441,8445,8449,8453],{"type":34,"tag":1382,"props":8442,"children":8443},{},[8444],{"type":40,"value":1412},{"type":34,"tag":1382,"props":8446,"children":8447},{},[8448],{"type":40,"value":1417},{"type":34,"tag":1382,"props":8450,"children":8451},{},[8452],{"type":40,"value":1422},{"type":34,"tag":1382,"props":8454,"children":8455},{},[8456],{"type":34,"tag":62,"props":8457,"children":8458},{},[8459],{"type":40,"value":1430},{"type":34,"tag":1350,"props":8461,"children":8462},{},[8463,8467,8471,8475],{"type":34,"tag":1382,"props":8464,"children":8465},{},[8466],{"type":40,"value":1438},{"type":34,"tag":1382,"props":8468,"children":8469},{},[8470],{"type":40,"value":1443},{"type":34,"tag":1382,"props":8472,"children":8473},{},[8474],{"type":40,"value":1448},{"type":34,"tag":1382,"props":8476,"children":8477},{},[8478],{"type":34,"tag":62,"props":8479,"children":8480},{},[8481],{"type":40,"value":1456},{"type":34,"tag":1350,"props":8483,"children":8484},{},[8485,8489,8493,8497],{"type":34,"tag":1382,"props":8486,"children":8487},{},[8488],{"type":40,"value":1464},{"type":34,"tag":1382,"props":8490,"children":8491},{},[8492],{"type":40,"value":1469},{"type":34,"tag":1382,"props":8494,"children":8495},{},[8496],{"type":40,"value":1474},{"type":34,"tag":1382,"props":8498,"children":8499},{},[8500],{"type":40,"value":1479},{"type":34,"tag":176,"props":8502,"children":8503},{"id":1482},[8504],{"type":40,"value":1485},{"type":34,"tag":1342,"props":8506,"children":8507},{},[8508,8530],{"type":34,"tag":1346,"props":8509,"children":8510},{},[8511],{"type":34,"tag":1350,"props":8512,"children":8513},{},[8514,8518,8522,8526],{"type":34,"tag":1354,"props":8515,"children":8516},{},[8517],{"type":40,"value":1358},{"type":34,"tag":1354,"props":8519,"children":8520},{},[8521],{"type":40,"value":1363},{"type":34,"tag":1354,"props":8523,"children":8524},{},[8525],{"type":40,"value":1368},{"type":34,"tag":1354,"props":8527,"children":8528},{},[8529],{"type":40,"value":1373},{"type":34,"tag":1375,"props":8531,"children":8532},{},[8533,8552,8571,8593],{"type":34,"tag":1350,"props":8534,"children":8535},{},[8536,8540,8544,8548],{"type":34,"tag":1382,"props":8537,"children":8538},{},[8539],{"type":40,"value":1521},{"type":34,"tag":1382,"props":8541,"children":8542},{},[8543],{"type":40,"value":1526},{"type":34,"tag":1382,"props":8545,"children":8546},{},[8547],{"type":40,"value":1531},{"type":34,"tag":1382,"props":8549,"children":8550},{},[8551],{"type":40,"value":1536},{"type":34,"tag":1350,"props":8553,"children":8554},{},[8555,8559,8563,8567],{"type":34,"tag":1382,"props":8556,"children":8557},{},[8558],{"type":40,"value":1544},{"type":34,"tag":1382,"props":8560,"children":8561},{},[8562],{"type":40,"value":1526},{"type":34,"tag":1382,"props":8564,"children":8565},{},[8566],{"type":40,"value":1553},{"type":34,"tag":1382,"props":8568,"children":8569},{},[8570],{"type":40,"value":1536},{"type":34,"tag":1350,"props":8572,"children":8573},{},[8574,8578,8582,8586],{"type":34,"tag":1382,"props":8575,"children":8576},{},[8577],{"type":40,"value":1565},{"type":34,"tag":1382,"props":8579,"children":8580},{},[8581],{"type":40,"value":1570},{"type":34,"tag":1382,"props":8583,"children":8584},{},[8585],{"type":40,"value":1575},{"type":34,"tag":1382,"props":8587,"children":8588},{},[8589],{"type":34,"tag":62,"props":8590,"children":8591},{},[8592],{"type":40,"value":1583},{"type":34,"tag":1350,"props":8594,"children":8595},{},[8596,8600,8604,8608],{"type":34,"tag":1382,"props":8597,"children":8598},{},[8599],{"type":40,"value":1591},{"type":34,"tag":1382,"props":8601,"children":8602},{},[8603],{"type":40,"value":1526},{"type":34,"tag":1382,"props":8605,"children":8606},{},[8607],{"type":40,"value":1600},{"type":34,"tag":1382,"props":8609,"children":8610},{},[8611],{"type":40,"value":1536},{"type":34,"tag":176,"props":8613,"children":8614},{"id":1607},[8615],{"type":40,"value":1610},{"type":34,"tag":1342,"props":8617,"children":8618},{},[8619,8637],{"type":34,"tag":1346,"props":8620,"children":8621},{},[8622],{"type":34,"tag":1350,"props":8623,"children":8624},{},[8625,8629,8633],{"type":34,"tag":1354,"props":8626,"children":8627},{},[8628],{"type":40,"value":1358},{"type":34,"tag":1354,"props":8630,"children":8631},{},[8632],{"type":40,"value":1363},{"type":34,"tag":1354,"props":8634,"children":8635},{},[8636],{"type":40,"value":1368},{"type":34,"tag":1375,"props":8638,"children":8639},{},[8640,8655,8670,8685],{"type":34,"tag":1350,"props":8641,"children":8642},{},[8643,8647,8651],{"type":34,"tag":1382,"props":8644,"children":8645},{},[8646],{"type":40,"value":1642},{"type":34,"tag":1382,"props":8648,"children":8649},{},[8650],{"type":40,"value":1647},{"type":34,"tag":1382,"props":8652,"children":8653},{},[8654],{"type":40,"value":1652},{"type":34,"tag":1350,"props":8656,"children":8657},{},[8658,8662,8666],{"type":34,"tag":1382,"props":8659,"children":8660},{},[8661],{"type":40,"value":1660},{"type":34,"tag":1382,"props":8663,"children":8664},{},[8665],{"type":40,"value":1526},{"type":34,"tag":1382,"props":8667,"children":8668},{},[8669],{"type":40,"value":1669},{"type":34,"tag":1350,"props":8671,"children":8672},{},[8673,8677,8681],{"type":34,"tag":1382,"props":8674,"children":8675},{},[8676],{"type":40,"value":1677},{"type":34,"tag":1382,"props":8678,"children":8679},{},[8680],{"type":40,"value":1682},{"type":34,"tag":1382,"props":8682,"children":8683},{},[8684],{"type":40,"value":1687},{"type":34,"tag":1350,"props":8686,"children":8687},{},[8688,8692,8696],{"type":34,"tag":1382,"props":8689,"children":8690},{},[8691],{"type":40,"value":1695},{"type":34,"tag":1382,"props":8693,"children":8694},{},[8695],{"type":40,"value":1700},{"type":34,"tag":1382,"props":8697,"children":8698},{},[8699],{"type":40,"value":1705},{"type":34,"tag":35,"props":8701,"children":8702},{"id":1708},[8703],{"type":40,"value":1711},{"type":34,"tag":43,"props":8705,"children":8706},{},[8707,8711],{"type":34,"tag":62,"props":8708,"children":8709},{},[8710],{"type":40,"value":1719},{"type":40,"value":1721},{"type":34,"tag":43,"props":8713,"children":8714},{},[8715,8719],{"type":34,"tag":62,"props":8716,"children":8717},{},[8718],{"type":40,"value":1729},{"type":40,"value":1731},{"type":34,"tag":43,"props":8721,"children":8722},{},[8723,8727],{"type":34,"tag":62,"props":8724,"children":8725},{},[8726],{"type":40,"value":1739},{"type":40,"value":1741},{"type":34,"tag":43,"props":8729,"children":8730},{},[8731],{"type":40,"value":1746},{"type":34,"tag":1748,"props":8733,"children":8734},{},[8735],{"type":40,"value":1752},{"title":7,"searchDepth":278,"depth":278,"links":8737},[8738,8739,8740,8744,8749],{"id":37,"depth":212,"text":41},{"id":101,"depth":212,"text":104},{"id":171,"depth":212,"text":174,"children":8741},[8742,8743],{"id":178,"depth":278,"text":181},{"id":949,"depth":278,"text":952},{"id":1326,"depth":212,"text":1329,"children":8745},[8746,8747,8748],{"id":1337,"depth":278,"text":1340},{"id":1482,"depth":278,"text":1485},{"id":1607,"depth":278,"text":1610},{"id":1708,"depth":212,"text":1711},1777018791120]