[英]What is best practice to save large request and response xml in SQL Server
I want to save all XML requests and responses in a SQL Server database. 我想将所有XML请求和响应保存在SQL Server数据库中。 These can be in millions.
这些可能以百万计。 If I use
XML
type in SQL Server it has performance issue. 如果我在SQL Server中使用
XML
类型,则会出现性能问题。
Can anyone tell me what will be best approach to save such data? 谁能告诉我什么是保存此类数据的最佳方法?
Thanks 谢谢
I started to write a comment but there was too much for that :) 我开始写评论,但是太多了:)
The right solution may vary, based on what you actually need to do with that data afterwards: 正确的解决方案可能会有所不同,具体取决于之后实际需要处理的数据:
If you need just to store some data in logging purpose you can use simple table with column with XML datatype and some ID, datetime stamps, and maybe some XML based index. 如果您只需要出于日志目的存储一些数据,则可以使用带有XML数据类型的列和ID,日期时间戳以及一些基于XML的索引的简单表。
If you need to build some reports based on this data or have an instant fast access to it - the better way is to parse/aggregate all this XML input and store it in proper build database (tables/indexed etc). 如果您需要基于此数据构建一些报表或可以快速访问它们-更好的方法是解析/汇总所有XML输入并将其存储在适当的构建数据库(表/索引等)中。
If this requests and responsive have a massive nature and this XML has no specified structure - consider using some NoSQL solutions. 如果此请求和响应具有大量性质,并且该XML 没有指定的结构 ,请考虑使用一些NoSQL解决方案。
Fe we have a search service with logs that are stored: 如果我们有一个搜索服务,其中存储了以下日志:
We got ~500 searches a day, so we store that in one table with index on userid/datetime. 每天大约有500次搜索,因此我们将其存储在一个表中,并在userid / datetime上进行索引。 All works fine.
一切正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.