frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Postgres Is Your Friend. ORM Is Not

https://hypha.pub/postgres-is-your-friend-orm-is-not
33•MYEUHD•1h ago

Comments

janmarsal•1h ago
Postgres is amazing and ORM is your friend. Migrations alone is a good reason why using ORMs is a good idea.
manuelabeledo•13m ago
Migrations aren’t necessarily tied to ORMs. There are tons of tools out there to run migrations and nothing else.
altmanaltman•1h ago
While there is a compelling case for leveraging the full power of Postgres (especially features like SKIP LOCKED and pg_notify), this approach feels like a classic trade-off between fine-grained control and long-term maintainability.

Relying solely on raw SQL and manual mapping certainly eliminates "ORM magic," but it replaces it with a significant maintenance burden.

For specialized, high-performance systems like video transcoding, this level of hand-tuning is a superpower; however, for the average CRUD-heavy SaaS app, the "boilerplate tax" of writing eighty lines of repository code for a simple related insert might eventually cost more in development velocity than the performance gains are worth.

nicoburns•23m ago
> for the average CRUD-heavy SaaS app, the "boilerplate tax" of writing eighty lines of repository code for a simple related insert might eventually cost more in development velocity than the performance gains are worth.

Perhaps, but IME this kind of thing is much more often the cause of poor performance in CRUD apps than the frontend frameworks that are usually blamed. I have been able to make very snappy SaaS apps by minimizing the number of queries that my API endpoints need to perform.

I've also found that the ORM mainly reduces boilerplate for Insert/Update operations, but often adds a very significant amount of boilerplate for read queries. We ended up using a very lightweight orms for simple inserts / upserts and writing raw SQL for anything else.

tags2k•34m ago
This straw-mans ORMs by listing out what crappy ones do. I mean, accidental writes? You've either got a terrible ORM, no tests, or both.
ecshafer•29m ago
I gotta agree with you, total straw man. I haven't seen any of the issues this guy has with ORMs.
DrewADesign•11m ago
Considering anybody with a noggin is going to be separating the SQL into it’s own module or whatever rather than just throwing straight inline SQL at your database wherever you it, you’re hardly less likely to have things like accidental writes, anyway. This is clearly someone who fell in love with Postgres, felt ORM abstractions that diluted the Postgres goodness were bad, and then did some mental experiments to consider all of the theoretical ways ORMs suck.
Doctor_Fegg•34m ago
Ah, we haven't had an "ORMs bad" post for at least three days.
dakolli•3m ago
Everyone too busy writing and posting their "How I use Think for me Saas" / BrEaK It InTo SmAlLeR TaSkS blog posts.
RockRobotRock•32m ago
I sure loved delving into this blog post.
rrr_oh_man•10m ago
Yup, sloppy slop-slop
Zanfa•30m ago
Though the article mentions the distinction between ORMs and query builders, it doesn't really make a case against query builders being bad. After all, it wraps up by building a kinda crappy one-off query builder.
bakugo•29m ago
This again...

No, just because raw SQL queries work great for your toy blog/todo app with 3 tables and simple relationships, doesn't mean they work great for real world business applications with 100 tables and complex networks of relationships. Try maintaining the latter before you make blanket claims like "ORM bad".

nubinetwork•17m ago
I guess I'll bite. How/When do you know you actually need an ORM?
rrr_oh_man•10m ago
When you add a new variable to a table and need it in a query fifteen views down?
MarcLore•21m ago
The pendulum between 'use an ORM for everything' and 'raw SQL only' has been swinging for 20 years. In practice, the sweet spot I've found is using an ORM for simple CRUD (saves hours of boilerplate) but dropping to raw SQL the moment you need joins across 3+ tables, CTEs, or window functions. The real danger isn't ORMs themselves - it's developers who never learn SQL because the ORM shields them, then they can't debug the N+1 query that's killing production.
aardvark179•12m ago
It’s been swinging for at least 30 years, Toplink came out in 1994, and I have worked on systems that were written half a decade earlier that contained things we’d all call ORMs.
j45•6m ago
Agreed, ORMs are OK to start with if you like and then optimize the queries where needed.

There are cases where older ORMS might be more optimized for some cases compared to new ones, and vice versa.

Avoiding learning SQL is the biggest gap. Selecting a NoSQL database because it seems easier, and then spending so much time trying to make a NoSQL database into a relational database is usually not too pretty.

DrewADesign•20m ago
I’m glad you’re head-over-heels in love with Postgres— it’s really cool, and I’ve occasionally had projects that really benefited from it… but most of those incredible features just aren’t useful for run-of-the-mill projects. Learning how to profile your ORM queries is a lot easier than maintaining a bunch of code from a different language embedded into your code base. If you’re writing articles about Postgres, you probably have no idea how much of a PITA that context switch is in practice. It’s funny how getting expertise in something can make it more difficult to understand why it’s useful to other people, and how they use it.
manuelabeledo•14m ago
There are projects, like SQLC, that cover most of the perceived advantages of ORMs, without the downsides.

