<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by fariz mamad on Medium]]></title>
        <description><![CDATA[Stories by fariz mamad on Medium]]></description>
        <link>https://medium.com/@farizmamad?source=rss-5799f7a130aa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*KhS27XB7PXOzrhS42LZU-A.jpeg</url>
            <title>Stories by fariz mamad on Medium</title>
            <link>https://medium.com/@farizmamad?source=rss-5799f7a130aa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 00:05:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@farizmamad/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Shared Knowledge Base menuju AI-Native Teamwork]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://farizmamad.medium.com/shared-knowledge-base-menuju-ai-native-teamwork-6b3566cd9992?source=rss-5799f7a130aa------2"><img src="https://cdn-images-1.medium.com/max/2438/1*RCHWiG0GSYyBaC9QF_jSpA.png" width="2438"></a></p><p class="medium-feed-snippet">Bagi non-member, baca di sini.</p><p class="medium-feed-link"><a href="https://farizmamad.medium.com/shared-knowledge-base-menuju-ai-native-teamwork-6b3566cd9992?source=rss-5799f7a130aa------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://farizmamad.medium.com/shared-knowledge-base-menuju-ai-native-teamwork-6b3566cd9992?source=rss-5799f7a130aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b3566cd9992</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[engineering-management]]></category>
            <dc:creator><![CDATA[fariz mamad]]></dc:creator>
            <pubDate>Fri, 11 Sep 2026 08:36:40 GMT</pubDate>
            <atom:updated>2026-09-11T12:05:33.668Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Built an AI Organization to Manage My Life]]></title>
            <link>https://farizmamad.medium.com/i-built-an-ai-organization-to-manage-my-life-6eca20bb6fa6?source=rss-5799f7a130aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/6eca20bb6fa6</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[fariz mamad]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 01:58:03 GMT</pubDate>
            <atom:updated>2026-06-22T01:58:03.224Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>I almost fired my AI agent. Instead, I rewrote it three times, changed the architecture, and learnt meaningful lessons</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NHt5QdqFXwdr4viLzWgwJw.jpeg" /><figcaption>Photo by<a href="https://unsplash.com/@proggga?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText"> Mikhail Fesenko</a> on<a href="https://unsplash.com/photos/a-man-sitting-in-front-of-a-computer-on-a-desk-KniBt27bEsc?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText"> Unsplash</a></figcaption></figure><h3>Introduction</h3><h4>I A<strong>lmost</strong> F<strong>ired</strong> my AI Agent.</h4><p>Not in the dramatic “this technology is useless” way. More like the tired, 11pm-on-a-weekday way, where you’ve stared at the same problem for two hours and the thing you built to help you is making it worse.</p><p>I had asked my agent to audit the architecture of a system I was building. It produced a thorough, detailed response. Too detailed. The output string was so long it got truncated. In the next message, I asked it to continue. It started the audit over. I corrected it. It apologized and started the audit over again. The word “AUDIT” appeared in seven consecutive messages.</p><h4>We Were <strong>in a Loop</strong></h4><p>That night, I stopped trying to fix the prompt and started asking a different question: <strong>why doesn’t it understand me?</strong></p><p>Not the technical “why did it loop”. Something bigger. I’d been using this agent for months. I’d told it about my mortgage, my career goals, my code, my financial targets. It knew everything about me. And somehow, knowing everything was making it worse. It would answer an engineering question with financial risk-framing. It would think about tradeoffs the way our finance conversations had trained it to, not the way engineering problems require.</p><p>The more context I gave it, the more its understanding of me blurred. It wasn’t getting smarter about who I was.<strong> It was getting confused</strong>.</p><p>So why? Why was its knowledge of me bleeding together like this?</p><h3>Hypothesis: Multi-Agent instead of Single Agent</h3><p>The problem was structural. One context window. One session history. Every conversation: mortgages, code, career decisions; accumulating in the same place. There was no separation. No “finance mode” and “engineering mode.” Just everything mixed together, and the agent doing its best to make sense of the noise.</p><p>I wasn’t dealing with a prompt problem. I was dealing with an architecture problem. One agent, one context, multiple domains. That’s not something you tune your way out of.</p><p>My hypothesis is <strong>one agent was never going to be enough for what I was trying to do.</strong></p><p>If you’ve read Prastya’s breakdown of what lives inside an AI agent gateway [1] and Setiawan’s reflection on giving an agent structured memory [2], my recent work picks up from there: <strong>what happens when you build a full organization of agents, run it for real, and watch the seams show</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJI7DNVnUm73afDn5jodtw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@chriscreations__?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Christian Agbede</a> on <a href="https://unsplash.com/photos/two-people-silhouetted-talking-by-a-window-overlooking-ocean-fhTc9n1FHMM?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h4>Context Lost In the Middle</h4><p>My conversation with the agent is split across four domains that don’t talk to each other well in a long window span.</p><p><strong>Career</strong>: I work as a software engineer at a startup, trying to grow into an engineering leadership role. <strong>Finance</strong>: a mortgage, an emergency fund in progress, investment decisions, kids’ education savings. <strong>Research</strong>: AI organization systems, a publication goal, a PhD application in progress. <strong>Product</strong>: side project with monthly active users expected.</p><p>When I talked to my agent about my mortgage situation on Monday, and then asked it to do code review on Wednesday, it would <strong>sometimes blend the two</strong>. Answering a Python question with references to my financial goals, or vice versa. This sounds like a small annoyance, but it <strong>compounds</strong>. An agent that doesn’t have clean domain separation doesn’t just give slightly off answers. It builds <strong>a contaminated internal model</strong> of what you’re working on.</p><p>The research literature agrees. Liu et al. [3] showed that <strong>LLM performance degrades significantly on tasks that require retrieving information from the middle of long contexts</strong>. The further your relevant context is trapped in the middle, the more likely the model forgets it or misweights it. For a single agent managing multiple long-running domains, this is a structural problem, not a model limitation.</p><p>My take is: A single AI assistant conversation thread <strong>cannot hold all of different domain contexts</strong> without something breaking.</p><h4>Role Isolation Problem</h4><p>But there’s a second problem that failure will lead to domain bleeding, <strong>role isolation</strong>.</p><p>When I asked my single agent to “think like an engineer,” it would, until a financial topic came up. Then it shifted register to think like a financial advisor. When I asked it to “think like a CEO,” it would produce strategic output, but if I’d been talking about code for the last hour, there was always a residue. The agent defaulted to the domain it had most recently inhabited.</p><p>This is a failure of role isolation. And it matters more than it sounds, because good analysis in one domain often requires deliberately not thinking in another’s terms.</p><h3>Introducing Multi-Agent Three Failure Modes</h3><p>When I finally decided to move from a single agent to a multi-agent system, I wasn’t chasing a trend. I had three specific failure modes I needed to solve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*00LwoGWWhl7gDleovlJyPA.png" /><figcaption>Failure Modes of Multi-agent</figcaption></figure><h4>Failure Mode 1: Context Overflow, State Loss, Looping</h4><p>The “AUDIT” incident is the cleanest example. A long output gets truncated. The model loses its place. The next message restarts from incomplete premises. I repair it. It restarts again.</p><p>I am in a loop that is about statelessness.</p><p>The fix should be session continuity across messages, and a runner that doesn’t keep feeding an ever-growing context window.</p><h4>Failure Mode 2: Task Assignment Without Durable State</h4><p>Multi-domain life means multi-domain work. Sometimes I want the “CEO” part of my thinking to assign a research task to the “engineer” part. In a single-agent world, I’d say “okay, remember to analyze X later.” It would nod. Then the next session would start fresh, and X would be forgotten.</p><p>There was no persistent task queue. No acknowledgment that a handoff had happened. Just a conversation that reset.</p><p>Think of it as delegating via sticky note, but the sticky note is attached to a whiteboard that gets erased every morning.</p><h4>Failure Mode 3: Domain Bleeding</h4><p>When I asked the same agent to handle both my financial planning and my engineering decisions, it developed habits from both contexts simultaneously. Questions about system design would come back with risk-framing borrowed from investment thinking. Questions about savings would come back with technical precision that missed the emotional dimension.</p><p>It’s a memory boundary problem. The agent had no clean separation between “what I know about this user’s finances” and “what I know about this user’s code.”</p><h3>Faith: The Mental Model</h3><p>The system I built is called <strong>Faith</strong>. I named it “Faith” because I trust my agents to help me navigate this life. It’s an AI organization, a multi-agent system where each agent plays an organizational role.</p><p>The organizational metaphor is more than aesthetic. Simon [4] argued that organizations function by partitioning decision-making into bounded roles. Each actor optimizes within their jurisdiction, not across the whole system. The same principle applies here: Finance thinks like Finance; it doesn’t need to understand deeply what Engineer is building, and it shouldn’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xIcANH0NfBNjVQtKup1sZw.png" /><figcaption>The Owner mainly talks to the CEO. Owner can also talk directly to other agents</figcaption></figure><p><strong>Each agent lives in its own Discord channel</strong>. I can directly send messages to Faith, in which my intention will be scored by the CEO so then it can route to the most relevant agent. When I talk to #engineer, I’m talking to the Engineering agent. When I talk to #finance, I’m talking to Finance. The CEO agent is the only one that coordinates across the others.</p><p>This is deliberate. In an actual organization, you don’t want every team member in every conversation. You route.</p><h4>The Brain</h4><p>The most important architectural decision was how agents share information.</p><p>The naive answer is “shared conversation history.” The problem is that it recreates the context pollution problem at the multi-agent level.</p><p>Baddeley [5] reviewed the concept of working memory which proposes a system to maintain and store information in the short term. He said that the working memory consists of a central executive and storage systems. Park et al. showed that agents with episodic memory behave more consistently over time [6].</p><p>I then adopt Setiawan’s [2] <strong>4 sehat 5 sempurna </strong>brain design consisting of 4 layers: <strong>Working Memory, Short-term Memory, Long-term Memory, Episodic Memory</strong>; and add 1 booster: <strong>Semantic Memory</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mGdFZutKmp18JAf5CxCqWQ.png" /><figcaption>Five layers of Faith’s Brain Memory</figcaption></figure><p><strong>Faith’s Brain</strong> borrows these insights and extends it across five layers, each serving a different time horizon: <strong>Short-term Memory, Long-term Memory, Episodic Memory, Semantic Memory, and Daily Logs</strong>. If you are wondering why it doesn’t have Working Memory: this assembly process is, in effect, Faith’s working memory. It is constructed fresh each time an agent is called, active only during that invocation, and gone the moment it ends. Look at the examples of each layer.</p><ol><li>SHORT-TERM MEMORY: 24h TTL, per-session turns. e.g. “user asked about pros and cons of taking PhD in 2026 considering his 360 condition in this session”.</li><li>LONG-TERM MEMORY: Persistent facts. Namespace + key unique. Supports private:{agent_id}, shared, and cross:{a}:{b} namespaces. e.g. “Debt outstanding: Rp X Billion, fixed installment until year Y”.</li><li>EPISODIC MEMORY: Audit trail of events, decisions, deliverables — tagged per agent. e.g. “User decided to launch the product on May 22nd”.</li><li>SEMANTIC MEMORY: Full-text knowledge base. Hybrid search via BM25 + TF-IDF + Trigram, merged with Reciprocal Rank Fusion (RRF). e.g. research notes, architecture docs, articles.</li><li>GOALS: Goal registry with complexity field. complex goals dispatch to Claude Code runner; routine goals stay in-process.</li><li>DAILY LOGS: date-stamped journal per agent. e.g. “CEO: reviewed finance goals, flagged goals gap”.</li></ol><p>The assembly of working memory runs 5 retrieval operations, then concatenate the results. I named it “prepare_context” method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4e1e87fd44d013a4744087a0157a78d5/href">https://medium.com/media/4e1e87fd44d013a4744087a0157a78d5/href</a></iframe><p>On the other hand, the namespace design enforces the memory boundary I was missing:</p><pre>- private:{agent_id}: only that agent can read or write<br>- shared: readable and writable by all agents<br>- cross:{agent_a}:{agent_b}: bilateral channel, for cross-agent handoffs</pre><p>This means Finance can’t accidentally read Engineer’s context. CEO can write to shared. Engineer reads shared for task assignments.</p><p><strong>The Brain runs as a FastAPI service over SQLite</strong>, <strong>with WAL mode</strong> for concurrent reads.</p><h4>MCP Server on Top of Brain</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eIRZanx2TmbmxKjU5G_gVg.png" /></figure><p>Every agent in Faith needs access to the same shared memory. They need to remember facts, record decisions, search knowledge, and track goals. The challenge: Faith runs two fundamentally different types of agents.</p><p>Claude API agents run inside the Python process. They call Brain functions directly. Zero overhead, no network hop. Claude Code agents run as a separate CLI subprocess inside a Docker sidecar. They can’t import Python, can’t call functions, can’t touch shared memory at all, unless there’s a bridge.</p><p>That bridge is the MCP server. Every agent out-of-process makes HTTP calls to Brain rather than accessing the database directly. This keeps write conflicts impossible: single writer, multiple readers.</p><h4>The Runner</h4><p>Initially, I designed a two-runner system. The reason was different agents need different capabilities. CEO, Engineer, and Product need to read files, run commands, search the web. Finance, Operations, Marketing, Sales mostly analyze text and write responses. Running Claude Code CLI for roles that don’t need agentic tools felt wasteful because the Node.js runtime adds ~540MB per instance.</p><p>So the early version split by capability:</p><ol><li>CEO / Engineer / Product → Claude Code CLI</li><li>Finance / Ops / Marketing / Sales → Claude API</li></ol><p>It worked. But as the system matured, the split created a subtler problem: <strong>agents on Claude API couldn’t resume sessions the same way</strong>. They didn’t benefit from the same session continuity. Debugging them required two different mental models. And as Faith’s autonomy grew, with proactive cron dispatching tasks to any agent, the capability split started to feel like a maintenance liability rather than a genuine architectural feature.</p><p>The decision was to <strong>standardize on Claude Code CLI for every agent</strong>. The memory overhead is real, but uniformity wins. All seven agents now route through the same claude-runner sidecar. Every agent has the same session continuity, the same tool access, and the same debugging surface.</p><p><strong>The sidecar is a FastAPI container</strong> (claude-runner) that wraps “<strong>claude -p — output-format json</strong>”. Faith calls it over HTTP. This means the Claude runner can be updated independently, no Faith rebuild needed.</p><h4>Session Continuity</h4><p>The AUDIT loop happened because the agent had no memory of what it had already done.</p><p>The fix: every time an agent responds, Faith stores the session_id in Brain. On the next message to that agent, Faith passes “- - resume {session_id}” to Claude Code CLI. The conversation continues exactly where it left off.</p><p>If the session has expired (Claude’s session TTL), Faith falls back to a new session gracefully. I see no crash, just a clean restart with the most recent Brain context injected.</p><h4>The Measurement</h4><p>Running an AI organization means running production software. And production software needs metrics.</p><p>The practical need was simple: <strong>Claude API calls cost money. Claude Code Runner burns the token.</strong> Different agents have different footprints. I wanted to know where the cost was going. But as I built it out, the metrics became something more useful than cost tracking.</p><p>There are four things worth measuring per agent turn:</p><ol><li>Tokens: not just total, but split by type: input, output, cache writes, cache reads</li><li>Requests: total, split by outcome: success, rate-limited, error</li><li>Latency: end-to-end wall clock per agent turn</li><li>Cost: estimated USD, accumulated as a counter</li></ol><p>The token type split is the most important one. Claude caches repeated content across calls: system prompts, injected memory blocks, any text that stays stable between invocations. <strong>cache_read tokens are priced at roughly 10× less than fresh input tokens</strong>. Watching the ratio of cache reads to fresh inputs tells you <strong>whether your memory injection strategy is actually reducing your bill, or just making every prompt larger</strong>.</p><p>Now you can ask:</p><ol><li>which agent benefits most from caching?</li><li>Did adding more long-term memory context help or just increase cost?</li><li>Did a recent prompt change break the cache?</li></ol><p>The implementation is four Prometheus counters and a histogram:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9ba81e2ec584d7fde731d466dc88a49/href">https://medium.com/media/f9ba81e2ec584d7fde731d466dc88a49/href</a></iframe><p>Faith exposes these on :9101/metrics, scraped by VictoriaMetrics every 15 seconds, visualised in Grafana. The dashboard has six panels: total requests (24h), total tokens, cost today, p95 latency, requests per agent over time, and cumulative cost per agent. The cost panel turns yellow above $0.10 and red above $0.50.</p><h4>Human-in-the-Loop (HITL)</h4><p><strong>Some decisions shouldn’t be autonomous.</strong></p><p>Faith has a HITL queue built into the Brain: a pending_actions table. When an agent wants to take an irreversible action (push code, send an external email, restart a production service) it doesn’t execute immediately. It writes to the queue and sends me a Discord DM with full details of what it wants to do.</p><p>I type <strong>!approve {id}</strong> or <strong>!reject {id}</strong>.</p><p>I saw Santoni de Sio F and van den Hoven J [7] introducing “meaningful human control” philosophy for autonomous system where it should depends on context, norm, and moral reasons. In Faith, I determine semantic of what is my moral standings. So when it reach a point that Faith is unsure, it asks for my approval.</p><h3>How It Was Actually Built</h3><p>I built Faith in three iterations. Each one failed in an instructive way.</p><h4>Iteration 1: Single Agent + Markdown Memory</h4><p>I gave the agent access to a markdown file it could read and write. “Remember this.” “Check your notes.” It worked for simple persistence, but the memory file grew, became unstructured, and the agent started selectively ignoring parts of it.</p><p>The lesson is <strong>unstructured memory is barely better than no memory</strong>.</p><h4>Iteration 2: Multi-Agent via Claude API</h4><p>I spun up multiple API instances, each with a different system prompt defining its role. CEO, Engineer, Finance.</p><p>The AUDIT loop happened here. Context didn’t persist. The agents were role-playing in separate conversations that reset every session. When CEO tried to delegate to Engineer, it was via a message in CEO’s conversation that Engineer would never see.</p><p>The lesson is <strong>multi-agent without shared persistent state is just multiple chatbots with different personas.</strong></p><h4>Iteration 3: Brain + Claude Code Runner + Proactive Cron</h4><p>This is the latest architecture. Brain solves the memory problem. A unified Claude Code runner solves the capability problem. Proactive cron solves the autonomy problem.</p><p>The proactive cron is what makes Faith feel like a team rather than a collection of on-demand tools. Every hour, Faith checks the agent_goals table for pending tasks and dispatches them to the relevant agent, without me having to send a Discord message to trigger it.</p><p>Every day, it reviews my personal goals (career, research, financial) and sends me an update. It also flush memory to face the next day fresh.</p><h4>What the Stack Looks Like</h4><ol><li><strong>Faith</strong>: Python + Discord.py + APScheduler + FastAPI (Brain API)</li><li><strong>claude-runner:</strong> Node.js + Claude Code CLI</li><li><strong>brain.db:</strong> SQLite with WAL mode</li><li><strong>monitoring:</strong> VictoriaMetrics + Grafana</li><li><strong>deploy:</strong> Docker Compose on a single VPS</li></ol><p>Fun fact: It’s a one-person project. Not a microservices architecture with a dedicated platform team. The design choices reflect that: SQLite over Postgres, one VPS over Kubernetes, Docker Compose over Helm charts. It is enough for the current scale.</p><h3>Does It Actually Work?</h3><p>Before writing this post I wanted to check whether three specific properties actually hold in real data:</p><p>1. does a combined system prompt cost more per call than a domain isolated one? Does Brain memory degrade as it grows?</p><p>2. Do agents without memory stay on-domain when a cross-domain question arrives?</p><p>These are narrow, measurable questions; not a blanket “multi-agent is better” claim. Each comparison isolates exactly one variable; everything else is held constant.</p><p>To test this, I did benchmarking. I ran 55 static queries across 5 domains against four conditions that map to the evolution of the architecture:</p><p>A: Single agent with all 7 roles in one prompt and no persistent memory.</p><p>B: Domain-isolated agents with no memory.</p><p>C: Faith with a sparse Brain of ~28 long-term entries.</p><p>C2: Faith with a Brain that simulates two years of accumulated memory: 136 entries, 100 episodes.</p><p>All queries used a fictional persona, ran on Claude Sonnet, and domain bleeding was scored by a separate LLM judge (Claude Haiku, temperature=0).</p><p>Three results came out of it.</p><p>1. A averaged 2,424 input tokens per call versus B’s 1,243 — roughly 2× more expensive — purely from carrying six irrelevant domain definitions in every call regardless of what the query actually needed.</p><p>2. C2 (5x more Brain data than C) averaged only 10% more tokens with zero context compression triggered in either condition; each agent loads only its own namespace, so growth in one domain’s memory is invisible to every other agent.</p><p>3. The counterintuitive one: B, isolated agents without memory, had the highest domain bleeding score (0.29) while C2 had the lowest (0.17). An agent without long-term context grounding has no anchor when a cross-domain question arrives, and it drifts.</p><p>The one measurement still in progress is cross-session recall. I designed two-session queries where the second session assumes the first one’s context. A and B structurally cannot recall since they have no persistence, while C and C2 write to Brain and load from it on the next session. The metric isn’t clean yet: the keyword heuristic I used produces too many false positives to be trustworthy. I’m working on replacing it with an LLM-as-judge approach for recall quality. The architectural claim is sound; the number to back it up is still being worked out.</p><h3>Lessons and Open Problems</h3><p>You can check the imitation of Faith’s full implementation in my GitHub repository: <a href="https://github.com/farizmamad/ai-org-blueprint">https://github.com/farizmamad/ai-org-blueprint</a></p><h3>What’s actually working</h3><p>Session continuity via `- -<strong>resume</strong>` eliminated the looping problem entirely. I haven’t seen the AUDIT spiral since. The `<strong>agent_goals</strong>` table means CEO can assign a task to Engineer that gets picked up even when I’m offline; durable state made background work real. And private Brain namespaces keep Finance and Engineering genuinely separate. The domain contamination problem is gone.</p><h3>What’s still open</h3><p>Memory curation is unsolved: agents need guidance on what’s worth saving. The current rule-based approach, save after significant decisions, save episodic events, is a workaround, not a solution. At scale, policing what belongs in shared versus private namespaces becomes a governance problem. The deeper architectural gap is synchronous cross-agent dispatch: every interaction between agents today is asynchronous. CEO writes a goal to Brain, the cron picks it up. For most tasks this is fine; for time-sensitive coordination it’s a real constraint.</p><h3>When is it actually worth the complexity</h3><p>Multi-agent adds coordination overhead by design. Every handoff is a potential failure point, and keeping agents aligned on shared state requires deliberate work. My rule of thumb: if you can’t draw an org chart with at least three distinct roles that genuinely don’t need each other’s context, use a single agent. Multi-agent earns its complexity when your domains are genuinely different, your context needs are genuinely large, and you need background tasks running without your manual trigger. If you’re solving a single-domain problem, even a complex one, a well-prompted single agent with good tooling will serve you better. Don’t add agents because it sounds sophisticated. Add them when you have three sticky notes that keep getting erased.</p><h3>What Comes Next</h3><p>If you want to start building something similar, the order matters more than the stack:</p><ol><li>Build memory before building agents. A structured memory layer, even a simple namespace/key-value store, is what makes multi-agent coordination possible. Without it, you have multiple chatbots, not an organization.</li><li>Isolate one domain first. Pick the domain with the highest information volume. Get memory and session continuity working there before adding the second agent.</li><li>Add HITL before you go autonomous. The approval queue isn’t overhead. It’s what lets you trust the system enough to let it run while you’re offline.</li><li>Run proactive cron only when you have real goals to dispatch. An agent that sends you daily updates you don’t read is a signal your task structure needs work, not your agents.</li></ol><p>The gap between “AI assistant I talk to” and “AI organization that works with me” is not a capability gap. The models are already capable enough. It’s an architecture gap: in how you structure memory, isolate domains, and design handoffs.</p><h3>References</h3><p>1. Prastya, D. A. (2025). What’s Actually Inside an AI Agent Gateway. prastya.com.</p><p>2. Setiawan, B. (2025). I Gave My AI Agent a Brain — Here’s What Broke (and What I Learned). towardsdev.com.</p><p>3. Liu, N.F. et al. (2023). Lost in the Middle: How Language Models Use Long Contexts. Transactions of the Association for Computational Linguistics, 12, 157–173. <a href="https://doi.org/10.1162/tacl_a_00638">https://doi.org/10.1162/tacl_a_00638</a></p><p>4. Simon, H.A. (1947). Administrative Behavior. Macmillan.</p><p>5. Baddeley, A. (2003). Working memory: looking back and looking forward. Nature Reviews Neuroscience, 4(10), 829–839.</p><p>6. Park, J.S. et al. (2023). Generative Agents: Interactive Simulacra of Human Behavior. UIST 2023.</p><p>7. Santoni de Sio F and van den Hoven J (2018) Meaningful Human Control over Autonomous Systems: A Philosophical Account. Front. Robot. AI 5:15. doi: 10.3389/frobt.2018.00015</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6eca20bb6fa6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[0-to-1 with Domain-Driven Design: Building Electrum’s Bike Service Application]]></title>
            <link>https://farizmamad.medium.com/0-to-1-with-domain-driven-design-building-electrums-bike-service-application-8f5919894c62?source=rss-5799f7a130aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f5919894c62</guid>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[electrum]]></category>
            <category><![CDATA[electric-vehicles]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[fariz mamad]]></dc:creator>
            <pubDate>Sun, 30 Nov 2025 02:57:25 GMT</pubDate>
            <atom:updated>2025-11-30T06:53:48.504Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0BHpDDRg827RkYCEsjlaGA.png" /></figure><blockquote>We built a bike service management system from scratch in 4 months using Domain-Driven Design (DDD). Our lean team of 3–5 people created a system now serving bikes daily across service centers, recording the health, repair details, spare part usages and SLA. Here’s what we learned about using DDD in real 0-to-1 product.</blockquote><h3>The Challenges</h3><p>At Electrum, we manage thousands of rental bikes. Every single day, bikes flow through our service centers for inspections, repairs, and maintenance. The entire operation initially ran on paper forms and spreadsheets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGBYG-72DbHsM93j5bBh0w.jpeg" /><figcaption>Illustration of inputing data from stack of papers forms into the spreadsheet at the end of day. <a href="https://www.freepik.com/free-photo/still-life-documents-stack_95018664.htm#fromView=search&amp;page=1&amp;position=24&amp;uuid=050d611c-d445-4e00-b6fb-6e9e3f8032b8&amp;query=Photo+of+paper+forms+and+spreadsheets+piled+on+a+service+center+desk">Image by freepik</a></figcaption></figure><p>You can imagine the hectic. The service SLA is not easily controllable. Spare parts movements tracked manually and reconciling with our inventory system could take hours, sometimes days depending on the load. Stakeholders had no real-time visibility. We had unsystematic way to track bike reliability or spot spare part failure patterns.</p><p>And the workflows were complex. Bikes came in from customers, from pool stock handovers, from returns, from inter-location transfers; each with different service requirements.</p><p><strong>The digital team and fleet operations team decided to tackle this together.</strong></p><p>Hi, I am <strong>Ahmad Fariz</strong>, the Software Engineer at <a href="https://www.electrum.id/?ref=tech.electrum.id">Electrum.id</a> and also the Tech Lead of Electrum Service Application project.</p><p>In this post, I will walk you through the system we built and the lesson we learned.</p><h3>Why Domain-Driven Design for a 0-to-1 Product?</h3><blockquote><strong>The conventional wisdom says:</strong> DDD is slow, over-engineered, only for large teams. <strong>Our reality was different.</strong></blockquote><p>We actually started by doing the traditional approach: building APIs first. Then our principal software engineer introduced us to <strong><em>Domain-Driven Design (DDD)</em></strong> during design reviews. The lightbulb moment came when we realized:</p><ol><li><strong>Service operations have real complexity</strong> that doesn’t fit CRUD patterns.</li><li><strong>Multiple service types</strong> <strong>exist</strong>: regular, storing, handover, incoming transfer, outgoing transfer, walk-in maintenance, and repossession maintenance; each with different workflows.</li><li><strong>Multiple service items exist</strong>: sparepart replacement, spare part reparation, or other services.</li><li><strong>People already spoke in domain language:</strong> mechanics talked about “work orders”, “activities”, “QC in”, “QC Out”, not database tables.</li></ol><h3>The Journey</h3><h4>Phase 1: Discovery &amp; Domain Modeling</h4><p>We spent weeks just hanging out at service centers. Observing mechanics, QC teams, service advisors. Not building anything, just understanding the domain.</p><p><strong>What we discovered:</strong></p><ul><li>Service work follows strict sequencing: inspection → reparation → quality control.</li><li>Each activity captures different data (inspection has 90+ checklist items; reparation can have anywhere from zero to many repair actions).</li><li>Work orders aren’t just “fix this bike”. They encode <em>why</em> the bike is here and <em>where</em> it’s going next.</li><li>Inventory movements are happened during the bike service.</li><li>Payment may be required if the bike is going to be handed back to customer.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rQpcDrHRcth6JQhePFEFtA.png" /><figcaption>High level domain storytelling of the bike service process in Electrum.</figcaption></figure><p><strong>The domain model started to emerge:</strong></p><ol><li><strong>Bounded Contexts: </strong>we have <strong>Bike Service</strong> <strong>Core (</strong>Booking, Work Orders, Spare part Usages, Service Activities, Invoices) and <strong>External Systems </strong>(Inventory, Customer Management, and Bike Management).</li><li><strong>Core Entities: </strong>we have <strong>WorkOrder</strong> as an <em>aggregate root, </em><strong>ServiceActivity</strong>, and <strong>ServiceItem</strong>.</li><li><strong>Key Value Objects: </strong>Some objects are descriptive information within the application. The external system or master data within the application owns the actual entities. These are: <strong>Bike</strong>, <strong>Operator</strong>, <strong>Customer</strong>, <strong>Location</strong>, <strong>Activity form</strong>, and <strong>Spare part</strong>.</li></ol><p><strong>The DDD insight that changed everything:</strong> Making <strong><em>WorkOrder</em> the aggregate root</strong> that controls <em>ServiceActivities</em> and <em>ServiceItems</em>. This one modeling decision eliminated entire classes of bugs by encoding business rules directly in the domain model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p_Y_xQjunQO7NGufKSg9Lw.png" /></figure><h4>Phase 2: Development</h4><p>We built the core with a lean team consists of 1 Product Manager + 2 Engineers. The DDD model helps us taking technical decisions.</p><p><strong>1. Aggregate Root: Fixed our Modeling Mistake</strong></p><p>Our initial mistake was we modeled Inspection, Reparation, Quality control, Spare part usages, and Repair services as separate entities. This mistake made the business rules scattered everywhere. Handlers will constantly querying multiple tables to check data consistencies.</p><p>We fix this problem by collapsing everything into entities under the WorkOrder aggregate. Business rules enforced at compile time, not runtime database constraints. It is impossible to create orphaned activities or miscalculated costs. The aggregate can be tested in unit test. It becomes the single source of truth for what can happen to a work order.</p><p>Here is the example of how we can write the aggregate root.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0712463db67401b0d89386e16abc36b4/href">https://medium.com/media/0712463db67401b0d89386e16abc36b4/href</a></iframe><p><strong>2. Discriminator Pattern for Flexibility</strong></p><p>Work orders, activities, and items all vary by type. Instead of creating 9+ tables, we used 3 tables with discriminators. Here I present the example of how discriminator pattern used in table service_activities.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bc814c3849bd99d19656a6726b43c5f3/href">https://medium.com/media/bc814c3849bd99d19656a6726b43c5f3/href</a></iframe><p><strong>Why JSON for results?</strong> Look, inspection and QC activities have 90+ checklist items each. Reparation can have anywhere from zero to many repair actions. These are <strong>documents, not queries</strong>. We store them for audit trails, then analyze them in a separate analytics environment. Simple indexing on <em>order_number</em> handles all our operational queries.</p><p>This is the example of activity result of task type Inspection.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/827faf6f1d581fadb3dc9d007ed598c1/href">https://medium.com/media/827faf6f1d581fadb3dc9d007ed598c1/href</a></iframe><p><strong>3. REST API Integration (Not Message Queues… Yet)</strong></p><p>We integrated with Inventory using straightforward REST APIs. Firstly the users can create the part usage request to inventory. Next time the users open work order details or refresh the page, it triggers synchronization to check inventory status. These are the API examples:</p><pre>POST /inventory/part-usage: Request spare part usage for a work order<br>GET /inventory/part-usage/{id}: Check spare part usage request status<br>POST /inventory/part-usage: Request spare part part return</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*LK2mh7pm2VD-cp1p_NaAkw.png" /><figcaption>Sequence Diagram of Electrum’s bike service application communicating with Electrum’s inventory system</figcaption></figure><p><strong>Why not message queues?</strong> We get it. Message queues offer async processing, fault tolerance, and decoupling. But we chose simplicity for the 0-to-1 phase. The REST approach handles our estimated load just fine and let us deliver within the timeline while learning the domain. Message queues are definitely on the roadmap as we scale.</p><h4>Phase 3: Production Ready</h4><p>We grew the team for production hardening by adding +1 QA Engineer + 1 Engineer. This expansion enabled us to do more things: user acceptance tests, polish the frontend, fasten the iteration we gather from user feedbacks, create analytics dashboard for stakeholders, prepare training materials, and rollout planning.</p><p><strong>The best option for our rollout strategy was gradual rollout. </strong>We did it by visiting user workshop once in every week. Week 1: One service line at headquarters (~4 staff). Week 2–3: All headquarters lines. Week 4–7: All pools (one location per week).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*1PSC95qgX5oJtPKvsyPDqA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1bSz21LbCSU4HKVu_V9LgQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xlaX3sEuo6Q2xn6KLn8K-A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*86bSMZ5sSm_9burd1YkMIQ.jpeg" /><figcaption>We have visited and trained the service advisors and mechanics before and during the full implementation of the application.</figcaption></figure><h3>The Results</h3><h4>Operational Metrics</h4><p>We achieve operational metrics after 3 months: number of<strong> bikes in average serviced vs success repaired daily</strong> across service centers, <strong>mean time-to-repair</strong>, average number of <strong>bikes handled per mechanic per shift, </strong>and the <strong>value-added time</strong> bikes spend in workshop.<strong> </strong>Productivity now measurable and learned to be improved.</p><h4>System Integrity</h4><p><strong>We have real-time visibility into inventory movements</strong> <strong>due to usage in bike service</strong>. Every spare part request and handover between the inventory team and the mechanics are recorded. The stock accuracy is being analyzed by another team, but inventory movement integrity is solid.</p><p><strong>We also have complete service history.</strong> Every bike’s full repair records are queryable by license plate. The inspection result from previous service give us data to understand the <em>Mean Time Between Failure (</em>MTBF) of body, mechanical, and electrical components.</p><p><strong>We can monitor the SLA validation </strong>by having timestamps for every activity enable <em>Mean Time to Repair (</em>MTTR) analysis by service date, issue type, reparation difficulty, mechanic, and location.</p><h4>Stakeholder Wins</h4><p>Now <strong>Operations management</strong> have up-to-date dashboards to monitor the bike service in daily, weekly, or monthly, whenever they needed it. They may analyze this business and further make data-driven decision. <strong>Mechanics</strong> have paperless workflows, structured checklists via Activity Forms to make sure no point left behind. <strong>Quality team </strong>have systematic tracking of bike and spare part failure to determine whether the bike is ready to go or not. <strong>Customers </strong>should have transparent service details during and after the service.</p><h3>Key Lessons</h3><h4>DDD Doesn’t Slow You Down; It Prevents Rework</h4><p>The myth is DDD adds overhead for small teams and tight timelines.</p><p>Our experience said with just 1 PM and 2 engineers, the 4 weeks we spent on <strong>domain modeling eliminated</strong> <strong>rework </strong>for probably 8+ weeks we would have had with a CRUD approach. When business rules live in the aggregate, adding new work order types or activity workflows is a domain change, not a database migration plus code spaghetti refactor.</p><h4>Aggregate Roots Are Your Design Litmus Test</h4><p>We got the insight that<strong> </strong>If you’re struggling to define aggregate boundaries, your domain model isn’t clear yet.</p><p>When we collapsed Inspection/Reparation/QC into discriminated ServiceActivity entities under WorkOrder, everything clicked. The fact that we initially modeled them separately was a <em>modeling smell</em>. We hadn’t understood the domain deeply enough.</p><p>The Rule of thumb is<strong> if entities always move together, they belong in the same aggregate</strong>. ServiceActivities never exist without a WorkOrder. ServiceItems never exist without a WorkOrder. WorkOrder is the natural aggregate root.</p><h4>Value Objects Reduce Coupling</h4><p>We made Bike a value object within the bike service application (with just license plate, model, odometer), even though the external Bike Management system owns Bike as an entity.</p><p>Why this matters? The bike service application doesn’t need to know about bike ownership changes, location transfers, or depreciation schedules. It just needs “which bike am I servicing right now?”. This boundary kept the application focused on its core responsibility: bike service.</p><p>The pattern is <strong>if you only need descriptive data for a specific context, it’s probably a value object</strong>, even if it’s an entity elsewhere.</p><h4>Discriminator Pattern Needs Discipline</h4><p>JSON columns are powerful but dangerous. So, use it with consideration.</p><p>The benefits are it stores documents (inspection checklists, repair notes) that you won’t query in the application, avoids schema explosion for polymorphic data, and enable rapid iteration, e.g. add checklist items without migrations.</p><p>But remember, don’t query JSON for operational logic. You may want to query by the aggregate index like the work order number. Also, don’t skip schema validation. We validate JSON against ActivityForm schemas in code to make sure polymorphic data still pass the data validation.</p><p>Our rule is <strong>if analytics needs it, extract to a column. If it’s just audit trail, JSON is fine</strong>.</p><h4>Start Simple, Add Complexity When Needed</h4><p>We have 5 bounded contexts (Booking, Work Order, Spare part Usages, Repair Services, and Invoice) but deployed the bike service application as a modular monolith. Why not microservices? With a team of 5 (1 PM, 2 engineers, 1 QA, 1 additional engineer), deployment complexity would have killed us.</p><p>Instead, there are some reasons behind this decision. We made clear module boundaries in code, where the contexts don’t share database tables. Then, REST APIs are already enough to define contracts between systems.</p><p>When we need to split later, the bounded contexts become natural service boundaries. The pattern is <strong>start with bounded contexts in a monolith. Extract services when team size or deployment needs demand it. </strong>The philosophy is<strong> DDD gave us the <em>model</em> to handle complexity. We didn’t need all the <em>infrastructure</em> on day one</strong>.</p><h4>Users Refine Your Ubiquitous Language</h4><p>The terminologies we use in the application are mostly came straight from stakeholders.</p><p>“ServiceType” variety? The stakeholders told us they handle regular service, storing service, walk-in maintenance, repo maintenance, handover inspection, and transfer inspection. “ActivityForm” templates? Stakeholders told us they needed structured checklists in QC, not free-text notes.</p><p>The DDD practice that mattered most is physically visiting the workshops, watching mechanics work, and using their words in our code. When `WorkOrder.service_type = ‘regular’` maps directly to what service staff say, the system becomes intuitive.</p><h3>Conclusion</h3><p><strong>Domain-Driven Design isn’t heavyweight if you do it right.</strong> For us, it was the right path from chaos to production. This practice results in a system that mechanics actually use, stakeholders trust, and we can evolve without fear. If you’re building a 0-to-1 product in a complex domain, invest in domain modeling. Your future self (and your team) will thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f5919894c62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Privilege untuk Bebas Berkarya]]></title>
            <link>https://farizmamad.medium.com/privilege-untuk-bebas-berkarya-b5760ea58198?source=rss-5799f7a130aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5760ea58198</guid>
            <category><![CDATA[psychology]]></category>
            <category><![CDATA[careers]]></category>
            <dc:creator><![CDATA[fariz mamad]]></dc:creator>
            <pubDate>Fri, 24 Oct 2025 15:56:09 GMT</pubDate>
            <atom:updated>2025-11-03T15:37:36.471Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kebebasan adalah Kemewahan</h3><blockquote>Semua manusia berhak menciptakan karyanya sendiri.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6FJlLp887-N-SBMmq0pmQQ.jpeg" /><figcaption><a href="https://www.freepik.com/free-photo/freedom-concept-with-hiker-mountain_4149022.htm#fromView=search&amp;page=1&amp;position=26&amp;uuid=7ed99861-8a7c-4f6f-a75d-5214c5d2ef2f&amp;query=free+mind">Image by freepik</a></figcaption></figure><p>Begitulah kalimat yang saya pikir <strong>sangat ideal</strong>. Semua manusia bebas berekspresi dalam berbagai bentuk. Bayangkan, saya dan anda — kita — masing-masing punya waktu luang untuk berpikir. Misalnya, berpikir untuk berempati terhadap dunia sekitar. Caranya macam-macam, bisa dengan berjalan kaki keliling kota hingga berselancar di dunia maya. Tidak ada rasa takut kehabisan waktu, kehabisan uang, apalagi dibatasi aturan.</p><p>Ternyata kenyataan <strong>tidak se-ideal itu</strong> bagi setiap orang. Waktu terus bergulir hingga kita memahami sistem di sekitar — yang tersusun oleh banyak elemen yang memiliki tujuannya masing-masing — saling terhubung dan saling memengaruhi. Hubungan tersebut bisa saling menguntungkan, saling merugikan, atau tidak berdampak apapun.</p><blockquote>Keadaan sistem ini tidak sesuai yang seharusnya. Kita merasa resah.</blockquote><p>Suatu saat kita <strong>merasa ada kondisi yang perlu dikendalikan</strong><em> </em>agar keresahan ini hilang. Usaha demi usaha dilakukan, mulai dari belanja masalah, dilanjutkan dengan analisis <em>root cause</em>, hingga menyusun solusi. Kemudian sampailah pada momen presentasi. Kita berusaha meyakinkan elemen lain dalam sistem agar sepakat dengan ide yang kita tawarkan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dlFEA5Wp5BQhWCTx.jpg" /><figcaption>Thinking in Systems by Donella H. Meadows. Source: <a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fbooks.apple.com%2Fus%2Fbook%2Fthinking-in-systems%2Fid6744044771&amp;psig=AOvVaw3WKDeHkS_7rrQFhDlJEQiO&amp;ust=1761406827120000&amp;source=images&amp;cd=vfe&amp;opi=89978449&amp;ved=0CBUQjRxqFwoTCID51_OVvZADFQAAAAAdAAAAABAU">Apple Books</a></figcaption></figure><p>Tapi idealisme itu sirna termakan oleh kenyataan bahwa ide kita ditolak. Donella H. Meadows dalam bukunya <em>Thinking in system </em>menyatakan<em> </em>bahwa<em> </em><strong>setiap elemen punya tujuan dan fungsi nya masing-masing</strong><em>. </em>Asimtot dari pernyataan tersebut terhadap diskusi ini adalah kita tidak sebebas itu untuk berpikir dan bertindak untuk mengendalikan elemen lain. Beda elemen akan beda cara mengendalikannya. Kita punya pilihan untuk terus mengeluarkan karya sebagai upaya mencapai tujuan diri sendiri secara khusus, dan tujuan bersama secara umum.</p><h3>Membuat Produk dari 0 ke 1 adalah kebebasan</h3><p>Kita punya kebebasan untuk mengatur tujuan dan fungsi diri sendiri.</p><blockquote><a href="https://spectrum.ieee.org/apple-macintosh">Proyek pembuatan personal computer Macintosh</a> milik Apple tahun 1984, yang dimulai oleh 2 orang saja dan dengan sentimen negatif alias diremehkan, menjadi cikal bakal komputer canggih di masa depan. Mereka memilih untuk membebaskan diri dengan menyelesaikan proyek tersebut.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-wrgRoc87IW3cCsM" /><figcaption><a href="https://spectrum.ieee.org/apple-macintosh">https://spectrum.ieee.org/apple-macintosh</a></figcaption></figure><blockquote><a href="https://bostondynamics.com/about/">Proyek pembuatan robot industrial yang dinamis</a> milik Boston Dynamics, yang berawal dari spin-off MIT Leg Lab tahun 1992, saat ini melayani transformasi digital dengan robot yang bisa bekerja di dunia nyata. Foundernya berani membebaskan diri dengan keluar dari zona nyaman laboratorium dan menyelesaikan proyek pertamanya.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xabpGfxHYfjW95z5.jpg" /><figcaption><a href="https://bostondynamics.com/about/">https://bostondynamics.com/about/</a></figcaption></figure><p>Dua kisah di atas terlalu sedikit untuk menyatakan bahwa membuat produk dari 0 ke 1 adalah kebebasan. Namun, kita bisa tarik benang merahnya. Mereka adalah elemen dari sistem yang lebih besar, yakni Apple dan MIT Leg Lab. Mereka tidak seutuhnya bebas di sistem yang besar tersebut. Tapi <strong>mereka punya diri mereka sendiri yang tujuan dan fungsinya mereka atur</strong>.</p><p>Kalau saya refleksikan kepada diri sendiri, saya belum punya kebebasan untuk mengatur sistem yang besar. Dalam dunia kerja, saya adalah bagian dari perusahaan — elemen dalam sistem yang lebih besar. Saya tidak bisa mengendalikan semua elemen di dalam sistem tersebut, kecuali elemen yang diserahkan kepada saya.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jJxLvlNqBDVUha5GkFQu7w.png" /><figcaption>Electrum Service Application Banner</figcaption></figure><p>Saya beruntung karena diberikan kesempatan untuk membuat produk dari 0. Proyek pembuatan aplikasi servis motor <a href="https://electrum.id/about-us">Electrum</a>, <strong>Electrum Service Application</strong>, dimulai oleh saya dan 2 rekan. Aplikasi ini bukanlah primadona saat pertama kali dicetuskan, melainkan hanya sebatas mencatat kegiatan servis. Saat ini aplikasi tersebut menjadi alat utama untuk membantu tim operasional dan produk mencatat rekam servis motor, dan <em>inbound-outbound</em> motor.</p><p>Di kesempatan tersebut saya benar-benar mendapat banyak pengalaman. Saya terekspose dengan <em>domain driven design, clean architecture, database modeling, API design, containerization, orchestration, </em>dan <em>CI/CD</em>. Ternyata di kesempatan yang langka ini saya bisa mengubah fungsi diri menjadi lebih eksploratif. Pengalaman ini membangun cerita yang menarik ketika saya ceritakan kepada orang lain, karena <strong>tidak semua orang punya kesempatan yang sama</strong>.</p><p><strong>Ternyata, membuat produk dari 0 ke 1 adalah kemewahan.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5760ea58198" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hidup Sebelum dan Sesudah Kubernetes]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://farizmamad.medium.com/hidup-sebelum-dan-sesudah-kubernetes-d76a251fffdc?source=rss-5799f7a130aa------2"><img src="https://cdn-images-1.medium.com/max/2600/1*y0PGfdgubvBNc5LLeFsoUw.png" width="2798"></a></p><p class="medium-feed-snippet">Artikel ini membandingkan dua pendekatan deployment aplikasi: manual vs Kubernetes</p><p class="medium-feed-link"><a href="https://farizmamad.medium.com/hidup-sebelum-dan-sesudah-kubernetes-d76a251fffdc?source=rss-5799f7a130aa------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://farizmamad.medium.com/hidup-sebelum-dan-sesudah-kubernetes-d76a251fffdc?source=rss-5799f7a130aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/d76a251fffdc</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[fariz mamad]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 16:23:43 GMT</pubDate>
            <atom:updated>2025-09-19T22:44:44.160Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[DARI PENCARIAN KERJA DI MASA SULIT MENUJU PROBATION: CERITA, REALITA, DAN HIKMAH DI DUNIA IT]]></title>
            <link>https://farizmamad.medium.com/dari-pencarian-kerja-di-masa-sulit-menuju-probation-cerita-realita-dan-hikmah-di-dunia-it-3e65d1ac603b?source=rss-5799f7a130aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e65d1ac603b</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[spiritual]]></category>
            <dc:creator><![CDATA[fariz mamad]]></dc:creator>
            <pubDate>Mon, 02 Jun 2025 15:41:09 GMT</pubDate>
            <atom:updated>2025-06-03T01:11:23.063Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CK4p4wllQcb1SrqXFnBgCQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@helloimnik?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Nik</a> on <a href="https://unsplash.com/photos/black-pencil-on-paper-3xNn1zGvBwY?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>— -</p><h4>PENDAHULUAN</h4><p>Akhir tahun 2024 adalah awal dari perjalanan baru saya. Di tengah situasi ekonomi yang menantang di hampir semua industri, saya memutuskan untuk mencari pekerjaan baru. Proses ini bukan sekadar mencari nafkah, melainkan perjuangan mental dan spiritual yang benar-benar menguji diri saya dan keluarga.</p><p>Di artikel ini, saya ingin berbagi cerita, realita, dan hikmah dari perjalanan mencari kerja hingga akhirnya menjalani masa probation di perusahaan baru. Semoga kisah ini bisa menjadi teman seperjalanan bagi siapa pun yang sedang berjuang, dan pengingat bahwa setiap proses memiliki makna tersendiri.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IqytjX72CmAx9WOx4Rm3gg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@lunarts?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Volodymyr Hryshchenko</a> on <a href="https://unsplash.com/photos/three-crumpled-yellow-papers-on-green-surface-surrounded-by-yellow-lined-papers-V5vqWC9gyEU?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><h4>DARI TEKANAN MENTAL MENUJU IKHTIAR DAN DOA</h4><p>Saat memulai pencarian kerja di tengah ketidakpastian ekonomi, tekanan mental begitu berat. Rasa takut gagal dan kekhawatiran tentang nasib keluarga selalu menghantui. Langkah pertama saya adalah berserah diri kepada Allah — melaksanakan sholat wajib, memperbanyak solat sunnah (tahajud, rawatib, dhuha), dzikir pagi petang, serta doa dengan ayat-ayat seperti QS. Al-Baqarah 255 dan QS. At-Talaq 2–3.</p><p>Setiap selesai ibadah, hati terasa lebih tenang. Ada keyakinan bahwa Allah pasti memberikan hasil terbaik asalkan saya tetap berusaha.</p><p>Saya juga memilih untuk terbuka kepada istri tentang situasi yang saya alami. Di luar dugaan, justru afirmasi positif darinyalah yang jadi kekuatan utama. Ia berkata, “Insya Allah, tiga bulan lagi pasti ada pekerjaan baru untukmu.” Dukungan ini membuat saya tersadar, betapa pentingnya asupan mindset positif dalam hidup.</p><p>Saya pun mengubah konsumsi media: berhenti membaca berita negatif, dan mulai fokus pada artikel-artikel tentang peluang baru. Saya berlangganan LeetCode premium untuk latihan interview, dan mulai mengirim 130 lamaran kerja di berbagai negara. Dari 130 lamaran, mayoritas ada respon — walau 90% di antaranya adalah penolakan. Namun, setiap respon, baik diterima maupun ditolak, selalu saya jadikan pelajaran baru.</p><p>Saya juga disiplin belajar hingga 8 jam sehari — mulai dari system design, algoritma, data structure, menulis surat lamaran, CV, hingga latihan interview.</p><h4>TITIK BALIK: BUKAN TENTANG BANYAKNYA LAMARAN, TAPI TENTANG KECOCOKAN</h4><p>Di antara proses interview, ada satu pengalaman yang sangat membekas. Saat interview user di salah satu perusahaan konsultan lokal, saya mendapat pernyataan yang pahit:</p><p>“Dengan mindset kamu sekarang, di sini kamu akan tidak betah. Sebaiknya cari tempat yang lain.”</p><p>Awalnya saya kecewa, merasa itu respon yang negatif. Tapi setelah beberapa hari, saya sadar — itulah pernyataan paling jujur dan penting dari seorang interviewer. Sejak saat itu, saya mengubah total strategi pencarian kerja: bukan lagi soal banyaknya lamaran, tapi tentang kecocokan antara dua belah pihak — industri, jobdesc, ukuran perusahaan, dan rekan kerja yang fit dengan saya.</p><p>Setelah itu, saya mendapat 6 interview yang lanjut hingga tahap final, bahkan sampai medical check up dan penawaran kerja.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*gX21sz7se9e__t6U.jpg" /></figure><h4>PROBATION: DARI RAGU, TUMBUH, HINGGA PERCAYA DIRI</h4><p>Memulai probation di tempat baru, saya datang dengan rasa percaya diri yang tinggi berbekal pengalaman dan jam terbang. Namun, supervisor saya memberi reality check:</p><p>“Pengetahuanmu tentang software engineering masih dangkal.”</p><p>Saya langsung tersadar, mungkin selama ini saya berada di puncak Dunning-Kruger effect — terlihat yakin, padahal masih banyak yang belum saya pahami.</p><p>Alih-alih minder, saya jadikan ini sebagai momen belajar. Saya mulai terbuka terhadap feedback, aktif bertanya, dan mengakui keterbatasan diri. Setiap tugas dan tantangan saya hadapi dengan semangat belajar, bukan sekadar ingin membuktikan diri.</p><h4>ETIKA KERJA: PELAJARAN YANG TAK TERNILAI</h4><p>Saya belajar, probation bukan cuma soal skill teknis, tapi juga soal etika kerja:</p><p>•<strong> Pahami masalah sebelum bertindak</strong>. Jangan buru-buru menyelesaikan masalah. Problem solving tidak hanya cepat, tapi harus tepat.<br>• <strong>Berikan konteks saat berkomunikasi</strong>. Jangan berasumsi orang lain tahu masalah kita. Ini juga berlaku ketika berkomunikasi dengan AI.<br>• <strong>Buat rencana kerja</strong> supaya efektif dan efisien.<br>• <strong>Jujur</strong>, jangan bermuka dua.</p><h4>SKILL TEKNIS: UPGRADE YANG NYATA</h4><p>Probation adalah fase upgrade skill yang nyata. Saya belajar banyak hal baru yang benar-benar membuka wawasan:</p><p>• <strong>Low Code</strong> untuk percepat development.<br>• <strong>Declarative Stream Processor</strong> untuk data pipeline.<br>• <strong>Vibe Coding</strong>, menjadi superhuman kalau kata Bapak Jensen Huang.<br>• <strong>Async Process dan Change Data Capture dengan Message Queue</strong> untuk scalable system.<br>• <strong>Containerization &amp; Orchestration</strong> (Docker, Kubernetes).<br>• <strong>Database Schema</strong>.<br>• <strong>API Contract</strong> yang jelas untuk kolaborasi tim.<br>• <strong>Repository setup</strong> yang bersih dan mengakomodir perkembangan proyek.</p><p>Tantangan terbesar adalah keluar dari zona nyaman, terus terang dalam komunikasi, dan bekerja secara terencana. Namun dari situ, mindset dan skill saya benar-benar naik level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LkNPingy-RiFuD4vdtfcKQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@helloimnik?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Nik</a> on <a href="https://unsplash.com/photos/difficult-roads-lead-to-beautiful-destinations-desk-decor-z1d-LP8sjuI?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><h4>PENUTUP: SYUKUR, HIKMAH, DAN PESAN UNTUK PEJUANG KARIR</h4><p>Kembali ketika akhirnya mendapat offering dan diterima kerja, perasaan pertama yang muncul adalah lega luar biasa. Saya sujud syukur sambil menangis — Ya Allah, berat sekali cobaan yang Engkau berikan. Terima kasih telah Engkau kuatkan diri ini untuk berjuang melewati tantangan yang berat ini. Setelah itu, saya langsung berbagi kabar bahagia tersebut dengan keluarga.</p><p>Dari seluruh proses ini, saya belajar bahwa dalam mencari pekerjaan baru penting sekali untuk teliti menyeleksi calon tempat kerja, pastikan fit dengan spesifikasi dan value diri kita. Barengi usaha dengan memperkuat ibadah kepada Yang Maha Kuasa — yakinlah setiap usaha akan diberikan hasil terbaik menurut Dia. Sayapun ingin berterima kasih atas kesempatan yang diberikan oleh perusahaan hingga saat ini lulus tahap probation.</p><p>Semoga kisah ini bisa menjadi penguat dan inspirasi untuk siapa pun yang sedang berjuang di tengah tantangan ekonomi dan kehidupan.</p><p>Salam,<br>Ahmad Fariz</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e65d1ac603b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Software Engineering Enables National-Scale Product Distribution]]></title>
            <link>https://farizmamad.medium.com/how-software-engineering-enables-national-scale-product-distribution-e52a9083fff6?source=rss-5799f7a130aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/e52a9083fff6</guid>
            <category><![CDATA[retail]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[distribution]]></category>
            <category><![CDATA[business]]></category>
            <dc:creator><![CDATA[fariz mamad]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 02:55:04 GMT</pubDate>
            <atom:updated>2025-02-03T02:55:04.068Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you looking to expand your physical product distribution beyond local markets? As a technical leader who’s helped a company scale from local to national distribution, I’ve learned that success lies in the intersection of technology and business operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tw85npXBwjD7RCDD33isHQ.jpeg" /><figcaption><a href="https://www.freepik.com/free-vector/isometric-export-import-composition-with-warehouse-workers-world-map-with-routes-moving-cargo-vehicles-vector-illustration_41916951.htm#fromView=search&amp;page=1&amp;position=2&amp;uuid=cd0333cb-65e0-4807-b52e-52c384aff70c&amp;query=distribution+network">Illustration of Product Distribution From freepik</a></figcaption></figure><p>Let me share how the right software engineering approach can transform your distribution capabilities:</p><h3>The Business Challenge</h3><p>Local success often creates an urgent need to expand. But scaling distribution isn’t just about hiring more people or opening new warehouses. It requires systems that can:</p><ul><li>Handle exponentially growing transaction volumes</li><li>Maintain speed and reliability across regions</li><li>Support real-time decision making</li><li>Ensure accurate tracking and auditing</li></ul><h3>Key Success Metrics</h3><p>Before diving into solutions, let’s focus on what matters:</p><p><strong>Sales Team Efficiency</strong></p><ol><li>Application response time under 2 seconds for field sales</li><li>99.9% system availability</li><li>Automated visit scheduling and routing</li></ol><p><strong>Operation Reliability</strong></p><ol><li>Real-time inventory tracking</li><li>trackable order processing</li><li>Full audit capability</li></ol><p><strong>Customer Satisfaction</strong></p><ol><li>Instant order confirmation</li><li>Accurate delivery estimates</li><li>Transparent tracking</li></ol><h3>The Strategic Approach</h3><p>success comes from aligning technology with business operations:</p><p>Infrastructure Strategy</p><ol><li>Regional server deployment for optimal performance</li><li>Automated scaling to handle the high traffic during peak hours</li><li>Multi-platform accessibility like web or mobile app</li></ol><p>Team Alignment</p><ol><li>share a clear and common objectives</li><li>Structured team according to job description</li><li>Iterative product delivery</li><li>Empowered and accountable teams</li></ol><p>Technical Excellence</p><ol><li>Optimized response times</li><li>Efficient database management</li><li>lightweight customer-facing application</li><li>Scalable architecture</li></ol><h3>The company see improvements in business process:</h3><ul><li>40% reduction in order processing time</li><li>2x increase in sales team productivity</li><li>Significant sales leader planning time reduction through scheduling automation</li><li>increased revenue</li></ul><h3>Here are a common framework for getting started</h3><ol><li>Assess your current systems</li><li>Identify bottlenecks</li><li>Prioritize improvements</li><li>Start with quick wins</li><li>Build for scale</li></ol><p>What distribution challenges is your business facing? Let’s discuss in the comments.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>If you’re looking for technical leader who brings dedication to your business journey, let’s connect. I’m open to discussing how my experience in building scalable systems and leading high-performing teams could help drive your business growth.</p><p>#BusinessGrowth #Distribution #TechStrategy #ScaleUp</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e52a9083fff6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MongoDB Developer Day Jakarta: Data Modeling]]></title>
            <link>https://farizmamad.medium.com/mongodb-developer-day-jakarta-data-modeling-fc67d3304c6f?source=rss-5799f7a130aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc67d3304c6f</guid>
            <category><![CDATA[data-modeling]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[fariz mamad]]></dc:creator>
            <pubDate>Fri, 21 Jun 2024 03:29:14 GMT</pubDate>
            <atom:updated>2024-06-21T07:39:32.142Z</atom:updated>
            <content:encoded><![CDATA[<pre>Hai, pembaca. Senang bisa menyambut anda kembali di blog saya.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xu8HCBSVk0DXuWSJJCiUQA.png" /><figcaption>tagline MongoDB: “Love your developers”</figcaption></figure><p>Throwback ke hari Kamis, 6 Juni 2024, di mana saya menjadi peserta sebuah <em>event</em> bernama <strong>MongoDB Developer Day Jakarta</strong>. Sesuai tagline mereka, <strong><em>Love your developers</em></strong>, saya merasa terpanggil untuk menghadirinya. <em>Event</em> ini unik sekali karena <strong>diadakan di sebuah <em>ballroom</em> hotel khusus untuk <em>software developer</em></strong>. Padahal ada stigma bahwa software developer itu orang yang <em>introvert </em>dan sibuk dengan urusannya sendiri di depan layar kerjanya.</p><p>Tapi <em>event</em> kali ini mematahkan stigma tersebut dan menunjukkan bahwa software developer juga manusia yang bisa bersosialisasi dan bekerja sama dengan manusia lainnya. Buktinya, acara ini <strong>overbooked</strong> ! Tidak semua orang yang mendaftar boleh hadir. Panitia memilah dan memilih peserta yang resmi boleh hadir. Mereka pun mengirim undangan resmi kepada peserta melalui email, termasuk kepada saya.</p><figure><img alt="Rundown MongoDB Developer Day Jakarta pagi" src="https://cdn-images-1.medium.com/max/1024/1*ReFI3eh6Tm1kF336MI0LLw.png" /><figcaption>Rundown MongoDB Developer Day Jakarta pagi</figcaption></figure><figure><img alt="Rundown MongoDB Developer Day Jakarta siang-sore" src="https://cdn-images-1.medium.com/max/1024/1*kNBKN0f3cQIZSVs4yDUcYQ.png" /><figcaption>Rundown MongoDB Developer Day Jakarta siang-sore</figcaption></figure><p><em>Anyway, let’s go back to the topic</em>. Setelah saya baca susunan <em>rundown</em>, ini jelas menunjukkan bahwa akan ada hal teknis yang diajarkan oleh tenaga ahli <em>developer</em> dari MongoDB kepada kami, para <em>software developer</em>. Mereka mengajarkan secara presentasi dan juga <em>hands-on</em> untuk menggunakan MongoDB dengan cara yang baik. Dua tenaga ahli tersebut yaitu 1) Teo Wen Jie, Senior Developer Advocate, dan 2) Hendri Tjipto, Senior Solutions Architect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j0_Ggjhrm2rNxjQwh5jLhw.png" /><figcaption>Pembicara di MongoDB Developer Day Jakarta</figcaption></figure><p>Apa maksudnya cara yang baik? Software developer terbiasa bicara tentang <em>best practices </em>untuk menggunakan sebuah teknologi. Dalam MongoDB, ada satu tahap yang penting dalam menggunakannya sebagai database, yaitu tahap <strong><em>Data Modeling.</em></strong></p><p>Mengapa <strong><em>Data Modeling </em></strong>penting? Menurut MongoDB:</p><blockquote>A good data model leads to: 1) Better performance, 2) Simpler implementation, 3) Lower costs, and 4) Better adaptability</blockquote><p>Kali ini kita coba lihat secara umum tentang MongoDB dan bagaimana <em>best practice Data Modeling </em>menurut MongoDB.</p><h3><strong>Apa itu MongoDB?</strong></h3><blockquote>MongoDB is a General-purpose <strong>document</strong> database designed for modern application development</blockquote><p>kata kuncinya di sini adalah: <strong><em>Document</em></strong></p><p><em>Document</em> merupakan <em>object</em> yang terdiri dari susunan pasangan <em>field — value. </em>Kalau di database RDBMSkita kenal dengan kumpulan table dan kumpulan data sebagai <em>row</em> dalam <em>table</em>, di MongoDB kita bisa ibaratkan seperti ini:</p><ol><li><em>table</em> -&gt; <strong><em>collection</em></strong></li><li><em>row</em> -&gt; <strong><em>document</em></strong></li><li><em>column -&gt; </em><strong><em>field</em></strong></li><li><em>cell -&gt; </em><strong><em>value</em></strong></li></ol><p><em>Document</em><strong><em> </em></strong>itu formatnya mirip JSON, tapi tipe datanya BSON . Lantas apa bedanya? Singkatnya, BSON bisa menampung tipe data lain pada setiap <em>field</em> selain <em>primitive</em>, misalnya ObjectId dan ISODate. MongoDB juga memiliki <em>template </em>yang dipahami oleh <em>query</em>, contohnya geo untuk geolocation.</p><pre>{<br>  &quot;_id&quot; : ObjectId(&quot;5ad88534e3632e1a35a58d00&quot;),<br>  &quot;name&quot; : {<br>    &quot;first&quot; : &quot;John&quot;,<br>    &quot;last&quot; : &quot;Doe&quot;,<br>  },<br>  &quot;address&quot; : [<br>    {<br>      &quot;location&quot; : &quot;work&quot;,<br>      &quot;address&quot; : {<br>        &quot;street&quot; : &quot;16 Hatfields&quot;,<br>        &quot;city&quot; : &quot;London&quot;,<br>        &quot;postal_code&quot; : &quot;SE1 8DJ&quot;},<br>        &quot;geo&quot; : { &quot;type&quot; : &quot;Point&quot;, &quot;coord&quot; : [-0.109081, 51.5065752]}<br>    },<br>    {...}<br>  ],<br>  &quot;dob&quot; : ISODate(&quot;1977-04-01T05:00:00Z&quot;),<br>  &quot;retirement_fund&quot; : NumberDecimal(&quot;1292815.75&quot;)<br>}</pre><figure><img alt="RDMBS Data Model vs MongoDB Document Data Model" src="https://cdn-images-1.medium.com/max/1024/1*7TgDCPwseQqoK-MoC0QeNg.png" /><figcaption>RDBMS Data Model vs MongoDB Document Data Model</figcaption></figure><p>Setiap <em>document </em>merupakan <em>children </em>dari<em> </em><em>collection . </em>Setiap <em>collection </em>merupakan <em>children</em> dari <em>database</em>. Setiap <em>database </em>merupakan <em>children</em> dari <em>cluster .</em></p><pre>cluster &gt; database &gt; collection &gt; document</pre><h3>Apa itu Data Modeling menurut MongoDB?</h3><blockquote>Data Modeling is the process of figuring out the most suitable<strong> schema</strong> for YOUR use.</blockquote><p>kata kuncinya adalah: <strong><em>schema</em></strong></p><p>Pada subjudul sebelumnya kita sudah lihat satu<em>document </em>MongoDB yang terdiri dari susunan pasangan <em>field — value</em>.<em> </em>Susunan tersebut tidaklah dibuat sembarangan, melainkan dari sebuah <em>template </em>yang diterapkan untuk collection tersebut, yang disebut <em>schema .</em></p><p>Sifat <strong><em>schema </em></strong>di MongoDB menguntungkan developer, diantaranya adalah:</p><ol><li><strong>Fleksibel</strong>: pada satu <em>collection</em> setiap data bisa memiliki schema yang berbeda.</li><li><strong>Adaptif</strong>: tidak perlu migrasi ketika ada perubahan schema.</li></ol><figure><img alt="Keuntungan schema yang fleksibel di MongoDB" src="https://cdn-images-1.medium.com/max/1024/1*17b8_NlOAI6Pr9RT3FyKRg.png" /><figcaption>Keuntungan schema yang fleksibel di MongoDB</figcaption></figure><h3>Bagaimana cara melakukan Data Modeling di MongoDB?</h3><p>Berikut ini adalah rangkuman dari metodologi <em>Data Modeling</em> MongoDB yang diajarkan pada <em>event </em>tersebut. Pada sesi ini, kami diberikan studi kasus <a href="https://mdb.link/library-system">Sistem Manajemen Perpustakaan</a> (link bisa saja mati sewaktu-waktu).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DfVyv31dj3IMtH7k_kI_Kw.png" /><figcaption>Halaman utama Sistem Manajemen Perpustakaan.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IO33CKg3mm0CJPNwektFsg.png" /><figcaption>Halaman detail sebuah buku pada Sistem Manajemen Perpustakaan.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1e5g-H1Qo1MvrN4Y8KJFSw.png" /><figcaption>5 Review terbaru untuk sebuah buku pada Sistem Manajemen Perpustakaan.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3iMLYvf7K2DTXQSj9dkxbw.png" /><figcaption>Metodologi Data Modeling MongoDB.</figcaption></figure><h4>Prerequisite</h4><p>Mengumpulkan <em>requirements </em>sistem. Requirements bisa terdiri dari:</p><ol><li>demografi pengguna.</li><li>kuantifikasi kebiasaan pengguna di dalam sistem.</li><li>kuantifikasi performa sistem yang diharapkan oleh pengguna.</li></ol><h4>Identifikasi <strong>entitas</strong> <em>database.</em></h4><ol><li>Klasifikasikan entitas di dalam sistem.</li><li>Detailkan <em>properties</em>-nya mulai dari nama <em>field</em> hingga tipe data.</li><li>Tetapkan <em>identifier </em>unik untuk masing-masing entitas.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQSn5lOI37bTViuAXDaxFw.png" /><figcaption>Contoh cara mengidentifikasi entitas pada Sistem Manajemen Perpustakaan.</figcaption></figure><h4>Mematok kuantitas <strong>beban kerja</strong> <em>database, a.k.a. </em>workloads.</h4><ol><li>Tulis operasi <em>database</em> yang diperlukan pada masing-masing entitas.</li><li>Hitung nilai frekuensi dan beban waktu operasi nya.</li><li>Lihat operasi mana yang paling kritis. Pahami apakah operasi tersebut<em>read-heavy</em>atau <em>write-heavy </em>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0sr7EW-fq7M4uSwp1PyFfQ.png" /><figcaption>Contoh cara mematok workloads pada Sistem Manajemen Perpustakaan.</figcaption></figure><h4>Identifikasi <strong>relasi</strong> antar-entitas.</h4><ol><li>Klasifikasi relasi bisa saja 1) <em>one-to-one</em>, 2) <em>one-to-many</em>, atau 3) <em>many-to-many</em>.</li><li>Apabila mempertimbangkan aksesibilitas, pilih jenis relasi 1) <em>embedding</em> untuk mengakses dua entitas secara bersamaan, atau 2) <em>referencing </em>untuk mengakses dua entitas secara terpisah. Anda bisa juga mengombinasikan keduanya.</li><li>Apabila mempertimbangkan ukuran data, pilih 1) <em>low cardinality </em>atau<em> 2) </em><em>high cardinality . </em>Perkirakan ukuran data di setiap entitas. Misalnya: 1) apakah jumlahnya terbatas dan terkontrol?, atau 2) apakah sebaliknya, data bisa terus berkembang seiring dengan interaksi sistem dengan pengguna?</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*exogAe4t-5MfKVaTghn6iw.png" /><figcaption>Cheatsheet untuk mengidentifikasi jenis relasi.</figcaption></figure><h4>Aplikasikan schema <strong>design pattern</strong> jika diperlukan.</h4><p>Nikmatnya menggunakan MongoDB adalah sudah ada <em>schema design pattern</em> yang digunakan oleh developer lain dan bisa diikuti oleh developer lain. Berikut ini saya sajikan famili <em>schema design pattern </em>beserta sejumlah turunannya<em> </em>yang diajarkan pada <em>event </em>tersebut.</p><ol><li><strong>Relationships: Extended Reference</strong>. Menggabungkan relasi <em>embedding</em> dan <em>referencing . </em>Bermanfaat jika sistem butuh 1 <em>query</em> untuk banyak entitas, menjaga ukuran <em>document </em>tetap kecil, walau ada sedikit duplikasi data yang di-<em>embed</em>.</li><li><strong>Relationships: Subset</strong>. Menyimpan sebagian <em>Extended Reference</em> pada array. Bermanfaat jika sistem butuh 1 <em>query</em> untuk banyak entitas dengan relasi <em>one-to-many, </em>namun hanya sebagian kecil data dari <em>many </em>yang perlu ditampilkan.</li><li><strong>Computation: Computed</strong>. Menyimpan <em>value </em>pada <em>document</em> <em>parent </em>yang butuh perhitungan dari banyak <em>document</em> <em>child</em>. Paradigmanya adalah “daripada menghitung angka ketika <em>read </em>data karena butuh baca lebih banyak <em>document child</em>, lebih baik dihitung ketika menulis <em>document</em> <em>child </em>kemudian simpan hasilnya pada <em>document</em> <em>parent.</em></li><li><strong>Polymorphism: Inheritance</strong>. Tipe entitas yang setara, butuh di-<em>query </em>bersama<em>, </em>namun memiliki <em>schema</em> yang berbeda bisa dimasukkan dalam satu <em>collection</em>.</li><li><strong>Relationships: Attribute</strong>. Paradigmanya adalah untuk mempermudah <em>indexing </em>atribut yang tidak terprediksi dan beragam, sebaiknya transformasikan subset informasi atribut menjadi pasangan <em>key-value.</em></li><li><strong>Life Cycle: Schema Versioning</strong>. MongoDB memperbolehkan <em>schema </em>yang tidak seragam pada satu <em>collection</em>. Apabila konteks keragaman tersebut adalah terkait pembaruan versi, ada baiknya diberikan tanda <em>schema </em>berapa yang berlaku pada <em>document </em>tersebut. Hal ini juga bermanfaat untuk depresiasi <em>document </em>jika tidak ingin ter-<em>query</em> pada versi API terbaru.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gm0oOPAxkxmLEpUFPTIisw.png" /><figcaption>Famili schema design pattern MongoDB</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G-ylN61IXqpKLVQCWPO3lA.png" /><figcaption>Contoh Extended Reference pattern pada document Booking. Lihat field <em>room dan user.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X_uJ9bZ2P85e7cQxauS3Lw.png" /><figcaption>Contoh Subset pattern pada <em>document Book. Lihat field latest_readers.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_BgJG_2G9QlAxLLlkxHlCw.png" /><figcaption>Contoh Computed pattern pada document Book. Lihat field averageRating.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7JSGnPMl3SAFbSuZNTRHwA.png" /><figcaption>Contoh cara mengimplementasikan Computed pattern menggunakan aggregate.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KD-SOdrNbZ6lI294_D2oVg.png" /><figcaption>Contoh Polymorphism pattern pada collection Product pada Sistem E-Commerce.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ByL5_YejEL5WhKKsf263ag.png" /><figcaption>Contoh Attribute pattern pada collection Product pada Sistem E-Commerce.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BldnGH5XcYPx_yu0XYyrGg.png" /><figcaption>Contoh Schema Versioning pattern pada collection Book pada Sistem Manajemen Perpustakaan.</figcaption></figure><h3>Penutup</h3><p>Keuntungan adanya <em>best practice Data Modeling</em> dari MongoDB ini bergantung pada kebutuhan kita sebagai developer. Materi di atas bisa kita pelajari sebagai landasan pengetahuan. Namun, tidak ada solusi yang benar atau salah. Yang ada adalah solusi yang lebih optimal daripada solusi yang lain. Semoga tulisan ini bermanfaat. Mohon maaf apabila ada kurang atau salah kata.</p><blockquote><strong>Terima kasih MongoDB</strong> atas kebaikannya kepada para developer hingga mengadakan acara seperti <strong>MongoDB Developer Day</strong> di Jakarta.</blockquote><p>Referensi:</p><ol><li>RSVP MongoDB Developer Day Jakarta. <a href="https://events.mongodb.com/mongodb-developer-day-jakarta?_ga=2.170744358.783764964.1718852698-365341302.1718852698">https://events.mongodb.com/mongodb-developer-day-jakarta</a></li><li>Materi pembelajaran MongoDB Developer Day Jakarta. <a href="https://www.mongodb.com/developer/events/developer-day-jakarta/">https://www.mongodb.com/developer/events/developer-day-jakarta/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc67d3304c6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MongoDB Model.bulkWrite method solved my issue importing documents from hours to 5 minutes]]></title>
            <link>https://blog.devgenius.io/mongodb-model-bulkwrite-method-solved-my-issue-importing-documents-from-hours-to-5-minutes-edd9da8b98b2?source=rss-5799f7a130aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/edd9da8b98b2</guid>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[fariz mamad]]></dc:creator>
            <pubDate>Thu, 04 Jan 2024 05:44:18 GMT</pubDate>
            <atom:updated>2024-01-06T02:39:25.072Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QJnvahq_EBdUGjYQUYrhvA.png" /><figcaption>source: <a href="https://webimages.mongodb.com/_com_assets/cms/kuzt9r42or1fxvlq2-Meta_Generic.png">MongoDB</a></figcaption></figure><h3>Situation</h3><p>I have a Node.js backend service using <strong>the NestJS</strong> framework that depends on an object modeling tool called <strong>Mongoose</strong> to connect to the <strong>MongoDB</strong> database. It serves to import data from CSV to the database via API endpoint. <strong>The CSV consists of &gt;10k rows, each has multiple columns</strong>. The service has tasks to:</p><p>1 ) convert the CSV data to an array of JavaScript objects.</p><p>2) calculate the value of new fields for each object using some business logic.</p><p>3) insert each object into the database OR update the existing document if the new field value matches.</p><h3>Task</h3><p>It was relatively easy to do task 1 by utilizing the<strong> csv-parse </strong>library to convert rows of columns of data into an array of JavaScript objects. The problem happened when doing calculations on each object and when inserting the object into the database. Calculations on each object mean it might query the database, do mathematic calculations, do string manipulation, etc. Hence, it resulted in different updates for each object. Furthermore, the database operation could be <strong>updateOne</strong> or <strong>create</strong> depending on the value of new field. Below is the pseudocode on the 1st version of the code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2bddfe2429eadd1d26df970ad3a205fd/href">https://medium.com/media/2bddfe2429eadd1d26df970ad3a205fd/href</a></iframe><p>Guess how is the performance? <strong>To process 1k of data it took 1 hour or more!</strong> If an error occurred, then it took longer. Imagine how long I need to wait to process 10k of data. It was such a wasted time.</p><h3>Action and Result</h3><p>That’s why I explored the root cause of this problem, and I found out <strong>that updateOne or create commands on every looping consumes most of the time. </strong>Why? Because in updateOne or create, it did a round-trip communication to the database. Moreover, create needs time to index. Thus, <strong><em>n</em> data = <em>n</em> round-trip </strong>where each round-trip may take 100 ms to 1000 ms.</p><p>It was where I found the solution: <strong>Model.bulkWrite. </strong>Instead of doing <em>n</em> round-trip communication to the database in every loop, <strong>we do it in batch</strong>. The idea was to only do calculations on each loop. After that, it only sends the insert or update operations at one call to do write operations in batch. <strong>Now the service can process 8k data only in under 5 minutes</strong>. Below is the code after being fixed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a52eeaaae28c3fd4397793870c23d2c5/href">https://medium.com/media/a52eeaaae28c3fd4397793870c23d2c5/href</a></iframe><p>By definition from <a href="https://www.mongodb.com/docs/manual/reference/method/db.collection.bulkWrite/"><strong>MongoDB</strong></a>, <strong>Model.bulkWrite </strong>or <strong>db.collection.bulkWrite </strong>is a method that “<strong>Performs multiple write operations</strong> with controls for order of execution”. It receives <strong>write operations as input</strong> and <strong>returns</strong> <strong>counts</strong> for each write operation, and <strong>an array containing an <em>_id</em></strong><em> </em>for each inserted or upserted document.</p><p>In <a href="https://mongoosejs.com/docs/api/model.html#Model.bulkWrite()">Mongoose</a>, the details look like this.</p><pre># write operations:<br>&lt;ul&gt;<br>  &lt;li&gt;insertOne&lt;/li&gt;<br>  &lt;li&gt;replaceOne&lt;/li&gt;<br>  &lt;li&gt;updateOne&lt;/li&gt;<br>  &lt;li&gt;updateMany&lt;/li&gt;<br>  &lt;li&gt;deleteOne&lt;/li&gt;<br>  &lt;li&gt;deleteMany&lt;/li&gt;<br>&lt;/ul&gt;<br># options: some bulk write options.<br># counts:<br>&lt;ul&gt;<br>  &lt;li&gt;insertedCount&lt;/li&gt;<br>  &lt;li&gt;matchedCount&lt;/li&gt;<br>  &lt;li&gt;modifiedCount&lt;/li&gt;<br>  &lt;li&gt;deletedCount&lt;/li&gt;<br>  &lt;li&gt;upsertedCount&lt;/li&gt;<br>&lt;/ul&gt;<br># upsertedIds: array of ObjectIds</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tIwEXPs-ZVlpKX0kNl6_Tg.png" /></figure><p>So I recommend using <strong>Model.bulkWrite </strong>in your application if you have a similar use case, where your application does write operations on lots of data to <strong>MongoDB</strong> with different operations on each document.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edd9da8b98b2" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/mongodb-model-bulkwrite-method-solved-my-issue-importing-documents-from-hours-to-5-minutes-edd9da8b98b2">MongoDB Model.bulkWrite method solved my issue importing documents from hours to 5 minutes</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pursuing Back-End Learning Path with help from AWS and Dicoding Indonesia]]></title>
            <link>https://farizmamad.medium.com/pursuing-back-end-learning-path-with-help-from-aws-and-dicoding-indonesia-3c49a04482db?source=rss-5799f7a130aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c49a04482db</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[dicoding]]></category>
            <dc:creator><![CDATA[fariz mamad]]></dc:creator>
            <pubDate>Mon, 24 Jul 2023 03:16:01 GMT</pubDate>
            <atom:updated>2023-07-24T03:16:01.555Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a65BZhvwSm8WLy4v0egYgA.jpeg" /></figure><p>My education and career are like a roller coaster, bringing me up and down throughout the journey. Occasionally, I received a new achievement and was proud. Often, I failed in my endeavor and felt sick about it.</p><p>I am grateful to be able to stand against the difficulties. Family, colleagues, and employers already boost my mood and keep me disciplined. My responsibilities towards them are growing. I strive to live up to it by continuously learning.</p><p>“Sedikit demi sedikit, lama-lama menjadi bukit” is one of my favorite proverbs that keeps me in spirit when pursuing education. <a href="https://www.linkedin.com/company/amazon-web-services/">Amazon Web Services (AWS)</a>and <a href="https://www.linkedin.com/company/dicoding/">Dicoding Indonesia</a> have helped me to learn more about Back-End fundamentals and architecting in AWS. The learning path is neatly arranged and relevant to the practice in the industry.</p><p>Today, I am happy to share a blog in <a href="https://www.linkedin.com/company/dicoding/">Dicoding Indonesia</a> about my journey in pursuing AWS DevOps &amp; Back-End Developer Scholarship Program. Click <a href="https://dicoding.id/ahmadfariz">https://dicoding.id/ahmadfariz</a> to open the blog and read it.</p><p>*like and share so that more people have the chance to know and learn from <a href="https://www.linkedin.com/company/amazon-web-services/">Amazon Web Services (AWS)</a> and <a href="https://www.linkedin.com/company/dicoding/">Dicoding Indonesia</a></p><p><a href="https://www.linkedin.com/feed/hashtag/?keywords=softwareengineering&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7089079210954141696">#softwareengineering</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=aws&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7089079210954141696">#aws</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=dicoding&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7089079210954141696">#dicoding</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c49a04482db" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>