Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Practices for storing large amounts of XML type data in SQL Server

Does anyone have any best practices they can share with regards to storing XML field type data in SQL Server 2008? We have lots of small XML structures, yet some larger (>50MB). We're finding that things get a little slow on DELETE. Any advice/war stories would be appreciated.

like image 457
Keith Adler Avatar asked Sep 24 '09 23:09

Keith Adler


1 Answers

I see that most of the answers so far are for outside the database.

We have done this once, adding the file to the file system, and the name of the file in the a table in the database. The main problems with this was:

  • the file system is not transactional, so it could get out of sync if something went wrong
  • you had to take backup seperatly, and restore would by definition be out of sync

For all new projects we have stored files in varbinary(max) fields. This has worked well for us, also under loads of 10's of thousands of users.

like image 151
Shiraz Bhaiji Avatar answered Sep 20 '22 06:09

Shiraz Bhaiji