Client side MySQL DB using embedded library

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Bryan
Posts: 13
Joined: Fri 09 Feb 2007 16:02

Client side MySQL DB using embedded library

Post by Bryan » Mon 19 Feb 2007 13:39

Hello,

I have a MySQL DB on my server and I'll be accessing it with my client application.

- The server DB will be populated by files the server downloads.
- The client app will never insert, or update the servers DB.
- The client app will only retrieve new records from the server DB to populate the client DB.

So my question is... what is the best way to do something like this?
I was thinking of having the client remember the primary key auto inc number for each table, then select all records since then..... then populate the client side DB with the result query.

The client will be querying the server DB about 1 time every 15 minutes.

My question, is this a bad design, or bad approach?
I want the client side DB so that users can use the data without connecting to the Internet.

Any advise or comments is very welcome.
Thanks!
Bryan

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 20 Feb 2007 08:03

I can suggest the following two solutions:
1) Install the MySQL server instance on the each client computer and set up the replication between local servers and remote server. You can read more about Replication in the MySQL Reference Manual.
2) Use the MySQL Embedded server on the client computers. In this case you will need handle the replication yourself. Probably the TCRBatchMove component that was added in MyDAC 5 will be useful for you. I recommend using MySQL Embedded Server 4.1. Note, there are some known problems with MySQL Embedded Server 4.1, like working with the InnoDB storage engine.

Post Reply