Solved

Stand-alone to client/server application (how to run stand-alone app on local network)

Posted on 2003-10-28
13
612 Views
Last Modified: 2010-04-05
I have all ready done stand-alone Accounting Application. I am using Paradox databases and Delphi enviroment. Which is easiest way to run (convert) stand-alone as a client/server (or how to run my application on local network - 5 users)?  
0
Comment
Question by:agim_bekaj
  • 4
  • 3
  • 2
  • +2
13 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 168 total points
ID: 9634877
There is no easy way. Certainly not with Paradox because the BDE isn't performing very well in a multi-user environment.
It is nice that you now have a stand-alone application but a C/S application often requires a redesign from the ground up. Why? Because the required techniques are different if you still want to keep a high performance. You see, in a stand-alone application it's not a real problem opening tables with large amounts of records. In a C/S environment 5 users who all look at the same huge table will put quite a lot of stress on the server. And of course they could get in each others way by having a record locked that another user also wants to access. (And the BDE is quite bad in locking records.)

So, for C/S applications you'll need a better database. MySQL or InterBase (Firebird) are the cheapest solutions since both are free. Access is an alternative if you already use MS Office. Or perhaps a more industrial database system like MS SQL, DB2 or Oracle. Anyway, you'll have to move to using SQL in your application.
The connection to the database will also have to change. You could use the native InterBase components for InterBase, DBExpress for MySQL and a few other databases or ADO for almost every database system. ADO is very useful if you want to connect to Access or MS SQL, btw.
Next will be the number of tiers you want to use. If you just want one database-tier and the client-tier then all you have to do is upgrade the database. But in many cases a middle-tier is introduced that can perform some preparations on the data you want to exchange with the database. It can also be used for user validation and other purposes and best of all, it makes sure users don't have a direct connection to the database. (Which requires them to use your application instead of opening a Database Explorer tool instead. If you want to create such a middle-tier then you will have to redesign from the ground up. Otherwise you could just change the BDE components into e.g. the ADO components and still keep your application as it is right now.

With a middle-tier you have to think about the communication methods between the middle-tier and your client application. And perhaps you want to cash some information from the database on the middle-tier so you don't have to access the database all the time. Cashing can increase the performance quite well, btw. Now, about those communication methods... You have DCOM, CORBA, COM+, SOAP, Midas and of course just raw TCP/IP sockets available for all this communications. Actually, there are so many techniques that it's better to just study on them first before starting on creating a middle-tier. Better move your database over to a better database system first.

Good luck.
0
 

Author Comment

by:agim_bekaj
ID: 9634996
What about: Apollo Database Server, Advatage Database Server or NexusDB
0
 
LVL 6

Expert Comment

by:swift99
ID: 9638726
I agree with Alex's recommendation.  Start by moving to a real DBMS first.  Hone your database skills, then take on the additional task of communications and n-tier operations.
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 9640766
Don't know much about Apollo, Advantage or NexusDB since I'm not that fond on those kinds of third-party database connection providers. I still have nightmares because of QuickReports, a report generator, because it just contained too many bugs to be really useful and the creators of this component set had their own view on component design and forgot about backwards compatibility... There are quite a lot of third-party tools that seem to be useful but most of them still have some nasty flaws.

Now, the database servers might be very useful but consider this: ADO is a very well-proven technology right now. Lots of people use ADO and ADO isn't limited to just Delphi. ADO is available on all W2K systems and better and has a pretty good performance. If you have a database that comes with an ADO driver, you could use that database quite easy in your application. You could consider ADO the more enhanced version of the BDE. Only difference is that it was created by MicroSoft, not Borland. Now, if Apollo, Advantage or NexusDB can be accessed through ADO then I don't see any problem with them. But if they require their own API calls or components then you might have some troubles if you ever want to migrate to another database system.

Borland comes with several default database connection methods. ADO is the most popular at this time, next to the BDE. Actually, my previous projects rely mostly on the BDE while I only use ADO for any new projects. (And I try to upgrade my BDE projects to ADO.) Then there is dbExpress which is useful when you want to create cross-platform applications. (Meaning that you could compile your application with Kylix too, probably.) If I'm not mistaken, the Interbase components are also platform-independant but they will limit you to a single database system: InterBase. But I don't need to develop cross-platform applications and I know that ADO is quite reliable at this moment. Besides, ADO is free. You only have to get some database server to work with it.

