1 / 4

Where to do the programming?

Where to do the programming?. Programming in the database language vs. Programming in the application language. Programming in the database language vs. the application language. Programming in the database language Stored procedures User-defined functions Triggers

aelwen
Download Presentation

Where to do the programming?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Where to do the programming? Programming in the database language vs. Programming in the application language Where to do the programming?

  2. Programming in the database language vs. the application language • Programming in the database language • Stored procedures • User-defined functions • Triggers • Programmed using a vendor-specific programming language • Microsoft T-SQL • Oracle PL/SQL • Etc. • Programming in the application language • C#, Java, etc making SQL calls directly • Called dynamic SQL Where to do the programming?

  3. Programming abstraction • Databases must to be extensible • Adding new columns to existing tables • Adding new tables to existing databases • Changing the database means changing the application • If SQL is used in the application • Solution: The database should be encapsulated by an API • The API can be programmed in the database or in the application language • Database languages live as long as the database • Application languages has shorter lives • Source • Paul Nielsen: Why use Stored Procedures? Blog • http://sqlblog.com/blogs/paul_nielsen/archive/2009/05/09/why-use-stored-procedures.aspx Where to do the programming?

  4. Technical reasons for programming in the database • Faster execution • Stored procedures etc. Are compiled once and executed many times • Less network traffic • With a single request/response the stored procedure can do a lot of work • Security • User can use the stored procedures without having any right on the base tables • Protection from SQL injection attacks • Stored procedures should check parameters • Source • Wikipedia: Stored procedure: Comparison with dynamic SQL • http://en.wikipedia.org/wiki/Stored_procedure#Comparison_with_dynamic_SQL Where to do the programming?

More Related