Helps storage in XML file

Asked

Viewed 39 times

2

good afternoon!

I’m developing a system for product registration. However, I am thinking of creating an XML file to store the general characteristics of the products (the other information will be in the database), because each product has its specific attributes. The structure would be +/- like this:

<produto id="1">
   <atributo>Editora</atributo>
   <decricao>Globo</descricao>
</produto>

<produto id="2">
   <atributo>Altura</atributo>
   <decricao>1,65m</descricao>
   <atributo>Largura</atributo>
   <decricao>5,00m</descricao>
   <atributo>Material</atributo>
   <decricao>Sucupira</descricao>
</produto>

The problem is that the amount of registered products will be huge (I believe thousands)! So this xml file will get very large.

I would like to know from you if it is feasible to use an XML file for this purpose. And if it is also possible to use it together with a DBMS to facilitate the search inside that file.

Thank you, André

  • Dude, from what you described the ideal would be to do everything using a DBMS, the ideal is to work with files only if you want to exchange data with some other system.

1 answer

4

Store the information in DBMS, XML files are useful for storing settings or transport data via Webservice.

If you are not creating an API to be consumed, you will not need XML.

Regarding the question related to performance, the performance should be measured before to better evaluate the improvement points. This step should come when the application is ready. You can optimize SQL queries and create indexes in the database tables, or make use of memory caching. Never use a file as a database.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.