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?

Planar maps: an interaction paradigm for graphic design (1989) [pdf]

https://www.lri.fr/~mbl/FundHCI/papers/Baudelaire-CHI89.pdf
1•tliltocatl•36s ago•1 comments

HuggingFace launches pre-compiled machine learning kernels repository

https://huggingface.co/changelog/kernels
1•embedding-shape•45s ago•0 comments

Battery storage is now cheap enough to unleash India's full solar potential

https://ember-energy.org/latest-insights/battery-storage-is-now-cheap-enough-to-unleash-indias-fu...
1•xbmcuser•49s ago•0 comments

Oracle taps Bloom for 2.8 GW of fuel cells to keep datacenter binge going

https://www.theregister.com/2026/04/14/oracle_bloom_fuel_cells/
1•Bender•1m ago•0 comments

Use Claude, ChatGPT, or MiniMax Subscriptions in Cursor

https://open-vsx.org/extension/orchidfiles/ungate
1•theorchid•2m ago•0 comments

Show HN: Fakecloud – Free, open-source AWS emulator

https://github.com/faiscadev/fakecloud
1•lucas_vieira•3m ago•0 comments

Show HN: Multi-Agent Orchestration on Top of Vercel AI SDK (TypeScript, Next.js)

https://github.com/JackChen-me/open-multi-agent/tree/main/examples/with-vercel-ai-sdk
1•JackChen_me•3m ago•0 comments

I ran 90 queries through 8 AI models. 86% of findings were unique to one

https://parallect.ai/blog/divergence-study
3•primeobsession•3m ago•0 comments

Manage VS Code Extensions Like Packages with Posit Package Manager

https://posit.co/blog/manage-vs-code-extensions-like-packages-with-posit-package-manager-2026-04-0
1•nodivbyzero•4m ago•0 comments

Autoresearch Applied at Shopify

https://shopify.engineering/autoresearch
1•austinbaggio•6m ago•1 comments

I Did My Taxes with Claude

https://doempke.com/taxes-with-claude/
1•robk•7m ago•0 comments

I got my React SPA to 95/100/100/100 on mobile PageSpeed

https://sudorank.com/blog/pagespeed-optimization/
1•iambala•7m ago•0 comments

Gemini 3.1 Flash TTS – with directed prompts

https://simonwillison.net/2026/Apr/15/gemini-31-flash-tts/
1•aanet•9m ago•1 comments

Agents Can Act.Only You Should Authorize

https://github.com/nametaginc/nametag-a2h
1•manish198903•9m ago•0 comments

What it's like to house-hunt in Silicon Valley (2015)

https://www.washingtonpost.com/business/economy/what-its-like-to-house-hunt-in-silicon-valley-the...
1•downbad_•9m ago•1 comments

Attention IS NOT all u need

https://github.com/Elgoghel/hwta-circuits/blob/main/README.md
1•Elgoghel•9m ago•0 comments

Show HN: Hatch: customise agents once, generate all the files

https://github.com/matryer/hatch
1•matryer•10m ago•0 comments

Google Broke Its Promise to Me. Now ICE Has My Data

https://www.eff.org/deeplinks/2026/04/google-broke-its-promise-me-now-ice-has-my-data
2•Brajeshwar•11m ago•0 comments

Spotted a bear lately? You're not alone–why sightings are on the rise

https://cssh.northeastern.edu/spotted-a-bear-lately-youre-not-alone-why-sightings-are-on-the-rise/
1•PaulHoule•11m ago•0 comments

Show HN Deskdrop: An Android Keyboard with Local AI Support (Ollama, LM Studio)

https://github.com/SvReenen/Deskdrop
1•SvReenen•12m ago•0 comments

Snap Is Laying Off 16% of Full-Time Staff as It Embraces A.I

https://www.nytimes.com/2026/04/15/business/snap-layoffs-snapchat.html
4•xnx•12m ago•0 comments

Lyra 2.0: Explorable Generative 3D Worlds

https://arxiv.org/abs/2604.13036
1•aanet•14m ago•1 comments

The Security Decisions Claude Code and Codex Make

https://amplifying.ai/research/ai-security-decisions
1•edwin•15m ago•0 comments

Introducing Cloudflare Mesh

https://developers.cloudflare.com/changelog/post/2026-04-14-cloudflare-mesh/
2•ransom_rs•17m ago•1 comments

Moss-TTS-Nano: Real-Time Voice AI on CPU (Open-Source TTS Stack)

https://firethering.com/moss-tts-nano-open-source-tts/
1•steveharing1•17m ago•0 comments

Ask HN : Vibe coders: does AI keep breaking your auth and webhooks?

https://www.indiehackers.com/post/vibe-coders-does-ai-keep-breaking-your-auth-and-webhooks-b9e869...
2•siddhant-jain•18m ago•1 comments

Watching TV with the Second-Party: A First Look at ACR Tracking in Smart TVs (2024)

https://arxiv.org/abs/2409.06203
2•redbell•18m ago•0 comments

Show HN: Slack killed their OpenAPI spec, so we reverse engineered it

https://github.com/connectstrata/slack-openapi-generator
1•jmclai•19m ago•0 comments

Ask HN: What do founders want from a one person dev studio?

1•Punyakrit•21m ago•1 comments

Ask HN: What's your favourite business oriented movie?

3•wasimsk•21m ago•4 comments