frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

1•LawZiL•1y ago
I'm running a load test on my Node.js application and want to simulate realistic write-heavy scenarios to stress test the system — especially the PostgreSQL database.

There's a part of the code that performs UPDATE queries, but during load testing, I don't want these updates to actually change the state of the database. However, I still want the database to experience the full impact of the update — query planning, locking, I/O, WAL writes, etc. — so I can measure how it affects performance under peak load.

Is there a best-practice approach to achieve this?

So far, the most viable option I’ve found is to wrap the UPDATE queries in a transaction and then roll it back — that way, the queries still execute, but the state doesn’t change. Is this the right way to go? Does rollback introduce any performance overhead that would skew my results? Are there better or more realistic alternatives that simulate the full write path without persisting changes?

Thanks in advance!

Comments

sargstuff•1y ago
pgbench[2] / pgreplay-go[0] / python locust[1]

very old school approach:

Misuse sql VIEW[3][4] to generate a temporary parallel table setup. Testing database separate from production database would be 'better', IMHO.

-----

[0] pgreplay-go : https://github.com/gocardless/pgreplay-go

[1] python locust : https://miguel-codes.medium.com/unconventional-load-testing-...

[2] pgbench load testing :

   a) https://medium.com/@c.ucanefe/pgbench-load-test-166bdfb5c75a

   b) https://neon.tech/blog/autoscaling-in-action-postgres-load-testing-with-pgbench

   c) https://hackernoon.com/how-to-create-and-load-test-data-in-postgresql-i41e353m
----------------------------

[3] : a) https://hashrocket.com/blog/posts/materialized-view-strategi...

      b) https://tech.jonathangardner.net/wiki/PostgreSQL/Materialized_Views

      c) https://stackoverflow.com/questions/77603705/what-is-the-use-of-materialized-view-in-postgresql
[4] : https://en.wikipedia.org/wiki/View_(SQL)
LawZiL•1y ago
but again, how can i perform the query, but not actually change the state, i really need the state to keep untouched, but be able to perform the query itself.
MatthiasPortzel•1y ago
> Does rollback introduce any performance overhead that would skew my results?

I would expect it to be the other way around—since the transactions are rolled back and not committed, they would have significantly less performance impact. But I’m working from an academic model of the database.

apothegm•1y ago
Load test against a clone instead of a DB whose contents you care about?

Everlane Represented a Millennial Ideal. Is It Dead?

https://www.nytimes.com/2026/05/19/style/the-fashions-shein-everlane-gucci-times-square.html
1•lxm•4m ago•0 comments

Tasks.org on Desktop

https://tasks.org/blog/desktop-app/
1•Quizzical4230•5m ago•0 comments

Canine Anatomy

https://veteriankey.com/canine-anatomy/
1•num42•5m ago•0 comments

S. 'Soma' Somasegar, 1966-2026: Microsoft and Madrona leader has passed away

https://www.geekwire.com/2026/s-soma-somasegar-1966-2026-microsoft-and-madrona-leader-was-a-champ...
1•SilverElfin•6m ago•1 comments

Supranim – Just a Bloody Web Framework Written in Nim

https://github.com/supranim/supranim
2•TheWiggles•6m ago•0 comments

The Wireworld Computer(1987)

https://www.quinapalus.com/wi-index.html
1•o4c•14m ago•0 comments

Evals Will Break and You Won't See It Coming

https://wanglun1996.github.io/blog/your-evals-will-break.html
1•rajveerb•14m ago•1 comments

Training within 10 hours of bedtime measurably hurts recovery

https://tryterra.co/research/best-time-to-workout-for-sleep
2•kyriakosel•19m ago•0 comments

Company Was an American Success Story. Until MAHA Influencers Sank It

https://www.thefp.com/p/this-company-was-an-american-success-until-maha-sank-it
1•rmason•20m ago•0 comments

Trump Order Would Push Banks to Check Clients' Citizenship Status

https://www.wsj.com/finance/regulation/trump-order-would-push-banks-to-check-clients-citizenship-...
2•petethomas•24m ago•0 comments

You Can't Park at 0.1c

https://samirvarma.substack.com/p/you-cant-quietly-park-at-01c
1•qsi•25m ago•0 comments

What are account recovery options with FusionAuth?

https://fusionauth.io/community/forum/topic/3133/what-are-account-recovery-options-with-fusionauth
1•mooreds•31m ago•0 comments

Why "Fast AI" and "Safe AI" Were Never in Conflict

https://www.enkryptai.com/blog/why-fast-ai-and-safe-ai-were-never-actually-in-conflict
1•mooreds•31m ago•0 comments

Etymonline: An Online Etymology Dictionary

https://www.etymonline.com
1•airstrike•32m ago•0 comments

Debunking the job-hopping myth: A Data-Driven Look at Tenure and Turnover [pdf]

https://www.nirsonline.org/wp-content/uploads/2025/09/25-Debunking-Job-Hopping-Myth_FINAL.pdf
2•gmays•35m ago•0 comments

Enterprise AI: Mystery Meat, Kill Zones, Cognitive Surrender, Vibe Bombs

https://kyield.com/insights/newsletter/2026/05/vibe-bombs-cognitive-surrender.html
1•mooreds•35m ago•0 comments

Apple Taps Virtual Avatar Firm Animato's Expertise and Intellectual Property

https://www.macrumors.com/2026/05/19/apple-acquires-animato/
1•mgh2•36m ago•0 comments

Cyoda-Go: The Enterprise Edbms

https://github.com/Cyoda-platform/cyoda-go
1•petethomas•41m ago•0 comments

Alternatives to HN for "tech outside of AI" discussion?

2•summonerOS•41m ago•0 comments

Customizing an LLM for Enterprise Software Engineering

https://arxiv.org/abs/2605.16517
1•azhenley•41m ago•0 comments

Zephex is hosted MCP that gives AI coding editors persistent project context

https://zephex.dev
1•zephex•45m ago•0 comments

Repugnant Economics

https://marginalrevolution.com/marginalrevolution/2026/05/repugnant-economics.html
3•paulpauper•49m ago•0 comments

Show HN: SafeRun – Replay debugging and inline prevention for AI agents

1•Tidianez•49m ago•0 comments

Old Space, New Space: A Commercial Revolution in Innovation?

https://www.nber.org/papers/w35212
1•paulpauper•50m ago•0 comments

Australia and Pax Silica: The Quiet Foundations of a New Western Order?

https://sldinfo.com/2026/05/australia-and-pax-silica-the-quiet-foundations-of-a-new-western-order/
1•Gaishan•51m ago•0 comments

Sen. Cassidy casts deciding vote in legislation to end Iran war [video][40s]

https://www.youtube.com/watch?v=S-h8oM7kGEE
2•Bender•51m ago•0 comments

Vacuum flux has memory too [4]

1•sargstuff•51m ago•0 comments

Meta Begins 8k Global Job Cuts in Asian Hub of Singapore

https://finance.yahoo.com/sectors/technology/articles/meta-begins-8-000-global-004153394.html
3•doppp•54m ago•0 comments

Copyright Office Rejected My Attempt to Copyright a Tweet

https://www.techdirt.com/2014/08/04/copyright-office-rejected-my-attempt-to-copyright-tweet/
3•danhite•1h ago•1 comments

Ember: 365-day audited record of AI models vs. Polymarket, scored by Brier

https://emberfyi.com/
1•emberfyi•1h ago•0 comments