Btw. I do know there's an ODBC driver for Paradox. You could use ADO to connect to an ODBC source and let the ODBC connect to your Paradox tables. Not very pretty but perhaps  nice alternative. But I would still suggest to move to a real DBMS system instead. Something that supports SQL and preferably transactions. Perhaps even a DBMS that supports things like views and stored procedures.
0
 
LVL 6

Assisted Solution

by:swift99
swift99 earned 166 total points
ID: 9641846
ADO is not scalable, and is not portable to linux systems.

BDE is deprecated and slated for retirement.

I concur with Alex - move to Firebird or mySQL at least.  

I like the dbExpress components.  They provide a thin abstraction layer between you app and the native database drivers supplied by the vendor.  

I also like the precompiler approach which takes embedded SQL and generated native API calls.  This tends to require a bit more work during builds, but you can't get much better performance or compatibility.  Unfortunately, most inline SQL precompilers do not support Pascal (aka Delphi), and the programming techinques are a bit lower level than many Delphi programmers are confortable with.  Firebird's precompiler does support Pascal (fancy that - Interbase is a strategic Borland product, and when they released the source code to kick off the Firebird effort, they made sure that Delphi was supported).

Firebird is the open source version of the comercial Interbase product.  It is free at www.firebird.org.  it appears to be good  for smal lto medium installations.

With mySQL, you have to watch your versions since only a few support two phase commit for transactions.  I haven't actually used the product, but it appears aimed at the small to tiny installation market.

If you want to spend money for something really scalable, Oracle and DB2 have some real oompf and can be scaled from desktop to mainframe sysplexes.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 3

Expert Comment

by:JDuncan
ID: 9643578
You can put your paradox tables on to a file server (NT etc0 and your application will work multi user at an acceptable speed for the number of users you are considering.
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 9644848
swift:
  What do you mean with "ADO is not scalable"? ADO has been made to be scalable and is in use by many companies already. Quite a few webservers even depend on ADO to be scalable... And from personal experience I know that ADO combined with either Oracle or MS SQL Server can easily handle 20 to 100 users. More even if required. Keep in mind though that ADO isn't a database system but a database connector like the BDE.

JDuncan:
  What you suggest is not very reliable. The company I work for had some very bad experiences with Paradox tables in shared environments. The biggest problem is scalability. But there is also the problem that Paradox tables can get corrupt if one of the users doesn't close his application correctly. Even with 5 users there is a high risk of getting corrupt tables with a possible huge data-loss. And then there's the nasty way that Paradox locks records. When a user is using a single record, Paradox doesn't just lock this record but also other records that are located close to this record in the file. This makes it quite hard to have multiple users update the tables.
0
 
LVL 6

Expert Comment

by:swift99
ID: 9644947
I'm talking 1000 to 20000 users ... I have a different definition of scalable.  My "small" is ten time the size of your "large".
0
 

Author Comment

by:agim_bekaj
ID: 9657078
JDuncan:
Can you give more details about Paradox tables on file server, because I tried but without success.
0
 
LVL 5

Assisted Solution

by:DeerBear
DeerBear earned 166 total points
ID: 9660519
Hi,

I definitely second the RDBMS choice.
My opinion is based on few facts:

1) Lots of companies require RDBMS
2) Using file servers can lead to security problems( who can stop
anyone from deleting a table? )
3) File servers are outdated in most cases( except MySql )
4) BDE applications can have huge problems if they're installed in
systems which already have a BDE installed or BDE-like applications
installed( Corel any1?  )

Thus, my choice is RDBMS.

I would also like to point out that n-tier architectures can be quite
handy in the moment you choose to change the application structure
( client-side software to web-based one, for example ) or if you want to
add a layer( for example: client application AND web based app ).

HTH,

Andrew
0
 
LVL 6

Expert Comment

by:swift99
ID: 9660549
You definitely want to have two phase commit also, which is not supported by Paradox.

The two phase commit means that records are locked only for the duration between your "startTransaction" and "Commit" (or "Rollback" on errors), so even when the DBMS locks an entire page there is a minimum of contention.  It also means that your data model always has either all of the required changes for the transaction or none.  No more partial updates where one table has updated data and the other one does not.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now