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

Don't hijack my mouse pointer

https://ruky.me/dont-hijack-my-pointer/
1•rukshn•1m ago•0 comments

Distilling a strategic-reasoning framework into 7B weights

https://lerugray.github.io/writing/hundred-percent-then-broke-it/
1•ray_hammerstein•1m ago•0 comments

Terrably: Build Terraform Providers in TypeScript

https://paambaati.github.io/terrably/docs/
1•httgp•2m ago•1 comments

Trends in US Construction Productivity

https://www.construction-physics.com/p/trends-in-us-construction-productivity
1•surprisetalk•2m ago•0 comments

Show HN: How Scaleway brought the first RISC-V servers to the cloud

https://www.scaleway.com/en/blog/risc-v-servers-in-the-cloud/
1•enthusaist•3m ago•0 comments

Show HN: Team-of-agents, A multi-role SDLC orchestrator for Claude Code

https://github.com/pranav8494/team-of-agents
1•pranav8494•4m ago•0 comments

Give coding agents real product context so they stop guessing

https://docs.storiesonboard.com/en/articles/14625286-storiesonboard-model-context-protocol-mcp-se...
1•tomusm•5m ago•0 comments

Xcode15 Deprecation in Semaphore

https://semaphore.io/announcement-xcode15-deprecation-in-semaphore
1•ilreb•5m ago•0 comments

Show HN: Kapbit – A Kafka-powered workflow orchestrator for Go

https://github.com/kapbit/kapbit-go
1•ymz_ncnk•6m ago•0 comments

What Happened to Hetzner Pricing?

https://www.hetzner.com/de/dedicated-rootserver/matrix-ex/
2•_nhh•7m ago•3 comments

WebKit Features for Safari 26.5

https://webkit.org/blog/17938/webkit-features-for-safari-26-5/
1•ksec•8m ago•0 comments

TanStack NPM supply-chain incident: browser-only lockfile scanner

https://quarkassistant.github.io/tanstack-lockfile-check/
1•jabbah•9m ago•0 comments

What if the browser was the server?

https://arthurcornil.com/blog/ship-it-to-the-user/
2•quirissum•9m ago•2 comments

BoundaryX – On-chain cricket prediction market on Polygon

https://boundaryx.co/tournament
1•angad_s•12m ago•0 comments

Organising the First English-Language Jubensha Convention

https://mssv.net/2026/05/12/on-organising-the-first-english-language-jubensha-convention/
1•adrianhon•12m ago•0 comments

Go fuzzing was missing half the toolkit. We forked the toolchain to fix it

https://blog.trailofbits.com/2026/05/12/go-fuzzing-was-missing-half-the-toolkit.-we-forked-the-to...
1•ingve•13m ago•0 comments

Show HN: Music visualizers that react to audio in real time

https://vizz.fm/app/
1•lowtecky•13m ago•0 comments

Canvas hack: company pays criminals to delete students' stolen data

https://www.bbc.co.uk/news/articles/cdepzg83x87o
2•GaryBluto•14m ago•0 comments

Making cross-platform SIMD code pleasant

https://bkaradzic.github.io/posts/typeless-simd/
1•fanf2•20m ago•0 comments

FMS – A Groovebox for the Nintendo Game Boy Advance

https://lo-bit.club/fms
1•natebc•22m ago•0 comments

Subvert.fm – a co-op music platform – launched today

https://www.subvert.fm
2•MK2k•22m ago•1 comments

Show HN: Agent Harness with Prolog and WASM core incl. 90s Borland-style TUI

https://www.deepclause.ai/
2•schmuhblaster•23m ago•0 comments

I/O Multiplexing: select(), poll(), and epoll() Explaination Extended

https://0xkiire.com/io-multiplexing-guide/
1•kiirecodes•25m ago•0 comments

Building a GUI Library from Scratch

https://0xkiire.com/gui_guide/
2•kiirecodes•26m ago•0 comments

The Geometry of Reasoning and Learning in the Age of AI [video]

https://www.youtube.com/watch?v=82eqQ6oEDi4
1•chrsw•27m ago•0 comments

Refunds are a proxy for regret your marketing should measure

https://zencapital.substack.com/p/refunds-are-a-proxy-for-regret-your
3•zenincognito•27m ago•0 comments

How driving test booking is changing for learner drivers

https://www.bbc.co.uk/news/articles/ckgpl9zdw3po
1•YeGoblynQueenne•28m ago•0 comments

CNCF TOC votes in favor of OTel Graduation

https://github.com/cncf/toc/pull/2134
1•hyzyla•28m ago•0 comments

PEP 661 – Sentinel Values, accepted 5 years later

https://peps.python.org/pep-0661/
2•PaulHoule•31m ago•0 comments

ESA and JAXA team up on planetary defence, Ramses mission to asteroid Apophis

https://www.esa.int/Space_Safety/Planetary_Defence/ESA_and_JAXA_team_up_on_planetary_defence_Rams...
1•rustoo•36m ago•0 comments