I have implemented a page hit counter which counts the number of page views for pages on my website. I then display the names of the pages ordered by number of page views.

I made it unique using the ip of the user, so that the same ip is not counted more than once. The xml file structure is:

 <page id="123" count="2">
   <ip address="xx.xx.xx.xx" />
   <ip address="yy.yy.yy.yy" />
   ...
 </page>

I belive that as more and more users use the website and more pages are added to the website, the xml file will grow larger and larger and it can get up to 1,000,000 rows or even more. That is an estimate of about 45 mb file or more. So, my question is:

Performance wise: Which is better: XML File like the one above or SQL Server (e.g. two tables - 1st for pages and 2nd for ip's) ? Thanks.

有帮助吗?

解决方案

XML processing is not the strongest part of SQL Server. The best option is to prepare database schema to handle your solution. Two tables in your case should be enough.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top