Database Sync Solutions for Delphi

I am looking for some starting points for integrating Win32 Delphi application data with a remote database for a web application.

Problem (s) that this project intends to solve:

1) The desktop does not work on vpns. Instead, users at the remote office can use the web application.

2) Some companies prefer a web application to a desktop application

3) Mobile devices can enter the web application as an interface.

The problems that I have identified are:

The web application will run on a Unix-based system, possibly Linux, while the desktop application will use NexusDB, while the web application will most likely be Postgres. Various platforms and databases.

Using Delphi it seems that the Microsoft Sync Framework is not available for this project.

My first thought was to provide the web application with a standard REST API and the desktop application got into the API as if it were a client every n-minutes from the local database server. Tons of questions that I see with this already!

+4
source share
4 answers

Richard, I've been on this journey before, and all I can say is DO NOT DO IT! I use to work in a company with a large Delphi Desktop Application (over 250 forms) running on DBISAM (very similar to what you have). Customers need a "web interface" so people can work remotely, and then change the settings for the web application and desktop. Well, a few years later, and the application was terrible - the data problems and the user's workflow were terrible because managing the same data in two different places is a nightmare.

I would recommend moving your database to something like MySQL (Delphi and Web Client both hit) and use the same database between the two interfaces. The reason the Delphi client doesn’t work well on VPNs is because desktop databases, such as NexusDB and DBISAM, copy a lot of data over the pipe when making queries (discards all data, then filters / orders, etc.) - This is not true client / server, such as SQL Server or MySQL, where all the heavy lifting is done on the server and only the results are returned. Of course, moving a Delphi application to DB, like MySQL, could speed up problem solving together - but you don't solve # 2 and # 3 with this.

Another option is to move the entire application to the Internet and only 1 application to support. Of course, a good user interface developer in a tool like Delphi can always make an excellent user interface for a web application, especially in heavy data entry applications, so this may not be an option for you.

I would be very tired of data synchronization.

My 2 cents. Mike

+6
source

If you use RESTful ORM , you can use both AJAX and Client Delphi applications on the same Delphi server, using JSON as the transfer format, HTTP / 1.1 as the remote connection level, Delphi and Javascript objects to access the data.

For example, if you enter http: // localhost: 8080 / root / SampleRecord in your browser, you will get something like:

[{"ID":1},{"ID":2},{"ID":3},{"ID":4}] 

And if you ask for http: // localhost: 8080 / root / SampleRecord / 1 , you will get:

 {"ID":1,"Time":"2010-02-08T11:07:09","Name":"AB","Question":"To be or not to be"} 

This can be used by any AJAX application if you know a little about JavaScript.

And the same HTTP / 1.1 RESTful requests (GET / POST / PUT / DELETE / LOCK / UNLOCK ...) are already available in any HTTP HTTP / 1.1 application. Frame implements server using a very fast kernel mode http.sys (faster than any other HTTP-server in Windows), and fast HTTP API for the client . You can even use HTTPS to handle a secure connection.

IMHO, using such an ORM is better than using only a database connection, because:

  • This will strictly follow the n-level principle: business rules are written by ONCE on the Delphi server, and you use only services and RESTful operations with business objects;
  • It will use HTTP / 1.1 for a connection that is faster, more standard on the Internet than any direct connection to the database, and can be strongly protected using HTTPS;
  • JSON and RESTful over HTTP are de facto standard for AJAX applications (even Microsoft uses it for WCF);
  • Data will be transmitted using JSON, which is a very nice format for multiple interfaces;
  • The stateless approach makes it very strong even in unbound mode;
  • Using local small database replication (we recommend SQLite for this), you can have client access in unbound mode (for Delphi client or for HTML 5 clients).
+5
source

I recommend that you have one database and two front-end interfaces (a web interface that calls SOAP methods to work at the back end, and a rich client based on the Delphi-based SOAP method and a SOAP server level that implements the available SOAP methods that your business logic).

From what you describe, you think that replication will just speed you up, but what it will do instead will slow you down and cause replication, connectivity, and relational integrity problems that must be sorted manually (by you).

+2
source

Take a look at this

CopyCat is a database replication engine written as a set of components for Embarcadero Delphi. CopyCat has been in production since 2004, and is very stable. It depends on the daily from a few small to large enterprises for applications ranging from cross-site synchronization, intermittent operation, database backups and more. We are confident that he can also fulfill your needs. Read on ...

+1
source

All Articles