I've got a REST interface to a database, implemented in Python FastAPI + SQLAlchemy. I want to run some (relatively) costly operations on my data, such as calculating cryptographic hashes or signatures. My hope is to be able to:
I'd prefer to have a cross-database solution, but it seems running a trigger on insert/update might be the way to go. If so, my target in production is PostgreSQL.
Does anyone have a suggested approach they'd favour?
I would try to separate the concerns.
Running a trigger would do the actions synchronously. As far as I understand this is not your intention.