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•11mo 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•11mo 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•11mo 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•11mo 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•11mo ago
Load test against a clone instead of a DB whose contents you care about?

Firms Promised HighTech Ransomware Solutions;They Usually Just Pay Hackers(2019)

https://features.propublica.org/ransomware/ransomware-attack-data-recovery-firms-paying-hackers/
1•bookofjoe•4m ago•0 comments

Show HN: SpecSource – AI That Writes Linear Specs from Sentry, GitHub, & Slack

https://www.specsource.ai
1•bring-shrubbery•5m ago•0 comments

The philosophy of great customer service (2014)

https://sive.rs/cs
1•Michelangelo11•5m ago•0 comments

Touch some grass or how to survive during AI times

https://www.mcbaguetti.xyz/touchgrass.html
1•mcbaguetti•6m ago•0 comments

OpenAI's vision for AI economy: public wealth funds, robot taxes, 4-day workweek

https://techcrunch.com/2026/04/06/openais-vision-for-the-ai-economy-public-wealth-funds-robot-tax...
1•genphy1976•7m ago•0 comments

Show HN: Real-Time OLAP Infrastructure

https://modolap.com
2•ronfriedhaber•8m ago•0 comments

Why weekends are under threat

https://thehustle.co/originals/why-weekends-are-under-threat
10•Anon84•15m ago•1 comments

Glass – a replay-first bounded investigation surface for runtime activity

https://github.com/StealthEyeLLC/glass
1•stealtheyellc•15m ago•0 comments

Agentsview: A local-first desktop and web app for browsing AI agent sessions

https://github.com/wesm/agentsview
1•ayhanfuat•16m ago•0 comments

Stonks-CLI – track your investment portfolio from the terminal

https://github.com/igoropaniuk/stonks-cli
1•friedchocolate•16m ago•0 comments

We have a 99% email reputation. Gmail disagrees

https://blogfontawesome.wpcomstaging.com/we-have-a-99-email-reputation-gmail-disagrees/
2•em-bee•17m ago•0 comments

Troubleshooting Email Delivery to Microsoft Users

https://rozumem.xyz/posts/14
1•rozumem•19m ago•0 comments

Pact: Protocol for Agent Coordination and Transfer (Draft RFC)

https://github.com/noahfavreau/pact-protocol/blob/main/pact-spec/docs/PACT-RFC-001.md
1•legax•19m ago•0 comments

Show HN: Chunk – macOS menu bar time-blocking app with Claude AI integration

https://www.chunkapp.net
2•dudleyspence•20m ago•0 comments

Show HN: OIFI Databook: An intelligence database of Iran's power structure

https://databook.oifi.org
1•ksajadi•24m ago•0 comments

One Vendor. 80% of Dutch Hospitals. Ransomware

https://stateofsurveillance.org/news/chipsoft-ransomware-dutch-hospitals-80-percent-patient-recor...
2•Ey7NFZ3P0nzAe•24m ago•0 comments

Windows debloating tools are basically useless

https://www.pcmag.com/explainers/i-tested-4-windows-debloating-tools-spoiler-theyre-basically-use...
1•dryadin•25m ago•0 comments

What if local control can help build housing?

https://www.noahpinion.blog/p/what-if-local-control-can-actually
1•firasd•25m ago•0 comments

Coders and testers help me out

https://github.com/andlind/almondsrc
1•andreasli72•26m ago•1 comments

Tell HN: docker pull fails in spain due to football cloudflare block

4•littlecranky67•30m ago•0 comments

Why AI Sucks at Front End

https://nerdy.dev/why-ai-sucks-at-front-end
1•tobr•33m ago•0 comments

Playing a nomic could be used to build small directly-democratic organizations

https://democranomic.neocities.org/
1•cobber2005•35m ago•1 comments

You Don't Need Claude Code

https://tildehacker.com/you-dont-need-claude-code
3•tildehacker•37m ago•1 comments

Editorial India B788 Ahmedabad 2025-06-12 lost height shortly after takeoff

https://avherald.com/h?article=52b0a800/0000
2•hugh-avherald•37m ago•0 comments

Please Review It( Vital Weave)

https://hackathoncbc.streamlit.app/
1•vignesh_146•38m ago•2 comments

Bring Back Idiomatic Design

https://essays.johnloeber.com/p/4-bring-back-idiomatic-design
3•phil294•38m ago•0 comments

Apple, Still

https://taoofmac.com/space/blog/2026/04/12/1330
2•rcarmo•41m ago•0 comments

BrickFormer Source Code Released

https://github.com/loryruta/brickformer
2•loryruta•47m ago•0 comments

LLM Wiki Skill: Build a Second Brain with Claude Code and Obsidian

https://medium.com/@alirezarezvani/llm-wiki-skill-build-a-second-brain-with-claude-code-and-obsid...
2•jungard•52m ago•0 comments

HubVanta AI

https://hubvanta.com/
1•hubvanta•54m ago•0 comments