Another document database on. NET, Raven [reprinted]

Source: Internet
Author: User

Raven is a shcema-less (shcema-less) file data storage service for. Net/windows. Raven is not another nosql solution, nor a relational solution, but wants to address the performance and scalability requirements of large web applications.

Raven can save all types of data as JSON documents without imposing a specific format on these contents. This means that data can be stored in any format, which is particularly suitable for the following scenarios:

  • Web-related data, such as user sessions and shopping cart-the document-based feature of raven means that you can obtain and save all the data to be processed in a separate remote call.
  • Dynamic entities, such as user-defined entities and entities with a large number of optional fields. The free format of raven means you do not need to implement relational models.
  • Persistent view model-you do not need to re-create the view model from scratch each request. You can directly Save the final form in Raven. This reduces the computing time, reduces the number of remote calls, and improves the overall performance.
  • Big dataset-around the world, Raven's underlying storage mechanism can support more than 1 TB of capacity (on a single machine ), moreover, non-relational features make it easy to share databases on multiple machines. This is extremely natural for Raven.

The followingCodeFragment is an example document stored in Raven:

{"Posttypeid": 1, "ID": 2321816, "title": "storing specified cial files on the server", "acceptedanswerid": 2321854, "lastactivitydate ": "\/date (1266953391687 + 0200) \/", "answercount": 3, "Comments": [{"score": NULL, "creationdate ": "\/date (1266952919510 + 0200) \/", "text": "Are they \" sensitive \ "information? "," Userid ":" users/203907 "},{" score ": NULL," creationdate ":" \/date (1266953092057 + 0200 )\/", "text": "I wouldn't say they are sensitive information... "," userid ":" users/200145 "}]}

Each document has a key or Document ID associated with it. In the preceding example, the key is "2321816 ". In addition to documents, Raven can also store metadata or text/binary attachments attached to documents. To search for and obtain documents from data storage, Raven uses indexes to complete:

An index is a LINQ query that operates on a series of documents and generates a projection for each document to make the query more efficient. An index is an important LINQ query that raven can execute in the background, and its results are stored in persistent storage. These queries can be efficiently queried in the future.

The following is an example of organizing a post with the title as the index:

 
From post in docs. Posts

Where post. acceptedanswerid! = NULL

Select New {post. Title };

After this index is created, you only need to query it to obtain the desired document.

Raven provides HTTP APIs and client APIs (C #). HTTP APIs have the same functions as client APIs, allowing those that only use JavaScript and HTMLProgramIt can also be accessed. It contains the following commands:

    • Get
    • Put
    • Post
    • Delete
    • Patch

Http apis also support the ability to obtain multiple documents or batch requests in one call.

Raven is published based on three license protocols:

    • Raven dB community-a free edition that can be used only for open source projects with no support
    • Raven dB has cial-a paid-for edition for each cial software with support for a limited number of incidents/year
    • Raven dB enterprise-similar to specified cial but has extra features like sharding, unlimited Master/Slave replicas, failover, replication to RDBMS, and better support.
    • Raven dB community-free version, which can only be used for open-source projects without technical support
    • Raven dB commercial-paid commercial software that provides technical support with event and annual restrictions
    • Raven dB enterprise-similar to the commercial version, but it has some additional features, such as sharding, unlimited Master/Slave replication, failover, and replication to RDBMS, and provides better technical support.

Both business editions have monthly subscriptions or long-term licenses. Raven was developed by hibernating rhinos, a consulting company created by ayende rahien.

Other resources: Raven dB website, source code repository, Raven dB introduction, discussion group, and ayende blog compiled by ayende rahien.

 

Address: http://www.infoq.com/news/2010/05/Raven

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.