<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/llcxzirbw" -->

---
title: Coding a database proxy for fun | daily.dev
description: A hands-on walkthrough building a toy SQL-intercepting database proxy in Go, inspired by Figma&#x27;s internal DBProxy used for Postgres sharding. The author sets...
canonical: https://daily.dev/posts/llcxzirbw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Coding a database proxy for fun | daily.dev
og:description: A hands-on walkthrough building a toy SQL-intercepting database proxy in Go, inspired by Figma&#x27;s internal DBProxy used for Postgres sharding. The author sets...
og:url: https://daily.dev/posts/llcxzirbw
og:image: https://api.daily.dev/og/posts/LlcxziRbW.png
og:image:alt: Post cover image
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Coding a database proxy for fun

**[Database Daily](https://daily.dev/sources/databasedaily)** · [@alexpliutau](https://daily.dev/alexpliutau) · 0 upvotes · 0 comments

## Summary

A hands-on walkthrough building a toy SQL-intercepting database proxy in Go, inspired by Figma's internal DBProxy used for Postgres sharding. The author sets up a TCP proxy that sits between a MySQL client and server, parses the raw MySQL wire protocol to detect COM_QUERY packets, and rewrites table names on the fly (e.g. rewriting orders_v1 to orders_v2) using a simple string replace. The post explains why teams build such proxies (query routing, schema migrations without app changes, security enforcement, connection pooling, observability) and provides working Go code, though it's explicitly framed as an educational experiment, not production-ready.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://packagemain.tech/p/golang-database-proxy>

## Similar posts on daily.dev

- [mickamy/sql-tap: Watch SQL traffic in real-time with a TUI](https://daily.dev/posts/mickamy-sql-tap-watch-sql-traffic-in-real-time-with-a-tui-ko8anynh8) · Hacker News · 3 upvotes · 0 comments
- [proxy](https://daily.dev/posts/proxy-aiqzpviwl) · Andrew Nesbitt · 1 upvotes · 0 comments
- [More than 100x Faster & Cheaper LLM-Powered SQL Queries with Proxy Models](https://daily.dev/posts/more-than-100x-faster-cheaper-llm-powered-sql-queries-with-proxy-models-9p5lkyzgg) · Google Cloud · 0 upvotes · 0 comments
- [Unlocking serversless MySQL](https://daily.dev/posts/unlocking-serversless-mysql-ii8haje5u) · SingleStore · 0 upvotes · 0 comments

---

Tags: [#golang](https://daily.dev/tags/golang), [#mysql](https://daily.dev/tags/mysql)

[View this post on daily.dev](https://daily.dev/posts/llcxzirbw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/llcxzirbw","headline":"Coding a database proxy for fun","text":"Shared: Coding a database proxy for fun","url":"https://daily.dev/posts/llcxzirbw","datePublished":"2026-08-30T19:33:40.949Z","dateModified":"2026-08-30T19:33:40.957Z","author":{"@type":"Person","name":"Alex Pliutau","url":"https://daily.dev/alexpliutau","image":"https://lh3.googleusercontent.com/a/ACg8ocLXExzpASLVyFJkZE0dfR0CaUsC2qf8cbhPT71UvOuY1tYMh30epA=s96-c","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":3550}},"image":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/dwbNWdEcw"},"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/databasedaily","name":"Database Daily"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Database Daily","item":"https://daily.dev/squads/databasedaily"},{"@type":"ListItem","position":3,"name":"Coding a database proxy for fun"}]}
```

