frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Databases Were Not Designed for This

https://arpitbhayani.me/blogs/defensive-databases/
44•mooreds•1d ago

Comments

dherls•1h ago
Giving LLM agents direct, autonomous access to a real production databases with write access seems insane to me.

NO ONE, agent or human, should have direct write access to production databases outside of emergency break glass scenarios. This is why we have stored routines and API layers to pre-define what writes are allowed. The facts that agents CAN autonomously write to a database does not imply that they should.

For the point about query optimization, again your agents should not be issuing random queries against a production database. We have had the concept of separate analytics databases with different architectures to support exporatory queries for decades.

cowlby•1h ago
LLM agents are unlocking demand and supply for applications that wouldn't have been possible before due to time constraints though. There's a growing demand for single user or smaller scoped apps where giving LLM agents direct access means velocity. The failure/rollback model is much easier with these as long as we have good backup hygiene.
antonvs•1h ago
This makes no sense whatsoever.

It's not news that if you just give all developers at a company write access to the production databases, owner permissions on all resources, etc. that velocity can be increased. But at what cost?

The reason we don't do that in most cases is that "move fast and break things" only makes sense for trivial, non-critical applications that don't have any real importance, like Facebook.

3form•39m ago
I think the argument would be mostly about the companies where such trivialities like proper auth were given up to maximum possible extent. I'm sure even some bigger ones are only gnashing their teeth over implementing security measures that are required by law and not seeing much point to it.
SegfaultSeagull•36m ago
This comment is savage and I’m here for it.
nophunphil•42m ago
1) Can you explain what demand and supply mean in this context?

2) In regards to having good backup hygiene, who is we?

gmueckl•41m ago
But are those users allowed to see all the data in the databawe by the law? Some privacy laws require that personal information must be hidden from employees unless they have a narrow and specific business reason to view it. Blanket full access to a database may be illegal for that reason.
throw5•21m ago
> There's a growing demand for single user or smaller scoped apps where giving LLM agents direct access means velocity. The failure/rollback model is much easier with these as long as we have good backup hygiene.

This makes no sense to me. For anything that has sensitive payment or personally identifieable data, direct access to DB is potentially illegal.

> The failure/rollback model is much easier with these as long as we have good backup hygiene.

Have you actually operated systems like this in production? Even reverting to a DB state that is only seconds old can still lose hundreds or thousands of transactions. Which means loads of unhappy customers. More realistically, recovery points are often minutes or hours behind once you factor in detection, validation and operational overhead.

DB revert is for exceptional disaster recovery scenarios, not something you want in normal day-to-day operations. If you are saying that you want to give LLM full access to prod DB and then revert every time it makes a mistake, you aren't running a serious business.

steve_adams_86•3m ago
This narrative seems to come from people who haven't worked on meaningfully complex software systems. They're more like script kiddies than software developers. I don't mean that in a derogatory manner. They're right that LLMs are unlocking new possibilities in the realm of their work. They just don't realize that these new possibilities are constrained to relatively simple applications, or very thin slices of complex systems.

I use an LLM to access my database occasionally, but never in production and never with write access. It is genuinely useful. It would never be useful in a production setting, though.

It's worth noting too that people should be wary of what a read only user means in database land. There are plenty of foot guns where writes can occur with read-like statements, and depending on the schema, maybe this would be a rollback-worthy situation. You really need to understand your database and schema before allowing an LLM anywhere near it, and you should be reviewing every query.

raincole•11m ago
> single user

If you're just vibe coding a tool for yourself, you don't have 'production database' at all even if you use database technology for storage. Just like many Android apps use local sqlite DBs but they're not production databases.

Of course in this case no traditional wisdom about production databases matters to you. In other words, it's off-topic.

exec7•1h ago
I totally i agree! even read access specialty when databases has some sensitive/personal information about users.
i7l•43m ago
How does that even work in compliance-relevant scenarios where the audit trail shows some LLM messed with the data? Who, if anyone, is on the hook?
mr-wendel•23m ago
My guess is that if the database is subject to auditing then LLM access (obviously writes in particular, but even reads come with exfiltration risks) will be a hard "no" and instant red flag. When it's a person, there is a sense of accountability and opportunity for remediation.

I suppose that LLMs will be treated as a code artifact and liability will shift upstream towards who deployed/approved the access in the first place. Even though code is essentially deterministic, making that association fairly simple, it's going to boil down to this same paradigm.

Perhaps governance rules will evolve to even explicitly forbid it, but my gut feeling is that for what the future determines to be "practical" reasons (right or wrong) LLMs will warrant an entirely new set of rules to allow them to be in the chain at all.

