开发者

Solution for large file store with http interface?

I have a requirement for implementing a data-store. Basically, I just need to be able to store and retrieve large-ish files based on an identifying key. I would like this to have an REST-ish http interface some that "thin" client applications can use this for persistence. For example,

PUT /{id}/file.ext

Would send a file to the server and

GET /{id}

Would retrieve all files at a particular id. Finally,

GET /{id}/file.ext

Would retrieve that 开发者_JAVA百科file.

Simple stuff, really, but I would prefer to use an existing solution if possible. This seems too lightweight for a full blown CMS, but I want more control than just a file-store. It would be relatively straightforward to implement a REST web-service backed by a DBMS, but again, I'd rather build/customize something existing.

Is there anything out there I could use for this purpose without too much work?


A WebDAV server should be able to do exactly that (and more).


While I think Julian's answer is spot on, I can think of an alternative solution: CouchDB. It’s a document-oriented database with a RESTful HTTP API. Documents are JSON objects, and you can store binary data (files) as "attachments" to the documents, which are then accessible as their own resource with their own URL. You could use a proxy server in front to prudent a custom URL structure, and in fact Couch has the ability to do so itself, although it's complicated. And of course at any point you could use a middle tier to support other features/functionality.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