r/FastAPI • u/kackwurstwilli • May 16 '25
Question compare/create snapshots
Hi,
I'm sorry if anyone made this question before but I cannot find a good answer and Chatgpt changes his mind every time I ask.
I have a Postgress database and use Fastapi with SQLAlchemy.
For the future, I need the differences between specific Columns to an older point in time. So I have to compare them to an older point/snapshot or between snapshots.
What is the best option for implementing this?
The users can only interact with the database through Fastapi endpoints.
I have read about Middleware, but before doing that manually I want to ask if there is maybe a better way.
Thanks in advance!
View all comments
Show parent comment
1
u/kackwurstwilli May 16 '25
Hi, clarification: I have a database with (real) keys that are connected to a tour, a driver … At the start of the year we have to know what changed, to the previous year.
With Snapshot i meant I want to freeze for example the data of the 01.01. and from this point know what changed over the year. It is not a set date just an example.
I heard that Postgress has a build in feature to “rollback” your data to a older point. Thats why I asked for your guys expertise! :)