什么是用于缓存网站响应的合适的存储RDBMS,NoSQL? [英] What's a suitable storage RDBMS,NoSQL, for caching web site responses?

查看:66
本文介绍了什么是用于缓存网站响应的合适的存储RDBMS,NoSQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在构建一个内部的,基于Java的RESTful Web服务应用程序,该应用程序以XML格式公开特定于域的数据.我们希望通过利用缓存存储来补充体系结构并提高性能.我们希望将缓存托管在单独但并置的服务器上,并且由于Web服务是Java/Grails,因此缓存的Java或HTTP API将是理想的选择.

We're in the process of building an internal, Java-based RESTful web services application that exposes domain-specific data in XML format. We want to supplement the architecture and improve performance by leveraging a cache store. We expect to host the cache on separate but collocated servers, and since the web services are Java/Grails, a Java or HTTP API to the cache would be ideal.

随着请求的到来,将使用简单的键/值约定来缓存唯一的URI及其响应,例如...

As requests come in, unique URI's and their responses would be cached using a simple key/value convention, for example...

KEY                                            VALUE
http://prod1/financials/reports/JAN/2007   --> XML response of 50Mb
http://prod1/legal/sow/9004                --> XML response of 250Kb

单个请求的响应值可能非常大,可能高达200Mb,但可能小至1Kb.每天的请求数量很少;不超过1000,但平均为250;我们没有大量的消费者;再次,它是一个内部应用程序.

Response values for a single request can be quite large, perhaps up to 200Mb, but could be as small as 1Kb. And the number of requests per day is small; not more than 1000, but averaging 250; we don't have a large number of consumers; again, it's an internal app.

我们开始将MongoDB视为潜在的缓存存储,但是鉴于MongoDB的最大文档大小为8Mb或16Mb,我们认为这不是最合适的文件.

We started looking at MongoDB as a potential cache store, but given that MongoDB has a max document size of 8 or 16Mb, we did not feel it was the best fit.

根据我提供的有限细节,是否有其他建议适合这种情况的其他类型的商店?

Based on the limited details I provided, any suggestions on other types of stores that could be suitable in this situation?

推荐答案

按照我理解您的问题的方式,您基本上想缓存文件,即您不需要了解文件的内容.内容,对不对?

The way I understand your question, you basically want to cache the files, i.e. you don't need to understand the files' contents, right?

在这种情况下,您可以使用MongoDB的 GridFS 将xml缓存为文件.这样,您可以顺利地将文件流进出数据库.您可以将URI用作文件名",然后,就可以完成这项工作.

In that case, you can use MongoDB's GridFS to cache the xml as a file. This way, you can smoothly stream the file in and out of the database. You could use the URI as a 'file name' and, well, that should do the job.

没有(合理的)文件大小限制,大多数(如果不是全部)驱动程序都支持.

There are no (reasonable) file size limits and it is supported by most, if not all, of the drivers.

这篇关于什么是用于缓存网站响应的合适的存储RDBMS,NoSQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