-1

I have a Delphi App using a SQL DB running over a local LAN.

I am now wanting to roll out the Delphi App over a WAN (in principle), as I want to setup a Head Office / Branch Offices, so we have a number of branch offices running the Delphi App, but the SQL DB is stored at the main Head Office.

How can this be best achieved?

Lee Parvin
  • 17
  • 6
  • At my firm we connected the satellite offices amd home users to the HQ via Citrix (which is pretty much like remote desktopping).. For 160+ users accessing an MS Sql Server at the HQ, it worked like a charm. Fwiw ... – MartynA Aug 14 '15 at 09:22
  • 2
    I'd be concerned with security issues of exposing your database to the internet at large. Ideally, the app would be migrated from an client-server to an n-tier system but appreciate this could be more work than your employer is willing to sign off. Something like Citrix probably works best (this is how we run our Delphi client hosted solution). Bog standard remote desktops will require a lot of hardware infrastructure at head office, depending on number of concurrent users. – Matt Allwood Aug 14 '15 at 10:09
  • Yes I agree with you about DB security. Thats why I was thinking some sort of MPLS where its a dedicated link between dedicated sites ie secure WAN. Running the app as n-tier is a good idea, although this will take quite sometime to recode, so hence my boss wont be too happy. – Lee Parvin Aug 14 '15 at 10:38

1 Answers1

1

Today, n-Tier/SOA architectures seem to fulfill your needs.

Never expose the database to the Internet, never send SQL requests over the Wire, but design Services, which would be consumed from your clients.

You may still use RAD for designing your UI, but you would better put your business logic, and your database away from your application.

You may try to use DataSnap (which may be in your edition of Delphi), or try some SOA frameworks, e.g. our Open Source mORMot framework. The exhaustive documentation has some chapters introducing those new concepts, like nTier/SOA/ORM/MVC. It uses HTTP and JSON over REST, so you could even use AJAX clients, if needed.

enter image description here

The mORMot framework has a quite unique master/slave replication feature, as part of its ORM abilities. It was designed to easily implement Main Office / Local Office data synchronization, as you need. This synchronization may be defined in real-time, using WebSockets.

As a side-effect benefit, since each local office has its own (SQLite3 self-hosted) database, the main server would be less solicited, and local offices could even continue to work if the Main Office server crashes, or in case of Internet connection loss.

Arnaud Bouchez
  • 42,305
  • 3
  • 71
  • 159