{"id":537,"date":"2026-08-18T15:52:29","date_gmt":"2026-08-18T07:52:29","guid":{"rendered":"https:\/\/dangnh.cf\/work\/lab-results-microservices-migration\/"},"modified":"2026-08-18T15:52:29","modified_gmt":"2026-08-18T07:52:29","slug":"lab-results-microservices-migration","status":"publish","type":"page","link":"https:\/\/dangnh.cf\/vi\/work\/lab-results-microservices-migration\/","title":{"rendered":"Cutting a clinical lab results pipeline from 3 hours to 3 minutes"},"content":{"rendered":"<p class=\"wp-block-paragraph\"><em>Lead Backend Developer \u00b7 Diag Laboratories \u00b7 Dec 2020 \u2013 May 2024 \u00b7 Team of 15<\/em><\/p>\n\n<h2 class=\"wp-block-heading\">The problem<\/h2>\n<p class=\"wp-block-paragraph\">Diag Laboratories is a clinical diagnostics provider. Test results come off a variety of lab machines, get processed, and have to reach doctors and patients across both a web portal and a mobile app.<\/p>\n<p class=\"wp-block-paragraph\">That pipeline ran through a large monolith and took roughly <strong>three hours<\/strong> end to end. In diagnostics that isn&#8217;t a performance metric \u2014 it&#8217;s a patient sitting in a waiting room, or a doctor making a call without the numbers in front of them. Worse, result PDFs were sometimes generated incorrectly or went missing entirely.<\/p>\n<p class=\"wp-block-paragraph\">The obvious fix was a rewrite. The obvious problem with a rewrite is that this was a live clinical system that could not go down.<\/p>\n\n<h2 class=\"wp-block-heading\">What I built<\/h2>\n<ul class=\"wp-block-list\">\n<li><strong>Incremental migration, not a big bang.<\/strong> I led the move from monolith to microservices using a lazy migration approach \u2014 services were carved out and cut over one at a time, with the monolith still serving everything not yet migrated. No flag day, no freeze.<\/li>\n<li><strong>An event-driven results pipeline.<\/strong> Kafka to collect examination results from lab machines, orchestrate processing, and fan out to the web and mobile delivery services.<\/li>\n<li><strong>The backend from scratch.<\/strong> New services written in Laravel and Python against PostgreSQL on GCP, plus a data warehouse for reporting.<\/li>\n<li><strong>Correctness as a first-class concern.<\/strong> The PDF generation path was rebuilt and hardened, because a missing or wrong result document is a clinical problem, not a bug ticket.<\/li>\n<li><strong>Standards for a team of 15.<\/strong> I defined the coding standards and review process, and made sure they actually held across the team rather than living in a wiki nobody read.<\/li>\n<\/ul>\n\n<h2 class=\"wp-block-heading\">Result<\/h2>\n<ul class=\"wp-block-list\">\n<li>Result processing went from <strong>~3 hours to ~3 minutes<\/strong>.<\/li>\n<li><strong>100% accuracy<\/strong> in PDF generation.<\/li>\n<li><strong>99% uptime<\/strong> maintained throughout a live migration on a production clinical system.<\/li>\n<\/ul>\n\n<h2 class=\"wp-block-heading\">Stack<\/h2>\n<p class=\"wp-block-paragraph\">Laravel, Python, Kafka, PostgreSQL, GCP, microservices, data warehouse, lazy migration. Agile\/Scrum with Jira.<\/p>\n\n<h2 class=\"wp-block-heading\">If this sounds like your situation<\/h2>\n<p class=\"wp-block-paragraph\">The recurring shape here: a system that works, is too slow or too fragile, and is too important to switch off while you fix it. That&#8217;s most of the rescue work I take on. <a href=\"https:\/\/dangnh.cf\/vi\/hire-me\/\">Here&#8217;s how to reach me \u2192<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>How a monolith-to-microservices migration at a clinical diagnostics lab took result processing from about three hours to about three minutes \u2014 without taking the live system down.<\/p>","protected":false},"author":1,"featured_media":0,"parent":536,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-537","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cutting a clinical lab results pipeline from 3 hours to 3 minutes - Mark Nguyen<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dangnh.cf\/vi\/work\/lab-results-microservices-migration\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cutting a clinical lab results pipeline from 3 hours to 3 minutes - Mark Nguyen\" \/>\n<meta property=\"og:description\" content=\"How a monolith-to-microservices migration at a clinical diagnostics lab took result processing from about three hours to about three minutes \u2014 without taking the live system down.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dangnh.cf\/vi\/work\/lab-results-microservices-migration\/\" \/>\n<meta property=\"og:site_name\" content=\"Mark Nguyen\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dangtute\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 ph\u00fat\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/dangnh.cf\\\/work\\\/lab-results-microservices-migration\\\/\",\"url\":\"https:\\\/\\\/dangnh.cf\\\/work\\\/lab-results-microservices-migration\\\/\",\"name\":\"Cutting a clinical lab results pipeline from 3 hours to 3 minutes - Mark Nguyen\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dangnh.cf\\\/vi\\\/#website\"},\"datePublished\":\"2026-08-18T07:52:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/dangnh.cf\\\/work\\\/lab-results-microservices-migration\\\/#breadcrumb\"},\"inLanguage\":\"vi\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/dangnh.cf\\\/work\\\/lab-results-microservices-migration\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/dangnh.cf\\\/work\\\/lab-results-microservices-migration\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/dangnh.cf\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Work\",\"item\":\"https:\\\/\\\/dangnh.cf\\\/work\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Cutting a clinical lab results pipeline from 3 hours to 3 minutes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/dangnh.cf\\\/vi\\\/#website\",\"url\":\"https:\\\/\\\/dangnh.cf\\\/vi\\\/\",\"name\":\"Mark Nguyen\",\"description\":\"I build the e-commerce backends customers never see \u2014 payments, integrations, and AI features that actually ship.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/dangnh.cf\\\/vi\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"vi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cutting a clinical lab results pipeline from 3 hours to 3 minutes - Mark Nguyen","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dangnh.cf\/vi\/work\/lab-results-microservices-migration\/","og_locale":"vi_VN","og_type":"article","og_title":"Cutting a clinical lab results pipeline from 3 hours to 3 minutes - Mark Nguyen","og_description":"How a monolith-to-microservices migration at a clinical diagnostics lab took result processing from about three hours to about three minutes \u2014 without taking the live system down.","og_url":"https:\/\/dangnh.cf\/vi\/work\/lab-results-microservices-migration\/","og_site_name":"Mark Nguyen","article_publisher":"https:\/\/www.facebook.com\/dangtute","twitter_card":"summary_large_image","twitter_misc":{"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"2 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dangnh.cf\/work\/lab-results-microservices-migration\/","url":"https:\/\/dangnh.cf\/work\/lab-results-microservices-migration\/","name":"Cutting a clinical lab results pipeline from 3 hours to 3 minutes - Mark Nguyen","isPartOf":{"@id":"https:\/\/dangnh.cf\/vi\/#website"},"datePublished":"2026-08-18T07:52:29+00:00","breadcrumb":{"@id":"https:\/\/dangnh.cf\/work\/lab-results-microservices-migration\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dangnh.cf\/work\/lab-results-microservices-migration\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dangnh.cf\/work\/lab-results-microservices-migration\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dangnh.cf\/"},{"@type":"ListItem","position":2,"name":"Work","item":"https:\/\/dangnh.cf\/work\/"},{"@type":"ListItem","position":3,"name":"Cutting a clinical lab results pipeline from 3 hours to 3 minutes"}]},{"@type":"WebSite","@id":"https:\/\/dangnh.cf\/vi\/#website","url":"https:\/\/dangnh.cf\/vi\/","name":"Mark Nguyen","description":"I build the e-commerce backends customers never see \u2014 payments, integrations, and AI features that actually ship.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dangnh.cf\/vi\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"}]}},"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P9w3NP-8F","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":536,"url":"https:\/\/dangnh.cf\/vi\/work\/","url_meta":{"origin":537,"position":0},"title":"Work","author":"admin","date":"Th\u00e1ng 8 18, 2026","format":false,"excerpt":"Three projects in detail: a clinical lab results platform, a multi-tenant AI translation backend, and a multi-marketplace e-commerce suite.","rel":"","context":"B\u00e0i t\u01b0\u01a1ng t\u1ef1","block_context":{"text":"B\u00e0i t\u01b0\u01a1ng t\u1ef1","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":531,"url":"https:\/\/dangnh.cf\/vi\/hire-me\/","url_meta":{"origin":537,"position":1},"title":"Hire Me","author":"admin","date":"Th\u00e1ng 8 18, 2026","format":false,"excerpt":"I build e-commerce backends, payment and marketplace integrations, and AI features for apps that already have users. 13+ years, Shopware and Laravel.","rel":"","context":"B\u00e0i t\u01b0\u01a1ng t\u1ef1","block_context":{"text":"B\u00e0i t\u01b0\u01a1ng t\u1ef1","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10,"url":"https:\/\/dangnh.cf\/vi\/about-2\/","url_meta":{"origin":537,"position":2},"title":"About","author":"admin","date":"Th\u00e1ng 4 5, 2016","format":false,"excerpt":"Senior fullstack engineer in Ho Chi Minh City. 13+ years on e-commerce backends, payments, and AI integration \u2014 currently forward-deployed with Shopware.","rel":"","context":"B\u00e0i t\u01b0\u01a1ng t\u1ef1","block_context":{"text":"B\u00e0i t\u01b0\u01a1ng t\u1ef1","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/dangnh.cf\/vi\/wp-json\/wp\/v2\/pages\/537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dangnh.cf\/vi\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dangnh.cf\/vi\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dangnh.cf\/vi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dangnh.cf\/vi\/wp-json\/wp\/v2\/comments?post=537"}],"version-history":[{"count":0,"href":"https:\/\/dangnh.cf\/vi\/wp-json\/wp\/v2\/pages\/537\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/dangnh.cf\/vi\/wp-json\/wp\/v2\/pages\/536"}],"wp:attachment":[{"href":"https:\/\/dangnh.cf\/vi\/wp-json\/wp\/v2\/media?parent=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}