简体   繁体   English

存储请求数据的最佳方法

[英]Best way to store requests data

I need to save requests data (main data : request id, date, url. additional data : headers and bodies). 我需要保存请求数据(主数据:请求ID,日期,URL。其他数据:标头和正文)。 Currently it's store in my databse with only 1 table. 目前,它存储在我的数据库中只有1个表。 The biggest part of memory take additional data. 内存的最大部分占用其他数据。 So when it will be to many requests stored, here can be problem with performance. 因此,当要存储许多请求时,性能可能会出现问题。 Is there any way to store additional data separately from main data? 有什么方法可以将其他数据与主数据分开存储? or any other advices? 或其他建议?

Thanks. 谢谢。


Work with ASP.Net MVC4 and Ms SQL Server 2012. 使用ASP.Net MVC4和Ms SQL Server 2012。

The software like Apache web server stores access info in log files (access.log). 像Apache Web服务器这样的软件将访问信息存储在日志文件(access.log)中。 You could probably implement something similar. 您可能可以实现类似的东西。 Then you can rotate your logs daily. 然后,您可以每天轮换日志。

This way you have your data separated and filesystem storage is really fast, so performance won't be a problem. 这样,您就可以分离数据,并且文件系统存储确实非常快,因此性能不会成为问题。 The problem comes when you have to do some advanced querying on your log. 当您必须对日志进行一些高级查询时,就会出现问题。

You could probably use ELMAH: https://code.google.com/p/elmah/ and set it to store info in XML. 您可能使用ELMAH: https//code.google.com/p/elmah/并将其设置为以XML存储信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM