Logo
Logo
23 results for
  • I deployed a change to the order service that renamed a field from total_amount to total_cents. Made perfect sense — cents avoid floating-point nonsense. All unit tests passed. Integration tests passed. Staging looked fine.

    Production broke instantly. The payment service was still expecting total_amount. It deserialized the response, got None for the amount, and started processing $0 charges. We caught it in four minutes, but four minutes of free orders adds up.

    Rust tutorial rust microservices architecture Created Sat, 14 Jun 2025 07:33:00 +0000
  • This is the lesson where everything comes together. Over the previous seven lessons we’ve looked at sentinels and typed errors, wrapping strategy, error classification, where to log, how to translate at layer boundaries, and when panic is actually defensible. Now I want to show you what all of that looks like assembled into a complete, production-ready error system for a real API service.

    I’m going to build the full error architecture for a hypothetical orders API. By the end you’ll have a template you can adapt directly — the error type hierarchy, the middleware, the structured logging, and the client-facing error codes. This is the code I wish I’d had when I started building services in Go.

    Go tutorial golang Created Sat, 14 Jun 2025 00:00:00 +0000
  • I spent my first six months writing Rust thinking unsafe meant “this code is dangerous and you should feel bad.” That misunderstanding cost me weeks — I’d bend over backwards to avoid it, writing convoluted safe wrappers around problems that genuinely needed a raw pointer or two. Once I actually read the Rustonomicon and understood what unsafe really means, everything clicked.

    Let’s clear this up properly.

    unsafe Is Not What You Think

    Here’s the biggest misconception in the Rust ecosystem: unsafe does not mean “this code is broken” or “this code does bad things.” It means “I, the programmer, am upholding invariants that the compiler cannot verify.”

    Rust tutorial rust unsafe ffi Created Thu, 12 Jun 2025 08:32:00 +0000
  • Race conditions are the category of bug that makes senior engineers paranoid and junior engineers dismissive. They don’t reproduce consistently. Your tests pass. Your staging environment looks fine. Then, in production, under a specific load pattern at a specific time, two goroutines read and write the same memory address with no synchronization, and you get corrupted data — or a panic — or silently wrong results that sit in your database for three weeks before someone notices. Understanding why they happen at the language level is what separates engineers who prevent them from engineers who just get lucky.

    Go tutorial golang concurrency Created Thu, 12 Jun 2025 00:00:00 +0000
  • “It’s slow” is the most useless bug report in a microservices world. Slow where? The API gateway? The order service? The database query inside the payment service? The message queue between inventory and shipping? When a single user action touches five services and three databases, “it’s slow” could mean anything.

    I spent an entire afternoon once trying to track down a latency spike. Added timing logs to every service. Correlated timestamps across hosts. Manually stitched together the request flow from six different log streams. Found the culprit: a DNS resolution that was taking 800ms because of a misconfigured resolver — in a service I didn’t even know was involved.

    Rust tutorial rust microservices architecture Created Wed, 11 Jun 2025 10:45:00 +0000
  • go:generate is Go’s mechanism for attaching arbitrary code generation commands to your source files. It is not magic — it is a convention that tells go generate which commands to run and where. When you run go generate ./..., the tool reads every //go:generate comment in your source tree and executes the commands they reference. What those commands produce is up to you: String() methods for enum types, serialization code, mock implementations, database query functions, or anything else you can express as a code generator.

    Go tutorial golang reflection Created Tue, 10 Jun 2025 00:00:00 +0000
  • I’ll be honest — when someone first pitched “service mesh” to me, I thought it was over-engineered marketing. You’re telling me I need a sidecar proxy bolted onto every pod, a control plane to manage those proxies, and custom CRDs to configure traffic routing… just to do what a load balancer and some retry logic could handle?

    Then I ran a fleet of 20+ services in production. mTLS between everything? Doing that in application code is painful. Per-route retry policies? Circuit breaking with consistent configuration? Gradual traffic shifting for canary deploys? At that scale, doing it all in app code means doing it differently in every service, with different bugs in each implementation.

    Rust tutorial rust microservices architecture Created Mon, 09 Jun 2025 16:21:00 +0000
  • Here’s a scenario that’ll ruin your week. A customer places an order. Your order service saves it. Your payment service charges their card. Your inventory service reserves the items. Your shipping service schedules a pickup. Then the shipping service discovers the item is oversized and can’t be shipped to that address.

    Now what? The card’s been charged. The inventory’s been reserved. The order exists. You need to undo three things across three services, each with their own database, each with their own failure modes. Welcome to distributed transactions.

    Rust tutorial rust microservices architecture Created Sat, 07 Jun 2025 08:48:00 +0000
  • Every time I bombed a DP problem in a mock interview, the pattern was the same: I stared at the problem, thought “this looks like DP,” then froze because I couldn’t immediately write the recurrence. The fix wasn’t to memorize more recurrences. The fix was to stop trying to think bottom-up first.

    Here’s the approach that finally clicked: write the recursive solution first. Get it working. Then ask: “which subproblems am I solving multiple times?” Memoize those. Then, if you want to be clean about it, flip it into a bottom-up table. By the time you hit the bottom-up version, the recurrence is already obvious because you derived it from your own recursive code.

    fundamentals interviews Created Fri, 06 Jun 2025 00:00:00 +0000
  • The worst production incident I ever dealt with was a cascading failure triggered by a single slow database query. Service A called Service B synchronously, which called Service C, which ran a query that usually took 2ms but on that particular Tuesday took 45 seconds because of a missing index on a new column. Service A’s thread pool exhausted, its health check failed, Kubernetes restarted it, and for twenty minutes the entire checkout flow was down — because of a read query in a recommendation engine.

    Rust tutorial rust microservices architecture Created Thu, 05 Jun 2025 11:02:00 +0000