Database Transaction and Security
Database Transaction and Security
Rating:
First of all, we need to understand
The databases that support transaction are known as transactional databases. Most of the modern day relational databases support transaction.
A single transaction may require many SQL queries to execute to change the current state of the database. It is also important that all the queries be executed. For example, if money is transferred from one account to another, then in this scenario, the account from which the money is taken out should be debited and the account to which the money is deposited should be credited.
A transaction is issued to the database using SQL (structured query language) and has the following stages:
- A transaction begins.
- Execution of queries to change the current state of the database.
- After the successful execution of all the queries, a transaction is committed, i.e. the changes are saved permanently.
- Atomicity
- Consistency
- Isolation
- Durability
A majority of relational databases that we use provide support for transaction logging. Transaction logging is a process in which each transaction committed against the database is logged and the original value of the data is stored. When a SQL query gets executed to change the values in the database, then the original data values are stored in the transaction log. These values are stored so that the database can be recreated using these values in case a transaction fails. A transaction log keeps on storing the original data values until a transaction is committed or rolled back.
Another important aspect of transaction processing is locking. For example, if a user begins a transaction and performs an action that causes to lock a certain portion of the database, then no other user is allowed to access the locked data until the transaction is completed.
The database security is of great importance and a major concern for any organization. Securing the data from people of malicious intent, accidental damage, catastrophic damage is a great challenge for a Database Administrator. The Database Administrator decides the level of security keeping in view the sensitivity of data. There are different levels of security.
At the lowest level of security, there is no restriction, i.e. everybody has full access to the database. This level of security is implemented where there is already network security through which access can be restricted. In such type of scenario, there is no need to duplicate the security scheme.
The next level of security is
After this level comes
In addition, in order to restrict the access of the database, the Administrator might want to track the details about what the users have done on the database or who logged on to the database, etc. The requirement of keeping such audit trails varies from organization to organization. Suppose the Database Administrator might want to keep the details about who logged and logged off, then a single entity with the attributes UserName , LogOn , and LogOff will probably suffice the purpose.
Keeping track of deletions can be more complex. The Database Administrator has a couple of options here. He can prevent users from actually deleting records at all and set a Deleted flag instead. This is a useful technique if he wants to copy the records to an archive file before removing them from the database.
After modeling the audit requirements, the Database Administrator needs to restrict access to the audit tables.
Rating:
Other articles
- What is a foreign key?
- What is the setTransactionIsolation() method?
- What is the setQueryTimeout() method?
- What is an integrity constraint?
- What is data integrity?
