Hi Guys

Hi Guys,
I want to start a new mobile application, using firedac, (datasnap?) and mysql database. There is a way to connect to datasnap server application using firedac, instead of tsqlconnection? And execute sql commands on the server database connection, in the client application ? I remember that I read some articles about it, but now, I cant  find it. What is the best approach using XE7 to do this job?  Maybe Reflection ?

Comments

  1. I would recommend doing all your db work on the server side and use datasnap (or similar) and keep the connection sessionless as far as possible. Direct SQL over a stability- or security-wise unreliable connection, is a recipe for disaster.

    ReplyDelete
  2. Datasnap doesn´t support a lot of object types. In this case if I want to use a method like TPerson.Save, I must send the TPerson object instance to Server and then call the save method to persist. But, If the TPerson class have anything that is not supported by DataSnap, I cant  send it to server. In this case, if you have access to connect to db from client side, you can run TPerson.Save direct.

    ReplyDelete
  3. I already tried to send objects to server and  then persist, but I have encountered a lot of problems using this approach.

    ReplyDelete
  4. You can maybe try either TMS XData (http:///www.tmssoftware.com/site/xdata.asp) or TMS RemoteDB (http://www.tmssoftware.com/site/remotedb.asp). If you prefer Portuguese support please contact me directly (or through TMS web site).

    ReplyDelete
  5. I would isolate the data model in the mobile client from the data model in the database.  The in-between server (it being datasnap or sockets and json) is the one that needs to do the version mapping.  
    Consider this: You change the database layout and remove, merge, add fields.  What should your client app do, if it has not yet been upgraded?  If you have an in-the-middle server, you can massage the response to match the application version, and be a mediator between the db and the client.
    The less your client app knows about the db, the easier it is to migrate the backend without changing the client.

    ReplyDelete
  6. I use REST..."middle tier" or whatever... You could make yourself a parser for the TRESTRequest calls, and try to send the query string as a parameter to your REST API... The problem might be that have to change "mindset" everytime you program PHP or Delphi/C++.

    Gives you sleepless nights...

    ReplyDelete
  7. Use tiOPF and it's Remote Persistence Layer. It's a 3 tier setup using HTTP +XML. No datasnap or db required on the client side.  tiOPF handles the object persistence for you as well, so just call MyObject.Save and you're done. Delphi and Free Pascal compilers are supported. If using the latter, you can run the application server on any of the follow supported systems: Windows, Linux, FreeBSD, Solaris, OSX, RaspberryPi etc.

    ReplyDelete

Post a Comment