How can I ensure the records in a database can not be altered by other than the middle tier software (e.g. discourage the DBA of changing values)?
I want to implement a simple multi-tier accounting program using open-source stack. The primary function of the application is to track money paid for one product. The main part of the data model is basically this:
CREATE TABLE ACCOUNT_LOG(
USER_ID NVARCHAR2(128), /* user identifier of some sort */
TIMEST TIMESTAMP, /* the UTC timestamp of the payment. */
PREV_AM NUMBER(13,3), /* the previous money level. */
DIFF_AM NUMBER(13,3), /* the the money delta (+/- possible) */
NEXT_AM NUMBER(13,3), /* the new money amount. */
UOM NVARCHAR(20) /* the money type (Euro, Dollar, etc.) */
CONSTRAINT pk PRIMARY KEY (USER_ID, TIMEST));
However, this structure is vulnerable to a DBA, as he/she can go in and change amounts for various persons or put in unauthorized money increases.
How can I ensure, that the data in this table can 'only' be altered by the middle tier software (e.g. detect alterations of other means)? Note that I'd like to use an open source DB engine, as my program should be as cheap as possible.
I have my own ideas (dirty ways), but I'd like to hear your opinion/best practice. Also, please feel free to ask for further details if necessary.
Thank you for your time.