Welcome Guest, you are in: Login

dbones docs

RSS RSS

Navigation (ArmChair)





Search the wiki
»

Work in progress

Overview

This article looks at the application/solution architecture which can be used with ArmChair.

This section may change as the ArmChair matures, supporting more of the advanced features of CouchDB.

NOTE: your solution may be different, as each project has different requirements.

CouchDb Only

CouchDb offers a complete database solution. The simplist thing (in terms of moving parts) is to take advantage of CouchDb directly, for both storage and quering.

ArmChair supports this (note that Querying is provided by the MongoQuery interface).

Id's are King

This solution is to separate the Data storage from the secondary index.

Here we would CouchDb as a Key/Value storage of our documents, where it can handle the replications, the reads and writes etc.

And for the index's we can employ any good server component (Solr, Elasticsearch or Lucene). Where all the documents are indexed via Lucene (both Elasticsearch and Solr use Lucene), only storing the data required to search and sort (note that the latter is quite important too).

How do I query? quite simple, we would query against the index and retrive the document ID's. Then using ArmChair, we can query using the set of ID's.

ArmChair will load all the documents directly from CouchDB using the ID hash index, nice and fast!

NOTE: paging and sorting should be handled via the query which is sent to the index component.

The concept here is not new, and has been used by anyone who uses Solr, Elasticsearch or Lucene.

Lucene

The following is a overview of the Lucene solution, note within the .NET application the index needs to be managed directly in the application. Something like stackoverflow.com used to do.

Image

Elasticsearch

NOTE: Rivers have been deprecated https://www.elastic.co/guide/en/elasticsearch/rivers/current/index.html, consider a similar solution explained above, where we can update elastic on change, here is some example code

The following is the Elasticsearch solution, which we take we can take advantage of CouchDB's replication. Although this seems to be a very clean solution, the knowledge of the index is located in 2 places (inside your app and inside the elasticsearch river).

Image



legal note, all logos (in this article) belong to their own project retrospectively.
dbones docs, is a sub-site of dbones.co.uk, all its content belongs to dbones.co.uk, this also includes logo's.