In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces you how to understand the SQL Server data system and application logic, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Many people have used SQLServer database, but few people really understand SQLServer data architecture and application logic. in fact, in many new enterprise system designs implemented in SQLServer, system designers need to make critical decisions on the positioning of data structures and management application logic. The following editor will explain how to apply the SQLServer data system and application logic.
How to apply SQLServer data Architecture and Application Logic
With TSQL, developers can create a save process that encapsulates data access with a block of code that is reusable, precompiled, and has its own license settings. Each table in the database has a special set of saving procedures called triggers. Trigger is "triggered" when a specific database event (such as Insert, Delete, or Update) occurs in the underlying database. With triggers, developers can write event-based transaction logic so that Insert, Delete, and Update events for a given table can drive changes in other tables.
Now that we have this flexibility, why not write as much logic as possible in TSQL?
Using TSQL to develop application logical storage
TSQL can be used not only as a logical repository for a single application, but also as a logical repository for groups of applications that access the same data-for several logical reasons. Through centralized processing of data and rules for managing data in SQLserver, you can configure a security system in which applications cannot access the underlying database until they have passed the transaction rules.
This is a common database example for most two-tier client-server applications. The system gives all transaction logic and data access to the back-end server and rich presentation logic to the client. The customer manages the view of transaction processes and data, but does not process transactions other than display locally. If all the transaction logic is put into a central warehouse, then the system has the potential to reduce management costs, but this will pay the price of reduced testability.
I recently approached a customer who spent hundreds of man-months (one person working for a month) and thousands of dollars to design a very complex application that uses TSQL to manage all the application logic. Although the system is very ingenious and works well with 10 to 15 users, if you have 20 users, it is very slow. By adding processors to SQLserver, the system can allow 60 users to use it at the same time. But this is still a long way from the design goal of 100 users, which makes it impossible for the company to launch the application on the Internet. Because stored procedures and trigger can only manipulate local data, the company cannot break down the application into multiple SQLserver to improve testability. As a result, the company had to modify it on a large scale.
How to apply SQLServer data Architecture and Application Logic
Using .NET classes in application logic
The problems found by the above company after a period of twists and turns, most architects will re-recognize during the architecture design phase that application logic contained in an n-tier architecture of a set of .NET classes can increase the flexibility and testability of the application. Because TSQL is a language for managing data, it is not flexible enough, but we can still write complex transaction logic in TSQL.
If developers use the .NET Framework, they can make their own language choices when developing core transaction processes. This flexibility allows you to make the most reasonable matching of application requirements with development languages or resources. And if properly developed, the objects that seal these transactions can run on multiple machines and share the same underlying database server. SQLserver can handle a large number of concurrent requests independent of the logic of handling TSQL transactions.
Row operation (rowoperation) and set operation (setoperations)
One of the guidelines for determining whether to use row operations or set operations when planning the architecture phase is to use set operations if you use TSQL and row operations if you use .NET. Providing large amounts of data over a network connection can affect the overall performance of your application, so it makes sense to use server to process them whenever possible. But from a memory and processing power point of view, SQLServer's cursor is a very expensive object, so it generally doesn't make much sense to create a pointer to traverse all the records in the collection and process them in turn.
When you need to perform row-based processing that includes complex program logic or operations that take up a lot of CPU, you should query the rows from server and process them in the middle tier.
If you want to use an example to see how to encapsulate data access logic into a middle-tier object, download the data access application module from MSDN. This is a code-providing, reusable data access subsystem that you can use to write your own database or data access objects for feature applications.
By creating a reusable .NET application framework to handle most application logic and using TSQL-based save procedures as security restrictions and mechanisms for server-side set operations, you can create applications that have the advantages of both TSQL and .NET.
On how to understand the SQL Server data system and application logic to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.