<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Backend on Osmar Petry</title><link>https://osmarpetry.dev/tags/backend/</link><description>Recent content in Backend on Osmar Petry</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 01 Sep 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://osmarpetry.dev/tags/backend/rss.xml" rel="self" type="application/rss+xml"/><item><title>Backend Architectures — history, case studies &amp; dogfooding</title><link>https://osmarpetry.dev/blog/introduction-to-be-archtitectures/</link><pubDate>Mon, 01 Sep 2025 00:00:00 +0000</pubDate><guid>https://osmarpetry.dev/blog/introduction-to-be-archtitectures/</guid><description>&lt;h2 id="summary"&gt;Summary&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Know the &lt;strong&gt;history&lt;/strong&gt; (monolith → services → serverless) to choose the &lt;strong&gt;right shape for now&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;li&gt;Use &lt;strong&gt;dogfooding&lt;/strong&gt; to turn internal capabilities into &lt;strong&gt;platforms&lt;/strong&gt; and eventually &lt;strong&gt;products&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;li&gt;Pair &lt;strong&gt;tech + finance&lt;/strong&gt; on every decision so architecture choices have a clear &lt;strong&gt;P&amp;amp;L story&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="case-studies-what-they-did--why-it-mattered"&gt;Case studies (what they did → why it mattered)&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Amazon&lt;/strong&gt;: built infra &amp;amp; tooling for itself first (&lt;strong&gt;dogfood&lt;/strong&gt;) → later externalized as &lt;strong&gt;AWS&lt;/strong&gt; (new revenue, 2× monetization of the same effort).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Netflix&lt;/strong&gt;: &lt;strong&gt;hybrid&lt;/strong&gt; of microservices + serverless; serverless for bursty/edge workloads, services for core domains → &lt;strong&gt;speed + cost control&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Google&lt;/strong&gt;: evolved from large coordinated monoliths to &lt;strong&gt;microservices&lt;/strong&gt; as scale/teams grew → &lt;strong&gt;independent deploys&lt;/strong&gt; and &lt;strong&gt;targeted reliability&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Uber&lt;/strong&gt;: reused &lt;strong&gt;profile, payments, geo, notifications&lt;/strong&gt; to launch &lt;strong&gt;Eats&lt;/strong&gt; quickly → &lt;strong&gt;time-to-market&lt;/strong&gt; by reusing platform primitives.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="decision-heuristics-when-to-pick-what"&gt;Decision heuristics (when to pick what)&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Monolith first&lt;/strong&gt; when the team is small, domain still moving, and you need &lt;strong&gt;velocity&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Split by domain&lt;/strong&gt; (bounded contexts) when teams block each other and deploys become risky.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Serverless&lt;/strong&gt; for event-driven, spiky, or edge tasks where &lt;strong&gt;operational burden&lt;/strong&gt; must be minimal.&lt;/li&gt;&#10;&lt;li&gt;Always design for &lt;strong&gt;observability&lt;/strong&gt; (logs/metrics/traces) and &lt;strong&gt;clear failure domains&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="dogfooding--productization-loop"&gt;Dogfooding → productization loop&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&lt;strong&gt;Build&lt;/strong&gt; the capability you need (internal API/service).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Harden&lt;/strong&gt; with SLOs, docs, dashboards.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Reuse&lt;/strong&gt; across 2–3 internal products (prove generality).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Abstract&lt;/strong&gt; contracts (versioning, quotas, cost model).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Externalize&lt;/strong&gt; (SDKs, billing, support) when economics are clear.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;&lt;strong&gt;Two-sided payoff:&lt;/strong&gt; internal reuse lowers &lt;strong&gt;cost/time&lt;/strong&gt;, externalization creates &lt;strong&gt;revenue&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Modularization Criteria — Parnas 1972</title><link>https://osmarpetry.dev/blog/parnas-modularization-1972/</link><pubDate>Tue, 15 Apr 2025 00:00:00 +0000</pubDate><guid>https://osmarpetry.dev/blog/parnas-modularization-1972/</guid><description>&lt;h2 id="abstract"&gt;Abstract&lt;/h2&gt;&#10;&lt;p&gt;David L. Parnas (1972) proposed information hiding as the primary criterion for modular design, using the KWIC (Key Word In Context) system to compare traditional flow-based modularization vs encapsulating design decisions. His approach yields systems that are easier to modify, maintain, and evolve.&lt;/p&gt;&#10;&lt;h2 id="key-points"&gt;Key points&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Traditional modularization (aligned with processing steps) leads to high coupling and brittle systems.&lt;/li&gt;&#10;&lt;li&gt;Information hiding: modules encapsulate design decisions (data structures, algorithms, storage formats).&lt;/li&gt;&#10;&lt;li&gt;KWIC case study: conventional design (5 modules aligned with processing sequence) vs information-hiding design (4 modules for storage, circular shift generation, sorting, output).&lt;/li&gt;&#10;&lt;li&gt;Benefits: localized changes, clear responsibilities, replaceable internals without breaking clients.&lt;/li&gt;&#10;&lt;li&gt;Trade-off: potential performance overhead due to inter-module communication; can be mitigated via inlining and efficient call mechanisms.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="connections"&gt;Connections&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Precursor to object-oriented encapsulation and modern modular design.&lt;/li&gt;&#10;&lt;li&gt;Supports microservices and DDD bounded context thinking.&lt;/li&gt;&#10;&lt;li&gt;Relates to clean architecture and low coupling principles.&lt;/li&gt;&#10;&lt;li&gt;Anticipates interface contracts in modern API design.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="questions"&gt;Questions&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;How to apply information hiding in fast-paced agile projects?&lt;/li&gt;&#10;&lt;li&gt;Which metrics can quantify effective information hiding?&lt;/li&gt;&#10;&lt;li&gt;How to balance encapsulation with performance in real-time systems?&lt;/li&gt;&#10;&lt;li&gt;Applicability to distributed architectures?&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="personal-reflections"&gt;Personal reflections&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Encapsulating design decisions prevents leakage of implementation details across layers.&lt;/li&gt;&#10;&lt;li&gt;KWIC example illustrates how storage strategies can remain swappable with proper abstraction.&lt;/li&gt;&#10;&lt;li&gt;Critique of flow-based modularization still relevant for ETL/data pipeline architectures.&lt;/li&gt;&#10;&lt;li&gt;Stable interfaces support DevOps pipelines and isolate testing concerns.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="references"&gt;References&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Parnas, D. L. (1972). &lt;em&gt;On the Criteria To Be Used in Decomposing Systems into Modules&lt;/em&gt;. Communications of the ACM, 15(12), 1053-1058.&lt;/li&gt;&#10;&lt;li&gt;Modern commentary: &lt;a href="https://www.refact0r.dev/blog/module-criteria" target="_blank" rel="noreferrer"&gt;https://www.refact0r.dev/blog/module-criteria&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="related-notes"&gt;Related Notes&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;[[conways-law-birth-1968|Conway’s Law — origins, literature, and team design]]&lt;/li&gt;&#10;&lt;li&gt;[[DbC|Design by Contract]]&lt;/li&gt;&#10;&lt;li&gt;[[no-silver-bullet-1986|No Silver Bullet — Essence &amp;amp; Accidents]]&lt;/li&gt;&#10;&lt;li&gt;[[software-aging-1994|Software Aging]]&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Master’s Article Summaries</title><link>https://osmarpetry.dev/blog/masters-article-summaries/</link><pubDate>Wed, 04 Sep 2024 00:00:00 +0000</pubDate><guid>https://osmarpetry.dev/blog/masters-article-summaries/</guid><description>&lt;h2 id="tldr"&gt;TL;DR&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Replay attacks remain the easiest ASV spoofing vector; DL-RAD, autoencoders + Siamese networks, and CQCC features significantly improve detection.&lt;/li&gt;&#10;&lt;li&gt;ASVspoof 2021 pushes detection into real-world, noisy settings requiring domain generalisation.&lt;/li&gt;&#10;&lt;li&gt;Remote sensing (NEON/NIST) mirrors the need for multi-source data fusion—hyperspectral, LiDAR, RGB—for ecological insights.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="spied-articles"&gt;SPIED articles&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Ren et al. — Replay attack detection via loudspeaker distortion (DL-RAD).&lt;/li&gt;&#10;&lt;li&gt;ASVspoof 2021 — Spoofed/deepfake speech detection in the wild.&lt;/li&gt;&#10;&lt;li&gt;NIST DSE — Plant identification with airborne remote sensing.&lt;/li&gt;&#10;&lt;li&gt;Adiban et al. — Autoencoder + Siamese countermeasures on ASVspoof 2019.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="context"&gt;Context&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Consolidated notes from 4 September 2024 research sprint.&lt;/li&gt;&#10;&lt;li&gt;Focus: voice authentication security (spoofing/deepfake) and ecological remote sensing.&lt;/li&gt;&#10;&lt;li&gt;Supporting docs: ZIP archive with slides/text; online share for extended summaries.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="1-replay-attack-detection-based-on-distortion-by-loudspeaker"&gt;1. Replay Attack Detection Based on Distortion by Loudspeaker&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Source&lt;/strong&gt;: Ren et al., &lt;em&gt;Multimedia Tools and Applications&lt;/em&gt;, 2019. DOI: 10.1007/s11042-018-6834-3.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: DL-RAD detects replay attacks by analysing loudspeaker-induced distortions (low-frequency attenuation, harmonic energy).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Highlights&lt;/strong&gt;: Harmonic Energy Ratio, Low Spectral Variance. Achieves &amp;gt;98% detection accuracy.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Application&lt;/strong&gt;: voice authentication systems (mobile, banking). Focus on dependable feature extraction.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Reflection&lt;/strong&gt;: Consider how speaker hardware signatures can serve as anti-spoof signals.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="2-asvspoof-2021-deepfake-speech-detection-in-the-wild"&gt;2. ASVspoof 2021: Deepfake Speech Detection in the Wild&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Source&lt;/strong&gt;: ASVspoof 2021 challenge; TASLP 2023 paper (DOI: 10.1109/TASLP.2023.3285283).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: Evaluates spoofed/deepfake detection in noisy, uncontrolled environments; introduces large-scale dataset.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Highlights&lt;/strong&gt;: Variance across capture devices, environmental noise; combination of spectrogram analysis and deep models.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Application&lt;/strong&gt;: deploy robust detectors for real-world ASV systems, banking, call centers.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Reflection&lt;/strong&gt;: emphasises the need for adaptive models and domain generalization.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="3-nist-dse-plant-identification-with-remote-sensing"&gt;3. NIST DSE Plant Identification with Remote Sensing&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Source&lt;/strong&gt;: NIST publication on airborne remote sensing data challenge.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: Integrates hyperspectral, LiDAR, RGB data to segment tree crowns, align field data, classify species.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Highlights&lt;/strong&gt;: data fusion, scaling ecological monitoring, addressing heterogeneous resolutions.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Application&lt;/strong&gt;: environmental monitoring, conservation, precision agriculture.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Reflection&lt;/strong&gt;: parallels with multi-modal data integration in other domains (e.g., security sensors).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="4-replay-spoofing-countermeasure-using-autoencoder--siamese-networks-asvspoof-2019"&gt;4. Replay Spoofing Countermeasure Using Autoencoder &amp;amp; Siamese Networks (ASVspoof 2019)&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Source&lt;/strong&gt;: Adiban et al., &lt;em&gt;Computer Speech &amp;amp; Language&lt;/em&gt;, 2020. DOI: 10.1016/j.csl.2020.101105.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: Combines autoencoders (denoising) with Siamese networks (similarity) to detect replay attacks.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Highlights&lt;/strong&gt;: CQCC features, improved EER by 10.73%, t-DCF drop of 0.2344.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Application&lt;/strong&gt;: mobile authentication, payment systems, secure access.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Reflection&lt;/strong&gt;: underscores the power of hybrid feature + metric-learning approaches.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="supporting-docs"&gt;Supporting Docs&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Comparative notes across TXT/PPTX/Google Docs for detailed methodology.&lt;/li&gt;&#10;&lt;li&gt;Extended definitions (CQCC, EER, t-DCF) stored in local dictionary.&lt;/li&gt;&#10;&lt;li&gt;Presentations (March 25) outline challenge evolutions and future work.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="next-steps"&gt;Next steps&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Investigate combined defenses against multi-modal spoofing (synthetic + replay).&lt;/li&gt;&#10;&lt;li&gt;Explore edge deployment viability for real-time detection.&lt;/li&gt;&#10;&lt;li&gt;Compare ecological data pipelines with security workflows for cross-domain insights.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item></channel></rss>