mySQL database anyone?

03 Jun 2010

Has anyone done any work in connecting embed to a mySQL database over ethernet? I see Tom Morrison's post where he connected to a Microsoft SQL (MSSQL) database using some Visual Basic code hosted on the remote server. I don't have a clue as to how his VB code gets installed or works on that server, but it looks like it works well with Microsoft software only.

I have a local server setup using XAMPP ( http://www.apachefriends.org/en/xampp.html ) which has the Apache server, PHP, mySQL, perl, and pear all bundled together in one easy install. BItmani (www.bitnami.org) has a similar package, but the XAMPP control panel handling configurations is nicer.

The application I am designing will monitor and record ounces of beer poured from each individual tap in a bar. One embed processor will track up to 32 taps. Data will be sent back to a central server farm located in Las Vegas. Each bar having the units will subscribe to a website where they can log in and view the data in near-real time, and in also many historical reports, charts, and graphs.

For this application I need to have various embed modules remotely connect to a central mySQL server and INSERT new data records. This is what I know about mySQL:

  1. 1) mySQL has both a "C" and "C++" API which supposedly handles the connection details.
  2. 2) I believe that this API can be compiled for the ARM processor, but I haven't tried yet.
  3. 3) The mySQL handshaking protocol is complicated. I looked at it under WireShark and there is a lot going on under the hood. During the mySQL connection there are quite a few transaction in which both the server and client determine what capabilities each side has and can support. Once this is done, they can begin transferring data.
  4. 4) Tom Morrison's approach is simpler as it places the burden on the server side thus eliminating the need for embed to engage in all the handshaking protocols.
  5. 5) The server-side approach might not work when 100's or 1,000's of embeds start sending in data.

Any comments or pointers to work others have done would be appreciated.

Oh, and finally... they won't let me use real beer until the final acceptance tests :(

Doug

03 Jun 2010

you can do this hard stuff in php and then just call url from mbed

Something like beer.org/insert.php?bar=1234&beers=2

:-)

KISS

you have all libraries to do this right now and PHP script is trivial too

03 Jun 2010

Hi Doug

It a while since I did any PHP,mySQL programming but this task is stright forward. Its better to do the proccessing on the server side for a number of reasons

1. Mssql is designed to handle 1000's of transactions per second.

2. Webpages/database application can be load balanced over a number of servers.

3, Its alot easier to upgrade the server side things than embed at taps.

Regards, Tom