ADVANTAGES Use STORED PROCEDURE





 Frequency of access (SELECT) on table


If users frequently access the pelangganid, name and telephone customer table then it should be partitioned into 2 pelanggan_part1 (pelangganid, name, phone) and pelanggan_part2 (pelangganid, address, city, province, birthday,, jeniskelamin). Pelanggan_part1 table size will be much smaller than the table pelanggan_part2 and customers so that the process will be faster SELECT query. For more details can be read in the book Database system concept works henry korth chapter 12 concerning the calculation of the query cost.


 Locations users who access the table


Suppose that the user databases spread in the city of x only able to see customer data of x then the table can be partitioned horizontally modification from single server to multiple servers (distributed databases) has been described at the point of visibility horizontal table normalization and denormalisasi To increase performance or fix the structure of the table then denormalisasi normalization process and can be done. During the sp interface used to access the table does not change the client application does not require to change. Sp interface in question is the name of the sp, sp the number of parameters, the obtain parameter and the parameter data type.
• Security
a. Stored procedures prevent SQL injection.
To access data, you should use stored techniques that havethe parameters. The use of these parameters to ensure that input values ​​are checked for type and length. Parameters are also handled as a safe value and not the executable code in the database. If you can not use stored procedures, use SQL statements with parameters. Do not build SQL statements by concatenating input concepts ​​in a SQL command. Make sure the application gives access rights to the database only as needed.
b. Access rights stored procedure to the data in the database depends on the permissions creators rather than relying on user access rights stored procedures. This allows a user application to not be given access rights to all tables that exist but were given access rights to run the stored procedure. Due to the use of this mechanism is the enforcement of user activity (select, inser, update, delete) even for centralized applications such as query analyzer will not be used to access data illegally.
c. The use of stored procedures support the use of application roles.Application role is a role in SQL 2k server where this role has no users. This mechanism is a standard process recommended by Microsoft to create a database application based on SQL Server 2k. The benefits of this use of the application part is to use it then only our app that other applications can access the database unless the user can not login using the berrole sysadmin.
d. Copyright safety. stored procedure can dienkript so the process can not be easily hijacked people.
e. Allows audit manual is excellent. Manual auditing is defined as audit logging mechanism in which the application is not made by dbms.Indeed, the manual audit can be performed without the use of the stored procedure manually but suppose the audit can be bypassed by using query analyzer. With stored procedures and application features role then manually audit process can dienforce any time.
• Flexibility to changes in business processes
Stored procedures are stored on the server.Modifications easily carried and quickly.
 • Economy
Stored procedures provide an entry for the data entry process. Application client live mengaksesnnya. Stored procedure is created one time and can be accessed by client applications are different. Efficient and inexpensive

Artikel Terkait


Category Article

What's on Your Mind...