How to fetch data from DB over internet

From different forums i have learned that directly connecting database over internet is not secure and fast. So i decided to use Xojo web app using handlespecialurl interface. but i have some doubts regarding this. Please answer the below points.

  1. What is the best & fast method to transfer the data for a query like (select * from table). Is it using Jason / XML or raw data transfer the best
  2. How to transfer picture / binary data stored in DB
  3. Is there any other method that you recommend for connecting DB over internet

Thanks.

Check out the webinars from Paul LeFevbre (spelling?) about this topic. He recommends using a middlewere between the user and the server. This would use Json to transport the data with a REST API. For myself I’m planning to use Valentina Server for this which has a built-in REST service so that I hope to skip the middlewere.

RapidServices was designed specifically for this use case. It makes creating RESTful web services using Xojo a breeze. You can create in minutes what would take hours. See: https://forum.xojo.com/36254-rapid-services-for-xojo-web-rest-api-builder

The Valentina REST interface is similar to a traditional database plugin. You still have to provide connection details which means your application has a direct interface to the database. The reason for using middleware is to keep your database credentials secure and do any data sanitization before it hits the database. If you use the Valentina REST interface you might as well just connect directly using the plugin. It’s designed specifically for programming environments that do not have a native plugin.

JSON is not suitable for moving binary data. Probably easiest to base64 encode the picture before sending/receiving. Adds some computational and bandwidth overhead but keeps the payload simple.

Our Network Kit comes with an easy database proxy, so we can connect to various databases from iOS.

JSON is more compact, so probably the better choice.

You can Base64 encode the binary data and embed in the JSON. Or you could provide a way to directly download the binary data separately, perhaps with another special URL supplied in the JSON.

In addition to what’s mentioned above, Luna might be worth looking at.

Here are some links that might help:

Thanks all for your valuable comments and suggestions