Forum Moderators: phranque

Message Too Old, No Replies

XML & MySQL

blending them together

         

lorax

3:50 pm on Oct 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hola,
I'm working on a project which involves me writing my own XHTML Module for the XML DTD, RSS data feeds, content defined by XML, and possibly XML-RPCs. My primary db is MySQL and I've been thinking that I should use the mysqldump function to export the database into a well-formed XML document for use.

My questions are:

1. Does this approach make sense
2. Do you have any resources that might be useful as I make my way through this process
3. Are there other options I should be considering?

As usual, you insight would be most appreciated.

lorax

7:10 pm on Oct 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



An update,
The more I read about the currently available XML databases the more I'm convinced the aforementioned approach would be the best. Largely because of the flexibility to add/edit/delete data. The largest unknown seems to be how often to use the mysqldump function. My inclination is to use it everytime the database is updated thereby offering a fresh file for RSS feeds. But since I'm on the edge of my knowledge I could just be blowing smoke.

jaski

6:47 am on Oct 24, 2002 (gmt 0)

10+ Year Member



Do you need to convert a whole database to a file in XML format? seems strange if that is the case..

On the other hand ... if you need to extract a few records and convert them to XML .. you need a glue between mysql and xml .. some thing like PHP or Perl .. with which you can extract records and convert their format to XML.

Mysqldump is a different thing altogether, that is used to back up whole databases or tables .. not for data format conversions.

lorax

12:33 pm on Oct 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



jaski,
First, thanks for the post.

I've done some more research since these posts. The reason for XML is that I'm planning a large data exchange project. There are several databases, static documents, links, etc... scattered among an unknown number of web servers. The goal of the project is to create XML services based network that allows all members of the project to both contribute & publish whatever data the "network" is made aware of.

I posted these questions because I wasn't sure how to make the data that's in the various databases available to the "network." The network needs to use XML so that we have a common language to describe similar data. I was thinking that since data doesn't change everyday that I could write a cron job or manually dump the databases to a XML document once a week. Klugey I admit. But since then I've been reading (and understand) more and am thinking now that I need to use XML-RPC. What I don't understand is that if webserver 'A' initiates a request for data on webserver 'B', where does the function it calls reside? And then , if the information on 'B' is in a MySQL database, how should it be converted into XML before it is delivered to 'A'?

But like I said earlier, I'm on the edge of my knowledge so if you can see the picture more clearly, I'd appreciate your insight!

jaski

1:44 pm on Oct 24, 2002 (gmt 0)

10+ Year Member



You seem to be collecting data from different sources and putting it in one place. As far as saving such data is concerned .. a straight MySQL table will do?

If that works, the issue that remains is how to receive data from different sources. For that either all the sources have to agree on what format they deliver data in or you have to program your server to process data from each source separately depending on what format they deliver data, and store it in a the common table.

That is a very simplified (and may be oversimplified) picture in which XML is not really necessary.

If that does not work ..
Another thing that I have *heard* about but do not really know much about is SOAP. It is a XML based protocol meant for doing things like data exchange between web services
[w3.org...]

lorax

3:03 pm on Oct 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You've almost got the picture! :)

I'm not gathering the information in one location (not for most of the contributors at least). I'm defining the infrastructure/rules/code for the sharing of data among many websites.

For example. I decide I want to post information available on webserver 'X' on my website. All I should have to do is to use the code module supplied for this task and follow the instructions (all of this built by me) to implement a webservice to access that data. The webservice depends, of course, on what sort of data we're talking about. Headlines will use RDF/RSS while full articles and db queries may use XML-RPC (or SOAP, WDDX,?)

XML is necessary to define the data. I will create an XML schema which everyone will need to reference in order to interpret the data properly. I'm also supplying the code modules which will allow those who publish to thier own websites to share thier information with everyone else. These modules provide the XML hooks so the rest of the network can acquire the data from them. The data is not stored on the other websites, simply republished using XML to acquire and deliver the data.

jaski

4:10 am on Oct 25, 2002 (gmt 0)

10+ Year Member



So you are "really" looking for building "webservices" :) . I think its a huge topic and I hardly know a thing about it but I am sure you will need to read a lot before you are able to put together some thing good. This looks like a good place to start [directory.google.com...] :) .

lorax

12:55 pm on Oct 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Spot-on! Though I hadn't really thought of calling it a web service.

Thanks for the resource. I've done quite a bit of reading and am enrolled in an XML class for early Nov.. Surprizingly, it's not the big picture issues that worry me but rather the details of how this and that work happen. But you are absolutely right, I have a ton of reading/experimenting to do before I will feel like I have a good handle on this project. Thanks.

Gregg