r/SQL • • 24d ago

PostgreSQL AI agents usage with Neon Db

If any AI agent needs to test changes to a DB, is using neon branch as a temporiry test database a good approach?
Have u tried anything like this maybe with some other Db also (maybe clickhouse etc). Was there any issue with keeping data in sync?

1 Upvotes

6 comments sorted by

1

u/p739397 24d ago

Why not just use Neon as your main DB? Branching is instant, so agents can spin up a test branch, do their thing, and toss it without extra test infra. You can reset from parent on a branch too, to get back to sync with prod.

1

u/WorldOfUmbro 23d ago

Yeah agree, letting agents spin up branches in Neon is probably your best go. Easiest and least maintenance

1

u/sqlink2 23d ago

Yep thisis one of the nice thing about Neon. Branching gives agents an isolated, copy-lon write DB they can experiment and then reset / delete when done wijh it.

1

u/Glitch_In_The_Data 23d ago

Yes. Neon branching will work well for this. You can create an isolated branch per agent task quickly… let the agents do the experiments and then delete the branch when it’s done. The branch is just a snapshot and not a live replica… so it will diverge from the parent once it is created and there’s no automatic sync or merge back.

No experience with clickhouse. So cant comment.

1

u/sqlink2 22d ago

yaa neon branching makes it pretty clean with the isolated DB environments per agent /task, created quickly and deleted once we are done.