Quantcast
Channel: FiveTech Software tech support forums
Viewing all articles
Browse latest Browse all 27092

FWHMARIADB Samples

$
0
0
[b:2p63vbxq][size=150:2p63vbxq]FWMariaDB -:- ADO -:- Dolphin/TMySql[/size:2p63vbxq][/b:2p63vbxq] [u:2p63vbxq][b:2p63vbxq]Performance and other considerations:[/b:2p63vbxq][/u:2p63vbxq] When we consider developing a new MySql application, the first thing we may need to decide is whether to use. 1. ADO or 2. libmysql.dll/libmariadb.dll based library. 3. Multiuser Application on WAN/Cloud ? [b:2p63vbxq]1: Advantages of using ADO[/b:2p63vbxq] ADO offers good and reliable performance and is a well-tested product. It is also highly scalable and suits large muti-user applications. If the application is required to be adopted to different RDBMSs like MySql, MSSql, etc., it is desirable to choose ADO, because a major part of the code is portable. [b:2p63vbxq]1: Disadvantages of using ADO [/b:2p63vbxq] It requires installation of ODBC driver on every client PC. When the installation is to be done on several PC’s and the PC’s are having different version of Windows operating system then things become further more difficult. For eg. If you try to install MySQL ODBC driver on a Windows Xp PC, the installation may fail half way due to the missing Microsoft VC++ redistributable. You need to find out the right version of MS VC++ redistributable for your operating system. To summarize, it is an administration overhead when we have more number of PC’s. [b:2p63vbxq]2: Advantage of using DLL based libmysql.dll/libmariadb.dll based library [/b:2p63vbxq] DLL based application is easier to deploy. You don’t need the ODBC driver installed on the client PC’s. You just need the DLL to be there on the same folder containing your application exe [b:2p63vbxq]2: Disadvantage of using DLL based libmysql.dll/libmariadb.dll based library[/b:2p63vbxq] The application will be limited to MySql only forever. [b:2p63vbxq]3: Multi-user application on LAN/WAN/Cloud? [/b:2p63vbxq] Effects of an ill-optimized program are not much visible in a single user environment on local host but hit the performance in multi-user environment when used on WAN/Cloud. While the programmer is basically responsible for optimizing database design and optimizing every query for least cost (burden) on the server, the library also has to support. Very important requirement is to place least burden on the server and the network traffic. [b:2p63vbxq]ADO always is good for this purpose. [/b:2p63vbxq] [b:2p63vbxq]DLL based libraries:[/b:2p63vbxq] TMySql is the first dll based library which enabled (x)Harbour programmers to work with MySql/MariaDB servers for the first time. Later Dolphin came up with greatly enhanced features and also new features like embedded server and secured connectivity. FWH libs are designed to produce high-performance applications in small to huge multi-user environments, supporting large corporate practices like server-side scripting and even providing some features that are not possible with ADO and others. [b:2p63vbxq]Test program:[/b:2p63vbxq] This sample compares the three main choices, ADO, FWH libs and Dolphin in this regard. [b:2p63vbxq]maria14.prg[/b:2p63vbxq] [code=fw:2p63vbxq][/code:2p63vbxq] This application connects to the same server using all the 3 libs, i.e., ADO, FWH and Dolphin, reads a table with about 50,000 rows and places them in three browses. (Dolpin is used to represent both dolphin and tmysql). [url=https://imageshack.com/i/pnZt7bwsp:2p63vbxq][img:2p63vbxq]http://imagizer.imageshack.us/v2/xq90/923/Zt7bws.png[/img:2p63vbxq][/url:2p63vbxq] This is the screen-shot immediately after connection and display of the browses. The three browses also display time taken to read the table, save modifications, sorting and also the network traffic/load on server by the operations. [b:2p63vbxq]NetWork Traffic/Server Load[/b:2p63vbxq]: This is the volume of data the server generates and then the network carries from server to the client. [b:2p63vbxq]Connection and read Times:[/b:2p63vbxq] Dolphin connects to the server faster than ADO and FWH. Dolphin loads data from server faster than ADO and FWH ( 3.34 seconds to 4.4 seconds) [i:2p63vbxq]Note: FWH RecSet class loads faster but has less features than RowSet class.[/i:2p63vbxq] Load on Server/Network Traffic: 6 MB in all cases, representing the volume of data served by the server. [b:2p63vbxq]Sorting Times and load on Server/network[/b:2p63vbxq] Now let us try clicking on headers of the 3 browses to test sorting speeds. ADO sorts fastest. While both ADO and FWH sorts in well less than one second, Dolphin takes 3 seconds, i.e., almost as much time as taken for reading the entire recordset. The reason is that while ADO and FWH sort the data in the memory of the client, Dolphin reads the entire data again from the server each time. Both Dolphin and TMySql have the same behavior. This approach increases load on network and the server. Each time the user sorts a column, Dolphin not only takes maximum time, but also places additional burden on the server and network by 6 MB each time. [i:2p63vbxq]Note: FWH is working on improving sorting speeds to match ADO. [/i:2p63vbxq] This is the screen-shot after sorting one column in all 3 browses: [url=https://imageshack.com/i/pmcHeYUrp:2p63vbxq][img:2p63vbxq]http://imagizer.imageshack.us/v2/xq90/922/cHeYUr.png[/img:2p63vbxq][/url:2p63vbxq] Editing and Saving times and Load on Server/Network Let us now try edit and modify 10 cells in each of the 3 browses. In the case of ADO and FWH, time taken to save each modification is far less than one second. Total burden on network and server is only a few KBs. In case of Dolphin, each modification took around the same time as reading the entire table and genertes additional network/server load of 6 MB each time. For the 10 modifications 60 MB. This is the screen-shot after editing 10 cells in each of the browses: [url=https://imageshack.com/i/pmkyZ0mFp:2p63vbxq][img:2p63vbxq]http://imagizer.imageshack.us/v2/xq90/922/kyZ0mF.png[/img:2p63vbxq][/url:2p63vbxq] [b:2p63vbxq]Incremental Filters:[/b:2p63vbxq] All the 3 browses are configured for incremental filtering on the field "street". Both ADO and FWH do the filtering process in client's memory and fast. For this reason there is no burden on the network/server. In case of Dolphin, every keystroke including backspace, generates a new query with where clause, resulting in 3 seconds delay and additional burden of 6 MB for every keystroke. [b:2p63vbxq]Effects in a multi-user environment:[/b:2p63vbxq] Imagining a multiuser environment of say 100 users using the application, each user on average modifying 100 rows, sorting 20 times, incremental seeeks with 50 keystrokes. ADO and FWH place an addition burden on the server/network traffic by around 500 KB only and that too only for saving data and retrieving modified row data. [b:2p63vbxq]Dolphin on the other hand places an additional burden of 102 GigaBytes on Server and Network each for the same work, as against 500KB only by ADO/FWH. [/b:2p63vbxq] [i:2p63vbxq]100 * ( 100 + 20 + 50 ) * 6 = 102,000 MB = 102 GB.[/i:2p63vbxq] Download link:

Viewing all articles
Browse latest Browse all 27092

Latest Images

Trending Articles



Latest Images