+ EDIT: both my wife and I have experience in this area and the current answer is companies like KPMG don't have an answer yet. Existing rules do help (e.g. there better be good documented reasons why it was used and that access was appropriately scoped, etc), but there is enough ambiguity around these tools so they say "stay tuned, and take caution".

bmurphy1976•2m ago
The dev who ran it. The manager who allowed it. The director/VP/CTO who enabled the culture. They all have some responsibility for it.
pilgrim0•1h ago
Who the hell let agents directly use a database? Even humans don’t get this privilege. So, of all things, we forgot how to write APIs now? The article suggests creating a role for the agent directly in the database. What is wrong with you people? The very title of the article defeats its own purpose. They are not designed for this so don’t let them be used like this, ffs.
Alex_L_Wood•1h ago
This article has all the correct conclusions and solutions based on one assumption that doesn’t have any hold in reality - that someone would be insane enough to allow direct DB access to an AI agent.
dijksterhuis•16m ago
someone is potentially insane enough it would seem: https://news.ycombinator.com/item?id=47911579
iambateman•59m ago
Giving an LLM write access is insane but I gave LLM’s read-only access to our database and it’s been a huge productivity win.

Executives who wouldn’t take the time to build a report are happy to ask an AI agent to do so.

kgeist•52m ago
How do you validate that the reports are correct? What if an executive makes a wrong business decision because the LLM wrote a wrong SQL query?
nananana9•39m ago
The same way we've always done it - glance at it and see if the numbers look like they're within an order of magnitude of what looks reasonable.
pocksuppet•5m ago
https://thedailywtf.com/articles/The-Great-Excel-Spreadsheet
SOLAR_FIELDS•36m ago
I would hope that you're running this on a replica so that the massive table scan doesn't choke writes to the main db. Even then it's possible to bring the replica down and depending on the technology still create a problem (WAL backup for instance)
lateforwork•58m ago
There are two broad types of databases: operational and analytical.

Operational databases store transactions and support day-to-day application workflows.

For analysis, data is often copied into separate analytical databases (data warehouses), which are structured for efficient querying and large-scale data processing. These systems are designed to handle complex, random queries and heavy workloads.

LLM agents are the best way to analyze data stored in these databases. This is the future.

gib444•41m ago
> LLM agents are the best way to analyze data stored in these databases

Why, and how?

aleda145•48m ago
I totally agree on investing in a sane data model upfront. So many production systems have schemas that only made sense to the engineer that created them. I would be delighted if I can read a schema and understand what a column means without having to dig through a bunch of migration PRs.

I recently encountered `is_as BOOL` in an important table. After way too much invested time we found out it meant "is active service". </DDL rant>

tomwheeler•30m ago
> I recently encountered `is_as BOOL` in an important table.

Sounds like a table designed by Forrest Gump.

mulmen•23m ago
Postgres has COMMENT ON to help with this but descriptive names are helpful.
phillipcarter•22m ago
I think the best db schema I had the displeasure of working with was one where it was a requirement that every table and column name NOT have vowels, except for the few that could, and "the few that could" were governed entirely by a spreadsheet owned by the DB admin.

And so you got tables like LANDMRK and columns like RCR_RCRDR.

aleda145•7m ago
Oh my. What could possibly be the justification for this?
efficax•36m ago
Why are you connecting your agent to a database with write access? Are you out of your mind.
croisillon•28m ago
i wonder if that guy get requests per email from his "talks" section
bloaf•23m ago
> The API failed silently because the database connection pool was exhausted downstream.

I work with a team that does stuff like this, returning a 200 and a body containing "error: I didn't do what you said because _insert error here_"

The problem is that you returned OK instead of ERROR when things were not OK and there was an ERROR.

Its a design that smells of teams trying to hit some kind of internal metrics by slightly deceptive means.

shmeeny•10m ago
I think the spirit of this post has merit, but the premise is flawed. ORMs have been causing this same class of problem for decades. Furthermore, It's not at all uncommon for humans to create different queries for the same result and for them to follow different review paths for the same underlying database.
ak217•10m ago
> Connections are Brief

This is wrong, in the context of the author's chosen example (postgres). Postgres connections are very heavy and there is a huge performance penalty for cycling them quickly, and a whole range of silly workarounds for this fact (pgbouncer). Maybe the author meant to say that sessions are brief.

diavelguru•3m ago
Agree across the board.
PunchyHamster•2m ago
> Never let an agent hard-delete anything. Use soft deletes as a baseline for any table an agent can write to

How you even enforce it ?

And why you are even giving agent access to live DB in the first place ?

Clay PCB Tutorial

https://feministhackerspaces.cargo.site/Clay-PCB-Tutorial
88•j0r0b0•1h ago•59 comments

Asahi Linux Progress Linux 7.0

