[Repost] Grouting to Borland and N-Tier

zhaozj2021-02-16  55

This post is http://borland.mblogger.cn/catchbug/posts/2927.aspx

Compliance with Borland and N-Tier

Compliance with Borland and N-Tier

Yesterday I repossed a copy of my friend Smartkid classmates, SMARTKID students analyzed the rationality and feasibility of thin customers in enterprise applications from the perspective of practical application value and rationality.

Today I will post my serious dissatisfaction with the middle layer of Borland Midas.

We all know that Delphi has the ability to develop N-Tier programs, but I don't think there are several system analysts to carefully consider this architecture in practical applications and restrictions on the current system analysts now. Many masters have tracked various trends and busy upgrading their applications to a variety of architectures. But rarely explore the nature of the latest architecture. Many masters are exploring various models, how to program is convenient, but rarely analyze their hard work. Write procedures, studying various technical trends just to make programs do not have value? Return The topic, continue to say that N-Tier and Midas Li Wei master's Delphi5 multi-storey development ... one book, has been writing a comparison of DCOM and Socket Connection, DCOM's connection speed is slower than Socket Connection, However, after the connection is completed, the transfer data is fast than SocketConnection. And do some test data is slower. Here, I have to say that the above comparison is completely meaningless, and the data tested is meaningless. Why? Below is your own point of view.

The DCOM Connection is network penetrating, and DCOM Connection is a small connection method developed for Windows Workgroups and does not support TCP / IP networks. The gateway is not supported. Considering future network applications will go to remote, large applications, DCOM Connection is a product that is eliminated (maybe have been eliminated, I rarely see someone using this connection method to develop N-Tier programs) MS has not developed DCOM in two years, from this perspective, DCOM was eliminated by MS. After 2000, MS was made into the Web Service's speculation.

WEB Connection Good product? Why do we use WebConnection? Do you all know how to penetrate various gateways? We all know that the web connection has escaped through the HTTP transmission of the 80-port, but its negative impact is the enterprise application. The overall decline, your application is just running in the customer, maybe the effect is good, do you think that after 1 or 2 years, the data in the customer server is increased, and the data result is queried in the number M size. And we have to use HTTP flows and not saving bandwidth binary flows. Think of this, do you want to consider the hot-fried advanced XML format to transfer data results I don't dare, my distinguished customer's server now There is already 10G data. In the next 3-5 years, it is estimated to increase to 30-40g. I don't think about 3 or 5 years, the customer calls me to call me to change the program.

Is Socket Connection? From the previous application needs and future application prospects, yes. Tuxedo is doing this, but it is still making big money. But Borland is designed to design the Socket Connection architecture to be too sloppy and Horses. Directly caused the innate shortcomings of Socket Connection. After analyzing the Socket Server source code provided by Socket Connection, you will find that this requires high-performance products actually use asynchronous SELECT network model. This model is for every one. The client connection must establish a thread, more terrible is that the message between the client and the server is passed through the most unreliable message on the MS Windows. I can make a simple flow chart may be more imageable. Express this architecture.

Client initiates a connection request -> Server ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -------------------> Server establishes the connection thread, create a proprietary RemoteModule server for this customer connection

The client requires a server to perform a method, query a data -> Server Socket -> Send a Windows message to the SocketServer main thread -> Server Connect Thread Sorting Message -> Analyze the Packet to find the interface method to perform the customer's requirements -> COM server, execution method -> Back to the first packet to the client -> Client Send a response to the server -> Server Socket -> Send Windows Messages to SocketServer main thread ............ .................

This model has two major drawbacks: 1: The connection limit is limited in this mode of operation, if the number of Windows system is more than 200, the efficiency will be greatly reduced, and Windows will pay a lot of working hours to the context switching thread. As the connection increases The CPU usage will grow rapidly.

2: The performance and reliability of packet transmission In general, on the Windows network, the size of the TCP / IP protocol is the size of the TCP / IP protocol is 4K (related to Winnt's 4K memory paging) that is said to query 4M from the server. The data results are submitted to the client, and the client wants to throw 4M / 4K = 1000 data request messages to the server. This 1000 messages are connected to the threaded column by the Socket Server message queue. We know that Windows messages have a slow response, may be lost, and unreliable feature in the application message response speed is affected by the CPU usage. These adverse features directly affect the stability and data reliability of the Socket Server work.

Write here, I want your heart to generate fear on the application of Socket Connection. The reliable code we wrote is likely to be done by this unreliable socket server. If you use the socket server, I suggest you don't want the most It is better to put this program on a server that is better than a performance, don't think that the database server can be very important in the performance of this intermediate server.

Summary: It is true that we can use the Socket Connection mode and require customers to provide our MIDAS app. But I have to say: For customers, they don't know where they need to be powerful. Server. It is most likely that customers are likely to be a small company, and there is no sufficient funds and budget to meet your proposed purchase list. You may use the way to use the initial period, let customers use the cheap server, wait until the application is running for a while, then goes to buy a better server, I think this kind of work attitude is for customers. It is the customer's most unwanted customer, the network operation maintenance engineer is most afraid that the server performance is not enough to cause the network to run, once the data is misrehold, it is not just the customer's data, and the customer's software Trust in the product. For our developers, making this program is very irresponsible, you may not want to see your hard code, maybe this application, maybe you will see it, you have made it yourself. The procedure makes you headache. I remembered that there was an old saying in China, lifting the stones and smashed their own feet. From this project, I really got the benefits, perhaps only sell Midas Borland sales staff.

Pure personal opinion, the viewer does not post to other situations, thank you

WANGHS

June 20, 2004 8:00

转载请注明原文地址:https://www.9cbs.com/read-20811.html

New Post(0)