Search code examples
phpsqlwindows-phone-7httppost

Is using HTTP GET/POST a good idea for transferring data to/from a medium/large scale database?


Is using a PHP script and http POST/GET to enter values into a medium to large scale database a good idea? i.e. Will it be reliable? Will it be secure? Will it be Scalable? ect.

The database will essentially be PostgreSQL or MySql. Im developing an app for Windows Phone 7 and there are no SQL libraries for MySQL or PostgreSQL therefore I am forced to use MS SQL server.


Solution

  • Maybe. Depends.

    HTTP is a reasonable way to transfer small chunks of data - it was not really designed for moving large amounts of data from the client to the server - hence a lot of implementations (1) places limits on the amount of data you can move. These include all the network devices between the client and the server (notably firewalls and proxies).

    If you're transfering more than about 512 bytes then using POST rather than GET should prove more reliable. Since you're transferring data from a mobile device with limited bandwidth, then the amount of time the device will be able to maintain a connection may be signicantly less. For reliable transfers and a good user experience you want to transfer the data in smallish chunks (one record at a time?).

    Why not imlpement it in HTML5? Which will make it much easier to port to iOS / Android / Microsoft's next developmet platform.

    (1) the protocol itself does not limit the size.