Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Architecture for 3-tier application with D7 [closed]

I have had experience with COM+ technology so far to build 3-tier applications. This is huge and advanced technology which supports many interesting concepts. It just works as it should for the applications which operate on LAN.

Now I am planning to build 3-tier system, still based on D7. The difference is that it should work in the internet. The clients will be scattered all over the world. From my experience in such situation I wouldn't rely on com+. Com+ basically needs stable connection, it is not easy to configure the firewall server which has to open quite wide range of ports (even if you narrow it).

So the question is. What architecture (web services, services or something else) works for you in production? I think I would like to have the service which listens on one tcp port. In which I could save session client parameters available for the open session. Also some kind of built in encryption would be a plus.

Thanks for help!

like image 373
John Avatar asked Jul 25 '11 11:07

John


3 Answers

We use RemObjects SDK for our services, and we are very happy with the quality! You can use TCP + Binary messages (for high speed), with optional encryption and compression. But also HTTP + SOAP (or XML or whatever) is possible, or TCP + SOAP etc. It is very easy to use, and worth the price (it is not very expensive)!

BTW: Data Abstract is based on the SDK, both are from RemObjects.com.

like image 97
André Avatar answered Sep 19 '22 17:09

André


SOAP or REST WebServices are widely supported and are (SOAP almost always, REST definitely always) HTTP based so are firewall friendly and could be encrypted using SSL. Delphi 7 does SOAP, but doing your own REST isn't that difficult either.

The other option would be a 3rd party library like Data Abstract which might have better out of the box support for Multi-Tier, but you might lock yourself into a technology more.

That having said: I don't have extensive experience either of these in production.

like image 24
Lars Truijens Avatar answered Sep 18 '22 17:09

Lars Truijens


You could take a look at our ORM framework, which implements an n-Tier Client-Server architecture over several protocols, including HTTP/1.1.

So it could help you build Client-Server applications over the Internet, using an ORM approach, and a n-Tier/SOA architecture.

The SOA (Service Oriented Architecture) can be used in an ORM Client-Server approach:

  • The ORM will be used for both the Data layer and at Business logic layer: you can use objects to map your database, and also create if necessary your own business objects, which will be exposed in a RESTful approach over the Internet, via JSON;
  • Data filtering and validating is performed via ORM at Business Logic level;
  • User Interface will use some objects on the Client side (there are dedicated units for Delphi UI generation, but you could be able also to write an AJAX application, using JSON for its communication);
  • You can use high-level properties like Dynamic Arrays in your objects - so it's "Sharding" or "Share nothing" ready architecture;
  • New HTTP server using fast http.sys kernel-mode server and zip / SynLZ compression - which will work other the Internet (with https if necessary);
  • Secure RESTful authentication via per-user light sessions, and per-query signature;
  • Optimized HTTP Delphi client, using WinHTTP (faster than WinINet);
  • A lot of other features, including any other DB back-end (native Oracle/OleDB/MSSQL...) in the (very) near future.

Take a look at the documentation, which can be downloaded as pdf files. There are some pages highlighting all those architecture aspects, in the first part of the SAD document:

  • MVC and Multi-Tier architecture;
  • Why an ORM (with advanced RTTI) - why it is not only a layer over the DB;
  • Why a Client/Server ORM;
  • Writing RESTful Services in a SOA approach;
  • ORM and SQL (via SQLite3 virtual tables, custom functions to access BLOB).

It's Open Source, working from Delphi 6 up to XE, full Unicode (even on Delphi 7, since it uses internally UTF-8 encoding, like JSON). So when you'll upgrade to a newer Delphi version, your code will still be valid. Could be useful.

like image 28
Arnaud Bouchez Avatar answered Sep 21 '22 17:09

Arnaud Bouchez