https://asahilinux.org/2026/04/progress-report-7-0/
424•elisaado•6h ago•183 comments

Why SWE-bench Verified no longer measures frontier coding capabilities

https://openai.com/index/why-we-no-longer-evaluate-swe-bench-verified/
106•kmdupree•3h ago•74 comments

Statecharts: hierarchical state machines

https://statecharts.dev/
211•sph•8h ago•61 comments

Dear friend, you have built a Kubernetes (2024)

https://www.macchaffee.com/blog/2024/you-have-built-a-kubernetes/
19•Wingy•2d ago•6 comments

Free Textbook on Engineering Thermodynamics

https://thermodynamicsbook.com/
21•2DcAf•2h ago•10 comments

Amateur armed with ChatGPT solves an Erdős problem

https://www.scientificamerican.com/article/amateur-armed-with-chatgpt-vibe-maths-a-60-year-old-pr...
621•pr337h4m•1d ago•440 comments

Databases Were Not Designed for This

https://arpitbhayani.me/blogs/defensive-databases/
44•mooreds•1d ago•37 comments

Show HN: Turning a Gaussian Splat into a videogame

https://blog.playcanvas.com/turning-a-gaussian-splat-into-a-videogame/
137•yak32•3d ago•27 comments

Why has there been so little progress on Alzheimer's disease?

https://freakonomics.com/podcast/why-has-there-been-so-little-progress-on-alzheimers-disease/
344•chiefalchemist•17h ago•231 comments

The Nintendo Switch Switch (2019)

https://blog.cynthia.re/post/nintendo-switch-ethernet-switch
55•zdw•1d ago•7 comments

GitHub unwanted UX change: issue links now open in a popup

https://github.com/orgs/community/discussions/192666
115•luckman212•3h ago•46 comments

The West forgot how to make things, now it’s forgetting how to code

https://techtrenches.dev/p/the-west-forgot-how-to-make-things
905•milkglass•11h ago•579 comments

USB Cheat Sheet (2022)

https://fabiensanglard.net/usbcheat/index.html
430•gwerbret•19h ago•79 comments

Tell HN: An app is silently installing itself on my iPhone every day

438•_-x-_•16h ago•165 comments

Cheating at Tetris

https://chalkdustmagazine.com/features/cheating-at-tetris/
51•t-3•4d ago•20 comments

GnuPG – post-quantum crypto landing in mainline

https://lists.gnupg.org/pipermail/gnupg-announce/2026q2/000504.html
136•zdkaster•14h ago•39 comments

Mine, a Coalton and Common Lisp IDE

https://coalton-lang.github.io/20260424-mine/
69•Jach•1d ago•3 comments

Mahjong: A Visual Guide

https://themahjong.guide/
167•iamwil•2d ago•48 comments

QNX on the Commodore 900 – Raiders of the lost hard drive [video]

https://archive.fosdem.org/2025/schedule/event/fosdem-2025-5479-raiders-of-the-lost-hard-drive/
16•rbanffy•4h ago•0 comments

Flickr: The first and last great photo platform

https://petapixel.com/2026/04/22/flickr-the-first-and-last-great-photo-platform/
245•Nrbelex•3d ago•134 comments

Terra API (YC W21) Hiring: Applied AI Strategist(Health Intelligence)

https://www.ycombinator.com/companies/terra-api/jobs/DY7BCZU-applied-ai-strategist-market-intelli...
1•kyriakosel•10h ago

Exposing Floating Point – Bartosz Ciechanowski (2019)

https://ciechanow.ski/exposing-floating-point/
62•subset•10h ago•9 comments

OpenAI Privacy Filter

https://openai.com/index/introducing-openai-privacy-filter/
268•tanelpoder•3d ago•55 comments

Using coding assistance tools to revive projects you never were going to finish

https://blog.matthewbrunelle.com/its-ok-to-use-coding-assistance-tools-to-revive-the-projects-you...
322•speckx•1d ago•209 comments

The Free Universal Construction Kit

https://fffff.at/free-universal-construction-kit/
357•robinhouston•4d ago•81 comments

The route from Prussian military headquarters to Gary Gygax’s basement

https://asteriskmag.com/issues/14/shall-we-play-a-game
63•jger15•3d ago•10 comments

My .config Ship of Theseus

https://shift1w.com/blog/config-of-theseus/
27•jacobwiseberg•2d ago•12 comments

The Super Nintendo Cartridges (2024)

https://fabiensanglard.net/snes_carts/
134•offbyone42•17h ago•19 comments

The Joy of Folding Bikes

https://blog.korny.info/2026/04/19/the-joy-of-folding-bikes
236•pavel_lishin•4d ago•162 comments