One of these downsides is, in my opinion, the fact that they hide the very details of the implementation one necessarily needs to understand, in order to debug it.

sunbum•11m ago
Agreed, write raw SQL, this has never had any security impact whatsoever[1]

- Your friendly local pentester

[1] - https://en.wikipedia.org/wiki/SQL_injection

Amazon Kiro took down AWS for 13 hours. Nine other AI agents did worse

https://blog.barrack.ai/amazon-ai-agents-deleting-production/
1•dhayabaran•26s ago•0 comments

In 92% of DeFi exploits AI security review flags underlying problem

https://www.coindesk.com/business/2026/02/20/specialized-ai-detects-92-of-real-world-defi-exploits
1•GustavHartz•58s ago•0 comments

New York Just Killed Its Robotaxi Plan. The Real Problem Isn't the Technology

https://www.phyware.io/blog/ny-robotaxi-trust-gap
1•chris_money202•2m ago•0 comments

Duration between rewards controls the rate of behavioral, dopaminergic learning

https://www.nature.com/articles/s41593-026-02206-2
1•PaulHoule•5m ago•0 comments

Method and system for determining illumination of models using an ambient cube

https://patents.google.com/patent/US7227548B2/en
1•throwaway2027•7m ago•0 comments

Show HN: Cryphos – no-code crypto signal bot with Telegram alerts

https://cryphos.com
1•duckducker•11m ago•0 comments

Ibex: A Typed DataFrame Language with C++ Code Generation

https://bobjansen.net/ibex-a-typed-dataframe-language-with-c-code-generation/
2•Bootvis•11m ago•0 comments

Show HN: RMirror Cloud – Open-Source OCR and Notion Sync for ReMarkable Tablets

https://rmirror.io
1•gottino•11m ago•0 comments

Crosspassion: The Magical Intersection When Interests Collide

https://micahblachman.beehiiv.com/p/crosspassion
2•subdomain•13m ago•0 comments

Ask HN: How do you track 2026 AI price wars? I built a tool to help

1•TokenCost•16m ago•0 comments

Salvius Joins Moltbook

https://blog.salvius.org/2026/02/salvius-joins-moltbook.html
2•gunthercox•17m ago•0 comments

Velocity Is Dead: AI-Generated Compilers and the Future of Software

https://www.openhands.dev/blog/20260219-velocity-is-dead
1•todsacerdoti•17m ago•0 comments

Local LLM Setup on Windows with Ollama and LM Studio (ThinkPad / RTX A3000 GPU)

https://github.com/gbro3n/local-ai/blob/main/docs/local-llm-setup-windows-ollama-lm-studio.md
1•appsoftware•19m ago•1 comments

Show HN: CanaryAI v0.2.5 – Security monitoring on Claude Code actions

https://github.com/jx887/homebrew-canaryai
1•jx887•20m ago•0 comments

The Risk of GCP Viewer Role: Cross-Project Disk Replication

https://aneviaro.eu/posts/the-hidden-risk-of-gcp-viewer-role-cross-project-disk-replication/
2•xrustalik•22m ago•0 comments

Volatility: The volatile memory forensic extraction framework

https://github.com/volatilityfoundation/volatility3
2•transpute•24m ago•0 comments

Show HN: PaiperSwipe – Crowdsourcing AI summaries for 250M+ research papers

https://paiperswipe.com
3•blakecoffee•25m ago•0 comments

Surreal Number

https://en.wikipedia.org/wiki/Surreal_number
1•the-mitr•26m ago•0 comments

We Built UltrafastSecp256k1 Up to 51% Faster ECC Across x86,ARM64,and RISC-V

1•shrecshrec•26m ago•0 comments

I built a local search CLI for my Claude Code history

https://github.com/madzarm/ccsearch
1•madzarm•26m ago•1 comments

Visualizing one system 11 ways

https://app.ilograph.com/demo.ilograph.Ilograph/__overview
1•billyp-rva•26m ago•0 comments

Alyph – Branch ChatGPT conversations visually

https://alyph.app
1•rrr_oh_man•28m ago•1 comments

Open-Source Bionic Reading Chrome Extension (MIT)

1•sdgnbs•29m ago•0 comments

Make and Ideal Man

https://enombic.com/make-an-ideal-man
1•vxxzy•31m ago•0 comments

Orvia – Spin up a real-time room, share files, leave – everything disappears

1•yc_surajkr•35m ago•1 comments

Four Astronauts, One Orbit – What Will They Find?

https://theguildenet.blogspot.com/2026/02/what-four-astronauts-could-find-as-they.html
1•AriaValrhazar•36m ago•0 comments

Why Moltbook Failed: The Lack of Identity in Autonomous AI Agents

1•benstarslett•36m ago•1 comments

SkillPad – GUI for Agent Skills

https://skillpad.dev
1•devxoul•36m ago•0 comments

Capitalle – Daily world capital guessing game (no back end, pure client-side)

https://www.capitalle.app
1•dingobp•40m ago•1 comments

Show HN: Pq – Simple, durable background tasks in Python using Postgres

https://github.com/ricwo/pq
1•ricwo•40m ago•0 comments