. NET Platform Open Source project Quick glance (15) Document database ravendb-Introduction and initial Experience

Source: Internet
Author: User

Unconsciously, ". NET Platform Open source project Quick Glance "series has 15 articles, each is very popular, may not be a high level of technology, but enough to get started. Although the work is very busy, but still will take the time to know, already met in the usual good open source projects to share. Let's introduce to you today. NET platform for the document database ravendb, although I used to use other documents in the small Project database, but a lot of problems, small projects can also, large projects on the rest of the dishes. This database I have been watching for a long time, has been looking at its documents, so I know the first summary down.

. NET Open Source directory: "Directory" of this blog other. NET open source project articles Directory

This text address: http://www.cnblogs.com/asxinyu/p/dotnet_Opensource_project_RavenDB_Intro.html

Note: Although RAVENDB is commercialized, it is free for the community and charges for other services offered. There is no limit to the free version feature, only user authentication is limited.

1.RavenDB Overview and Features 1.1 RAVENDB basic Introduction

The differences and pros and cons of so-called relational databases and NoSQL databases are not described here, and it is up to you to find out what you can do with your own search.

       let's get to the point and see its main features.

RAVENDB official website: http://ravendb.net

GitHub Home: Https://github.com/ravendb/ravendb

1.2 Ravendb main Features 1.2.1 Client API supports. NET and Java

The main thing about the. NET API, at the language level, is LINQ support, which is estimated to be the standard for. NET NoSQL databases today. The other is extensibility and flexible configuration convenience, the API is provided. It is important to note that both the. NET API and the Java API are built on its rest API.

1.2.2 Scalable, extensible, plug-in

  the RAVENDB has very high scalability. Support Multi-tenancy (multi-user data isolation), as well as different synchronization types, and optionally support partitioned shards and more. the RAVENDB can be extended , existing plugins such as: Trigger, encoder/decoder, Task Scheduler, compiler extension, parser, encryption, compression and so on. Multi-tenancy translation is a bit awkward, here's an explanation:Multi-tenancy makes every client organization work in a custom-made virtual software or solution instance, and thinks he's in a unique environment. Unlike multi-software instance architectures, Multi-tenancy has multiple software instances and each instance serves a customer organization, and the multi-tenancy structure is a software instance that serves all customer organizations. The multi-software instance structure physically isolates the data from the customer organization, while the software or solution in the multi-tenancy environment isolates the data and configuration of the customer organization logically.  

1.2.3 Performance and Safety

Automatic tuning, smart indexing, fast read optimization, no lock-in, multi-level cache support. Acid transaction support, automatic batching, no lock, client and server side connection protection.

Authorization (document level, user/user group), authentication (authentication with Windows authentication or OAuth API), data encryption (can encrypt content data and index data), FIPS compliant (Federal Information Processing Standard).

1.2.4 Other

Full-Text Search (Lucene-based, with Lucene built-in features, support for custom word breakers/analyzers, seamless integration with standard queries), RAVENFS distributed virtual file systems (synchronization, search, versioning, encryption, etc.)

2.RavenDB Installation

Say so much, that has to do some practical right, uncensored no truth, then together to see how to build the environment, as well as a demo play it. Note the first time you play download the installation package a little better. Graphical interface installation, easy to understand, I did not use the first time the installation method.

2.1 Download the Windows installation package

Download the latest stable on the Http://ravendb.net/downloads page. NET toolkit, so far. The most stable version of the net platform is 3.0.30115:

Sometimes the download is slow, I use the Baidu cloud to share a copy, need to download: Link: http://pan.baidu.com/s/1eSyNyqm Password: o2k6

2.2 Installation Steps

This Windows installation is very simple, not too much to say, here are only a few key issues:

1. Install the . NET Framework 4.0 Before installing this is essential for OH;

2.Ravendb can run in different modes, such as Windows Services, IIS applications;

3. Installation if Production/test is required to authorize the file, because the production environment needs a perfect function, the authorization file can be obtained by mail: [email protected], commercial licensing is a service support, of course, there is a charge. In the case of development mode, it is open to all users without any functional limitations. I chose the development when I installed it.

4. If the development machine does not have IIS installed, only the Windows service will be installed. I am a Win10 machine, and IIS is not installed because it basically does not engage in web development.

5. Configuration, database-related file path, after installation can be seen in the system Services RAVENDB service is already running.

Official Installation Guide Address: Http://ravendb.net/docs/article-page/3.0/csharp/server/installation/using-installer

2.3RavenDB Studio First Experience

After the installation, don't panic open vs Oh. Take a good look at the article first. In the above 2.2, we select the port is 8080, then in the development environment, open the browser to enter this: http://localhost:8080

into RAVENDB's Studio database management interface Oh. BS form, also good, because there is no database at first, when you open, you will be prompted to create a new database. Such as:

When set, if encryption is selected, the Encryption selection dialog box is also popped out, such as:

Add good, then into the studio interface, look at the total, the function of a lot of it, it is worth a good study, today first stop, I hope more people to study and share.

  

Initial experience of 3.c# development

The environment is doing well, that can open vs do one vote. As we downloaded the installation package is not inside. NET drive, but NuGet is ready to get everything done. New project What do not say, open nuget, search revendb.client, such as:

After the installation. Referencing namespaces, saying that many new people here do not know what the default namespace is after adding a DLL, so let's say one more word here. Right-click on the DLL that you added, select "View in Object Browser", then open the relevant structure of your selected DLL, expand the DLL you want to select, at a glance. Let's add a namespace:

Using raven.client;using raven.client.document;using Raven.Client.Indexes;

Or the old routine, we can not need to design the database first Oh, nice name seems to be called Code-first, first get the entity up.

public class Employee{public Int32 Id {get; set;} Public String Name {get; set;} Public DateTime Birth {get; set;}}

Note that we have added the ID field here for ease of querying, in fact, each document has a default ID, even if you do not add the value will be assigned to you. Take a look at the simple new modified code:

static void Test1 () {//Create default Document object, specify database connection and database name, if not automatically new using (Idocumentstore store = new Documentstore{url = "http/ Localhost:8080/", DefaultDatabase =" Northwind "}) {//Initialize instance store. Initialize ()///Use the Idocumentsession object to manipulate the database, first call the session using (idocumentsession session = store. Opensession ()) {//Create a new Entity object Employee employee = new employee{Name = "Jok", Birth = DateTime.Now.AddYears (-10)};//Save the object directly, will be saved to the Employees collection to Session.store (employee); If you do not set an ID, the session is assigned an ID to the object, and each object has an ID by default, even if the entity class does not have the ID field Int32 employeeId = Employee. Id; Save all changes to the server session. SaveChanges ();//Query Employee Loadedemployee = Session by ID. Load<employee> (employeeId);}}}

Let's look at the database management interface and the system will create a new Northwind database by default.

Other operations we leave it for the moment, interested in everyone to try, the official document is very comprehensive, the system we can read the article out, so that other people less detours.

4.RavenDB Resources

RAVENDB official website: http://ravendb.net

GitHub Home: Https://github.com/ravendb/ravendb

RAVENDB Official documents: http://ravendb.net/docs/article-page/3.0/csharp/start/getting-started

RAVENDB Book Package: Link: Http://pan.baidu.com/s/1slQRp5F Password: G3EP

This article RAVENDB code: Link: http://pan.baidu.com/s/1skZy5e1 Password: 2e6k

RavenDB Latest version download: Link: http://pan.baidu.com/s/1eSyNyqm Password: o2k6

. NET Platform Open Source project Quick glance (15) Document database ravendb-Introduction and initial Experience

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.