RoberthussyThanks more comprehensive articles. One that can easily and comprehensively understood by the audience. I must say that the writer did it! Its straightforward and honest deliver made a huge impact amongst its readers. Clearly, its unparalleled presentation and mastery is something that we must celebrate and proud SEO Services6 months ago
Are you sure you want to
flovGood presentation but the Tree that is shown there is not a B-Tree, it is a binary tree. A B-Tree is a fully balanced data structure which usually has more than one element in one node: http://en.wikipedia.org/wiki/B-tree2 years ago
CouchDB on Rails
An Introduction
Jonathan Weiss
03.07.2010
Who am I?
Working for Peritor in Berlin, Germany
Written, maintain, or involved in
Webistrano
Capistrano
SimplyStored
Happening
The great fire of London
http://github.com/jweiss
@jweiss
2
Example Map Result
Map functions are similar to SQL indices
ID KEY VALUE
51ABFA211 Cap 1
ABC123456 Cappy 1
BCCD12CBB Helmet 1
BCCD12CBB Sombrero 1
Sorted by the key
Key can also be an array
Value can be complex JSON
30
Query a view
GET /dbname/_design/hats/_view/all
HTTP Client
{"total_rows":348,"offset":0,"rows”:[
{"id":"A","key":"A","value":1},
{"id":"B","key":"B","value":1},
]}
31
Query a view
GET /dbname/_design/hats/_view/all?
include_docs=true
HTTP Client
32
SQL vs. JavaScript
ActiveRecord
Vs.
SimplyStored
35
SimplyStored
Convenience Layer for CouchDB
Models & Associations
Validations
Callbacks BSD-licensed on
Dynamic finder http://github.com/peritor/simply_stored
S3 attachments On top of CouchPotato, CouchRest & RestClient
Paranoid delete
ActiveModel compliant
36
Setup
Install
Load in environment.rb
Configure
37
Setup
38
39
40
RockingChair
In-memory CouchDB
Just a big Hash
Understands all SimplyStored generated views
Speeds up tests
Tests can run in parallel
Nice for debugging
BSD-licensed on
http://github.com/jweiss/rocking_chair
41
Database Requirements
High Availability
Easy Replication
Clustering
Robustness
Short Recovery Time
42
Replication
B-Tree
XXXXX
Photo by Mathias Meyer
43
B-Tree
Append only
Concurrency (MVCC)
Crash resistant
Hot backups
Compaction
44
Replication
45
CouchDB Replication
POST /_replicate
POST /_replicate
Eventually consistent & conflict resolution
46
A B-Tree is a fully balanced data structure which usually has more than one element in one node:
http://en.wikipedia.org/wiki/B-tree 2 years ago