Re: Multiuser application


Jorge Ferreira wrote:

> You're quite right. It´s the B option. Because, i did posted the data
> and it appears automatically to the user that posted it

because he has the data in his dataset. This user does not need the
RDBMS behind to give him the data

> but not to the others.

you're thinking about it as if the users would be working live on the
database, but what is happening in reality is that they work on a
snapshot of it. See my comments below

> Can you clear this doubt to me? I don't know how Delphi
> works with Databases...does it make some sort of Table mapping when
> loading? So that the user don't have to load data each time it makes
> a refresh? And then each new register or deletion, it will work with
> the Table of Delphi and not the Table in SQL Server. Is this what is
> happening?

more or less. You're using datasets (or derivates like Table or Query)
to access to the data. What you do is to define a SQL sentence which at
some point is executed in the RDBMS, returning a result set which is
stored in the dataset.

The user sees this data, *not* the data in the RDBMS. This could seem
weird, but it's designed that way to avoid too high traffic between the
tiers of your app, and to also avoid complicating data integrity

Say you are working on a table with 2000 records. Not too big. If you
want to work live on it, you will necessary be sending and receiving
data constantly. If every record is, f.e., 4KB big, we're speaking
about 8000KB. This is still not too much for a LAN, but already a bit
for a WAN. But say now you have 20 users working at the same time on
the database. That would make 160000KB being sent at every moment. Of
course, you would need to use where clauses to minimize the number of
records to be retrieved, but still you'll likely have too much traffic.
Imagine the case for large apps with thousands of users and tables of
ten-thousands of records. You could think about requesting it only
every x secs but, how to choose the time frame? And wouldn't this be as
working on a snapshot?

> Then...
> I will make the necessary preparations not to use the Table
> components but Query components. It will slow down the program but
> not too much (considering the amount of users). Nobody ever told me
> not to use table components in the case i want it to be multiuser.

i doubt it will slow down the program. In fact, i think it could even
make it faster, if you use appropiate where clauses. The problem with
Table components is that they try to load all the records (which is ok
for desktop apps), while it is always better to load *only* those which
you really need

Best regards :)

Guillem Vicens
Dep. Informática Green Service S.A.
in order to contact me remove the -nospam