You are not logged in.
Pages: 1
In mORMot, do you use triggers and all other SQL stuff, or you should do it in Delphi?
I'm not asking if you can do it, but if you are expected to do it
Offline
I try to implement persistence agnoticism, and one way of doing it is to put the logic not in DB but in code.
So triggers and such are not in SQL/ORM, but in code.
The notion of "Aggregate" is the key for that. It breaks the relational model by duplicating the data into each use context, with enough data for each context.
Then if you have to synch information between the contexts, I would use the notion of "events", then spread them using a publish/subscribe mechanism: each context will subscribe to the data change from other contexts, and react in its own database.
Our interface callabacks feature in SOA is the best way of doing it. It could be pretty efficient. Each context is its own Micro-Service, with its own local storage (mainly SQLite3).
As a result, the DB is not the center any more. There are several DB, which just reflect the data at a given state, sometimes all states of data (in an event-driven design).
In a nutshell: I don't create any trigger, ever, in DB.
As a side effect, it eases testing and maintenance, and it also allow to use NoSQL storage if needed (or if it is more efficient).
Offline
Thank you very much; that has helped me a lot
Offline
Pages: 1