0
Couchbase	
  104:	
  Views	
  and	
  Indexing
Jasdeep	
  Jaitla
Technical	
  Evangelist

email:	
  jasdeep@couchbase.com

...
WHAT	
  IS	
  A	
  VIEW?
Views are Indexes
• Indexes are methodologies to speed up access to information

• Examples:


- Dewey Decimal System

- C...
Indexing Subsystem
• Storing data and Indexing data are separate systems in all
databases

• In explicit schema scenarios ...
What is Map-Reduce?
• Map-Reduce is a technique designed for dealing with Big Data
and processing in parallel in distribut...
Views: Map-Reduce Indexes
• In Couchbase, Map-Reduce is specifically used to create
Indexes

• Map functions are applied to...
Sample View

function (doc, meta) {
if (doc.type == “beer” && doc.brewery_id && doc.name) {

emit(doc.name, doc.abv);
}
}
Sample View

function (doc, meta) {
if (doc.type == “beer” && doc.brewery_id && doc.name) {

emit(doc.name, doc.abv);
}
}
Sample View

function (doc, meta) {
if (doc.type == “beer” && doc.brewery_id && doc.name) {

emit(doc.name, doc.abv);
}
}
Sample View

function (doc, meta) {
if (doc.type == “beer” && doc.brewery_id && doc.name) {

emit(doc.name, doc.abv);
}
}
Sample View

function (doc, meta) {
if (doc.type == “beer” && doc.brewery_id && doc.name) {

emit(doc.name, doc.abv);
}
}
Sample View

function (doc, meta) {
if (doc.type == “beer” && doc.brewery_id && doc.name) {

emit(doc.name, doc.abv);
}
}
Sample View

function (doc, meta) {
if (doc.type == “beer” && doc.brewery_id && doc.name) {

emit(doc.name, doc.abv);
}
}
Sample View
function (doc, meta) {
if (doc.type == “beer” && doc.brewery_id && doc.name) {
emit(doc.name, doc.abv);
}
}

•...
ARCHITECTURE
Storage to Index
Couchbase Server
RAM Cache

EP Engine
Disk Write Queue

Application Server
Replication Queue

Replica Cou...
Storage to Index
Couchbase Server
RAM Cache

storage ops

EP Engine
Disk Write Queue

Application Server
Replication Queue...
Views: Eventual Consistency
Couchbase Server
RAM Cache

EP Engine
Disk Write Queue

Application Server
Replication Queue

...
Views: Eventual Consistency
Time 1
RAM Cache

storage ops

Couchbase Server
EP Engine
Disk Write Queue

Application Server...
Views: Eventual Consistency
Time 1
RAM Cache

get

Couchbase Server
EP Engine
Disk Write Queue

Application Server
Replica...
Views: Eventual Consistency
Time 1
RAM Cache

get

Couchbase Server
EP Engine
Disk Write Queue

View Engine
Indexers

Appl...
Why	
  Use	
  Map-­‐Reduce	
  Indexes?
• Index	
  (Find)	
  Documents	
  by	
  different	
  JSON	
  Values	
  	
  
• Query	...
ANATOMY	
  OF	
  A	
  VIEW
Buckets	
  >>	
  Design	
  Documents	
  >>	
  Views
Couchbase Bucket
Buckets	
  >>	
  Design	
  Documents	
  >>	
  Views
Couchbase Bucket

Design Document 1

View

View

View

Design Document...
Buckets	
  >>	
  Design	
  Documents	
  >>	
  Views
Couchbase Bucket
Indexers Are Allocated
Per Design Doc

Design Documen...
Map()	
  FuncXon	
  =>	
  Index
Every Document passes through View Map() functions
Map

function(doc,	
  meta)	
  {	
  
em...
Map()	
  FuncXon	
  =>	
  Index
Every Document passes through View Map() functions
Map

json doc

function(doc,	
  meta)	
...
Map()	
  FuncXon	
  =>	
  Index
Every Document passes through View Map() functions
Map

json doc

doc metadata

function(d...
Map()	
  FuncXon	
  =>	
  Index
Every Document passes through View Map() functions
Map

json doc

doc metadata

function(d...
Map()	
  FuncXon	
  =>	
  Index
Every Document passes through View Map() functions
Map

json doc

doc metadata

function(d...
Map()	
  FuncXon	
  =>	
  Index
Every Document passes through View Map() functions
Map

json doc

doc metadata

function(d...
Single	
  Element	
  Keys	
  (Text	
  Key)
Map

function(doc,	
  meta)	
  {	
  
emit(doc.email,	
  doc.points)	
  
}
Single	
  Element	
  Keys	
  (Text	
  Key)
Map

function(doc,	
  meta)	
  {	
  
emit(doc.email,	
  doc.points)	
  
}
text ...
Single	
  Element	
  Keys	
  (Text	
  Key)
Map

function(doc,	
  meta)	
  {	
  
emit(doc.email,	
  doc.points)	
  
}
text ...
Compound	
  Keys	
  (Array)
Array Based Index Keys get sorted as Strings, 

but can be grouped by array elements

Map

fun...
Compound	
  Keys	
  (Array)
Array Based Index Keys get sorted as Strings, 

but can be grouped by array elements

Map

fun...
Compound	
  Keys	
  (Array)
Array Based Index Keys get sorted as Strings, 

but can be grouped by array elements

Map

fun...
32 3
QUERYING	
  VIEWS

32 3
View Query Parameters
•  key$=$“”$
­  used%for%exact%match%of%index1key%

•  keys$=$[]$
­  used%for%matching%set%of%index1...
Most	
  Common	
  Query’s	
  Are	
  Ranges
doc.email

meta.id

abba@couchbase.com

u::1

beta@couchbase.com

u::7

jasdeep...
Most	
  Common	
  Query’s	
  Are	
  Ranges
doc.email

meta.id

abba@couchbase.com

u::1

?startkey=”b1”	
  &	
  endkey=”zZ...
Most	
  Common	
  Query’s	
  Are	
  Ranges
doc.email

meta.id

abba@couchbase.com

u::1

?startkey=”bz”	
  &	
  endkey=”zn...
Most	
  Common	
  Query’s	
  Are	
  Ranges
doc.email

meta.id

abba@couchbase.com

u::1

beta@couchbase.com

u::7

jasdeep...
Index-­‐Key	
  Matching
doc.email

meta.id

abba@couchbase.com

u::1

beta@couchbase.com

u::7

jasdeep@couchbase.com

u::...
Index-­‐Key	
  Matching
doc.email
abba@couchbase.com

Match	
  a	
  Single	
  Index-­‐Key

u::1

beta@couchbase.com

u::7
...
Index-­‐Key	
  Set	
  Matches
doc.email
abba@couchbase.com
?keys=[“math@couchbase.com”,	
  
“ye3@couchbase.com”]

Query	
 ...
Understanding	
  CollaXon	
  Order
Byte	
  Order
1234567890	
  <	
  a-­‐z	
  <	
  A-­‐Z
Unicode	
  Colla3on
1234567890	
  ...
Understanding Stale
stale	
  =	
  UPDATE_AFTER	
  (default	
  if	
  nothing	
  is	
  specified)	
  
always	
  get	
  fastes...
Built-In Reduces
• Are faster than creating your own reduces for the same
information


- _count
• gives count for number ...
Custom Reduces
• Are a bit tricky at first, it's a skill!

• Learn about it through our docs, practice first, most common
pr...
32 3
BEER	
  SAMPLE	
  VIEW

32 3
Beer	
  Sample	
  Database	
  Example
meta
{!

}

doc
{!

"name": "Aventinus Weizenstarkbier / Doppel
"id": "110f37fa30",!...
Beer	
  Sample	
  Database	
  Example
meta
{!

}

doc
{!

alcohol by volume (abv)

"name": "Aventinus Weizenstarkbier / Do...
Map	
  FuncXon	
  -­‐	
  Index	
  DefiniXon

30
Map	
  FuncXon	
  -­‐	
  Index	
  DefiniXon

+row

30
Map	
  FuncXon	
  -­‐	
  Index	
  DefiniXon

+row

indexed key

30
Map	
  FuncXon	
  -­‐	
  Index	
  DefiniXon

+row

indexed key

value(s)

30
Result	
  Set	
  -­‐	
  Brewery	
  ID’s	
  by	
  Beer

31
Result	
  Set	
  -­‐	
  Brewery	
  ID’s	
  by	
  Beer
brewery_id

alcohol by volume (abv)

document key (of the beer)

31
Reduce	
  Values	
  (doc.abv)	
  with	
  _stats

34 34
Reduce	
  Values	
  (doc.abv)	
  with	
  _stats

add _stats built-in reduction

34 34
Query	
  with	
  Group	
  and	
  Reduce
Find average alcohol by volume per brewery.

33
Query	
  with	
  Group	
  and	
  Reduce
Find average alcohol by volume per brewery.
add _stats built-in reduction

set gro...
Groups	
  Brewery_ID’s,	
  Reduces	
  for	
  Stats

Brewery ID’s are Grouped, and _stats collected (Reduced)

35 35
Groups	
  Brewery_ID’s,	
  Reduces	
  for	
  Stats
group=true & reduce=true

number of beers by this brewery

min abv

max...
INTERFACE	
  DEMO
Q	
  &	
  A
Webinar   Couchbase 104 - Views and Indexing
Webinar   Couchbase 104 - Views and Indexing
Webinar   Couchbase 104 - Views and Indexing
Webinar   Couchbase 104 - Views and Indexing
Webinar   Couchbase 104 - Views and Indexing
Webinar   Couchbase 104 - Views and Indexing
Upcoming SlideShare
Loading in...5
×

Webinar Couchbase 104 - Views and Indexing

2,497

Published on

Learn the architecture and use of Views, the structure of Map-Reduce functions, design documents, querying views and view query parameters, primary aggregate reduces and grouping, eventual consistency of indexes and strategies of use.

What will be covered during this training:

What are Indexes
What is a Map-Reduce
Understanding Design Documents
Admin Console Overview
Anatomy of Map Functions
Batch Processing
Range Querying, Index-Key Querying, Set Querying
RDBMS Queries vs. Map-Reduce Queries
Grouping and Group Level
Eventual Consistency and Stale Parameter
Tips for Creating Views and Sandboxing Tests

Published in: Technology, Education
1 Comment
5 Likes
Statistics
Notes
  • I'm working creating index using CouchDB for multidimensional objects (including Documents in space). Comments and suggestions will be appreciated. The idea is to generate and store a document ID for retrieval and range queries.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
2,497
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
133
Comments
1
Likes
5
Embeds 0
No embeds

No notes for slide

Transcript of "Webinar Couchbase 104 - Views and Indexing"

  1. 1. Couchbase  104:  Views  and  Indexing Jasdeep  Jaitla Technical  Evangelist email:  jasdeep@couchbase.com twi0er:  @scalabl3
  2. 2. WHAT  IS  A  VIEW?
  3. 3. Views are Indexes • Indexes are methodologies to speed up access to information • Examples: - Dewey Decimal System - Card Catalogs - Hierarchal File Folders • In databases, Indexes are specialized structures for searching for data, typically one or two key fields
  4. 4. Indexing Subsystem • Storing data and Indexing data are separate systems in all databases • In explicit schema scenarios (RDBMS), Indexes are optimized based on the data type(s) • In flexible schema scenarios Map-Reduce is used to create indexes
  5. 5. What is Map-Reduce? • Map-Reduce is a technique designed for dealing with Big Data and processing in parallel in distributed systems • Map-Reduce is also specifically designed for dealing with unstructured or semi-structured data • Map functions identify data with collections, process them, and output transformed values • Reduce functions take the output of Map functions and perform numeric aggregate calculations on them
  6. 6. Views: Map-Reduce Indexes • In Couchbase, Map-Reduce is specifically used to create Indexes • Map functions are applied to JSON documents and they output or "emit" data that is organized in an Index form emit() CRUD Operations MAP() (processed)
  7. 7. Sample View function (doc, meta) { if (doc.type == “beer” && doc.brewery_id && doc.name) { emit(doc.name, doc.abv); } }
  8. 8. Sample View function (doc, meta) { if (doc.type == “beer” && doc.brewery_id && doc.name) { emit(doc.name, doc.abv); } }
  9. 9. Sample View function (doc, meta) { if (doc.type == “beer” && doc.brewery_id && doc.name) { emit(doc.name, doc.abv); } }
  10. 10. Sample View function (doc, meta) { if (doc.type == “beer” && doc.brewery_id && doc.name) { emit(doc.name, doc.abv); } }
  11. 11. Sample View function (doc, meta) { if (doc.type == “beer” && doc.brewery_id && doc.name) { emit(doc.name, doc.abv); } }
  12. 12. Sample View function (doc, meta) { if (doc.type == “beer” && doc.brewery_id && doc.name) { emit(doc.name, doc.abv); } }
  13. 13. Sample View function (doc, meta) { if (doc.type == “beer” && doc.brewery_id && doc.name) { emit(doc.name, doc.abv); } }
  14. 14. Sample View function (doc, meta) { if (doc.type == “beer” && doc.brewery_id && doc.name) { emit(doc.name, doc.abv); } } • Creates an Index of Beer Names (doc.name) and the Alcohol By Volume values (doc.abv) - Filters Documents • Only JSON Documents with json key doc.type == "beer" • and doc.brewery_id is non-null • and doc.name is non-null - Outputs • Beer Name (doc.name) [searchable] • Beer Alcohol By Volume (doc.abv) [row value]
  15. 15. ARCHITECTURE
  16. 16. Storage to Index Couchbase Server RAM Cache EP Engine Disk Write Queue Application Server Replication Queue Replica Couchbase Cluster Machine View Engine Indexers
  17. 17. Storage to Index Couchbase Server RAM Cache storage ops EP Engine Disk Write Queue Application Server Replication Queue Replica Couchbase Cluster Machine View Engine Indexers
  18. 18. Views: Eventual Consistency Couchbase Server RAM Cache EP Engine Disk Write Queue Application Server Replication Queue Replica Couchbase Cluster Machine View Engine Indexers
  19. 19. Views: Eventual Consistency Time 1 RAM Cache storage ops Couchbase Server EP Engine Disk Write Queue Application Server Replication Queue Replica Couchbase Cluster Machine View Engine Indexers
  20. 20. Views: Eventual Consistency Time 1 RAM Cache get Couchbase Server EP Engine Disk Write Queue Application Server Replication Queue Replica Couchbase Cluster Machine View Engine Indexers
  21. 21. Views: Eventual Consistency Time 1 RAM Cache get Couchbase Server EP Engine Disk Write Queue View Engine Indexers Application Server Replication Queue Replica Couchbase Cluster Machine Time 2
  22. 22. Why  Use  Map-­‐Reduce  Indexes? • Index  (Find)  Documents  by  different  JSON  Values     • Query  Documents  by  JSON  Values     • Create  StaXsXcs  and  Aggregates   When  are  Indexes  Necessary? • Documents  are  Keyed  by  Random  ProperXes  (UUID,  GUID,  etc.)   • IteraXng  through  Lists  of  Documents  with  Random  Keys   • IteraXng  through  Lists  of  Documents  on  different  JSON  ProperXes   (i.e.  all  User  docs,  all  Product  docs,  by  Timestamp,  etc.)  
  23. 23. ANATOMY  OF  A  VIEW
  24. 24. Buckets  >>  Design  Documents  >>  Views Couchbase Bucket
  25. 25. Buckets  >>  Design  Documents  >>  Views Couchbase Bucket Design Document 1 View View View Design Document 2 View View
  26. 26. Buckets  >>  Design  Documents  >>  Views Couchbase Bucket Indexers Are Allocated Per Design Doc Design Document 1 View View View Design Document 2 Can Only Access Data in the Bucket Namespace All Updated at Same Time View View
  27. 27. Map()  FuncXon  =>  Index Every Document passes through View Map() functions Map function(doc,  meta)  {   emit(doc.username,  doc.email)   }
  28. 28. Map()  FuncXon  =>  Index Every Document passes through View Map() functions Map json doc function(doc,  meta)  {   emit(doc.username,  doc.email)   }
  29. 29. Map()  FuncXon  =>  Index Every Document passes through View Map() functions Map json doc doc metadata function(doc,  meta)  {   emit(doc.username,  doc.email)   }
  30. 30. Map()  FuncXon  =>  Index Every Document passes through View Map() functions Map json doc doc metadata function(doc,  meta)  {   emit(doc.username,  doc.email)   } create row
  31. 31. Map()  FuncXon  =>  Index Every Document passes through View Map() functions Map json doc doc metadata function(doc,  meta)  {   emit(doc.username,  doc.email)   } create row indexed key
  32. 32. Map()  FuncXon  =>  Index Every Document passes through View Map() functions Map json doc doc metadata function(doc,  meta)  {   emit(doc.username,  doc.email)   } create row indexed key output value(s)
  33. 33. Single  Element  Keys  (Text  Key) Map function(doc,  meta)  {   emit(doc.email,  doc.points)   }
  34. 34. Single  Element  Keys  (Text  Key) Map function(doc,  meta)  {   emit(doc.email,  doc.points)   } text key
  35. 35. Single  Element  Keys  (Text  Key) Map function(doc,  meta)  {   emit(doc.email,  doc.points)   } text key meta.id doc.email doc.points u::1 abba@couchbase.com 1000 u::35 jasdeep@couchbase.com 1200 u::20 zorro@couchbase.com 900
  36. 36. Compound  Keys  (Array) Array Based Index Keys get sorted as Strings, but can be grouped by array elements Map function(doc,  meta)  {   emit(dateToArray(doc.timestamp),  1)   }
  37. 37. Compound  Keys  (Array) Array Based Index Keys get sorted as Strings, but can be grouped by array elements Map function(doc,  meta)  {   emit(dateToArray(doc.timestamp),  1)   } array key
  38. 38. Compound  Keys  (Array) Array Based Index Keys get sorted as Strings, but can be grouped by array elements Map function(doc,  meta)  {   emit(dateToArray(doc.timestamp),  1)   } meta.id dateToArray(doc.3mestamp) value array key u::20 [2012,10,9,18,45] 1 u::1 [2012,9,26,11,15] 1 u::35 [2012,8,13,2,12] 1
  39. 39. 32 3
  40. 40. QUERYING  VIEWS 32 3
  41. 41. View Query Parameters •  key$=$“”$ ­  used%for%exact%match%of%index1key% •  keys$=$[]$ ­  used%for%matching%set%of%index1keys% •  startkey/endkey$=$“”$ ­  used%for%range%queries%on%index1keys% •  startkey_docID/endkey_docID$=$“”$ ­  used%for%range%queries%on%meta.id% •  stale=[false,$update_a;er,$true]$ ­  used%to%decide%indexer%behavior%from%client% •  group/group_by$ ­  used%with%reduces%to%aggregate%with%grouping%
  42. 42. Most  Common  Query’s  Are  Ranges doc.email meta.id abba@couchbase.com u::1 beta@couchbase.com u::7 jasdeep@couchbase.com u::2 math@couchbase.com u::5 ma0@couchbase.com u::6 yeX@couchbase.com u::4 zorro@couchbase.com u::3
  43. 43. Most  Common  Query’s  Are  Ranges doc.email meta.id abba@couchbase.com u::1 ?startkey=”b1”  &  endkey=”zZ” beta@couchbase.com u::7 Pulls  the  Index-­‐Keys   between  UTF-­‐8  Range   specified  by  the   startkey  and  endkey. jasdeep@couchbase.com u::2 math@couchbase.com u::5 ma0@couchbase.com u::6 yeX@couchbase.com u::4 zorro@couchbase.com u::3
  44. 44. Most  Common  Query’s  Are  Ranges doc.email meta.id abba@couchbase.com u::1 ?startkey=”bz”  &  endkey=”zn” beta@couchbase.com u::7 Pulls  the  Index-­‐Keys   between  UTF-­‐8  Range   specified  by  the   startkey  and  endkey. jasdeep@couchbase.com u::2 math@couchbase.com u::5 ma0@couchbase.com u::6 yeX@couchbase.com u::4 zorro@couchbase.com u::3
  45. 45. Most  Common  Query’s  Are  Ranges doc.email meta.id abba@couchbase.com u::1 beta@couchbase.com u::7 jasdeep@couchbase.com u::2 math@couchbase.com u::5 ma0@couchbase.com u::6 yeX@couchbase.com u::4 zorro@couchbase.com u::3
  46. 46. Index-­‐Key  Matching doc.email meta.id abba@couchbase.com u::1 beta@couchbase.com u::7 jasdeep@couchbase.com u::2 math@couchbase.com u::5 ma0@couchbase.com u::6 yeX@couchbase.com u::4 zorro@couchbase.com u::3
  47. 47. Index-­‐Key  Matching doc.email abba@couchbase.com Match  a  Single  Index-­‐Key u::1 beta@couchbase.com u::7 jasdeep@couchbase.com ?key=”math@couchbase.com”   meta.id u::2 math@couchbase.com u::5 ma0@couchbase.com u::6 yeX@couchbase.com u::4 zorro@couchbase.com u::3
  48. 48. Index-­‐Key  Set  Matches doc.email abba@couchbase.com ?keys=[“math@couchbase.com”,   “ye3@couchbase.com”] Query  MulXple  in  the   Set  (Array  NotaXon) meta.id u::1 beta@couchbase.com u::7 jasdeep@couchbase.com u::2 math@couchbase.com u::5 ma0@couchbase.com u::6 yeX@couchbase.com u::4 zorro@couchbase.com u::3
  49. 49. Understanding  CollaXon  Order Byte  Order 1234567890  <  a-­‐z  <  A-­‐Z Unicode  Colla3on 1234567890  <  aAbBcCdDeEfFgGhHiIjJkKlLmM... a < á < A < Á < b If  it  were  Byte  Order  2  Queries  Merged: startkey="y"&endkey="z"  merged  with  startkey="Y"&endkey="Z" With  Unicode  Colla3on  gets  both  y  and  Y: startkey="y"&endkey="z"
  50. 50. Understanding Stale stale  =  UPDATE_AFTER  (default  if  nothing  is  specified)   always  get  fastest  response   can  take  two  queries  to  read  your  own  writes   stale  =  OK   auto  update  will  trigger  eventually   might  not  see  your  own  writes  for  a  few  minutes   least  frequent  updates  -­‐>  least  resource  impact   stale  =  FALSE   Use  with  Persistence  observe  if  data  needs  to  be  included  in  view  results   BUT  aware  of  delay  it  adds,  only  use  when  really  required
  51. 51. Built-In Reduces • Are faster than creating your own reduces for the same information - _count • gives count for number of items in Index - _sum • sums value parameters (for numeric values only) - _stats • gives sum, count, min, max and sum of squares for statistics ! !
  52. 52. Custom Reduces • Are a bit tricky at first, it's a skill! • Learn about it through our docs, practice first, most common problem in custom reduces is that they don't "reduce" the data • Can be creatively used! • Always do it in a separate Design Document to sandbox it from your existing Views, if you have a logic problem or error it won't interrupt existing Views
  53. 53. 32 3
  54. 54. BEER  SAMPLE  VIEW 32 3
  55. 55. Beer  Sample  Database  Example meta {! } doc {! "name": "Aventinus Weizenstarkbier / Doppel "id": "110f37fa30",! "rev": "1-000000000",! Weizen Bock",! "abv": 8.2,! "expiration": 0,! "ibu": 0,! "flags": 0,! "srm": 0,! "type": "json"! "upc": 0,! "type": "beer",! "brewery_id": "110f1f2012",! "updated": "2010-07-22 20:00:20",! "description": "Dark-ruby, almost black-colored and streaked with fine top-fermenting yeast, this beer has a compact and persistent head. This is a very intense wheat doppelbock with a complex spicy chocolate-like arome with a hint of banana and raisins. On the palate, you experience a soft touch and on the tongue it is very rich and complex, though fresh with a hint of caramel. It finishes in a rich soft and lightly bitter impression.",! "style": "South German-Style Weizenbock",! "category": "German Ale"! }
  56. 56. Beer  Sample  Database  Example meta {! } doc {! alcohol by volume (abv) "name": "Aventinus Weizenstarkbier / Doppel "id": "110f37fa30",! "rev": "1-000000000",! Weizen Bock",! "abv": 8.2,! "expiration": 0,! document key "ibu": 0,! "flags": 0,! "srm": 0,! brewery_id (key) "type": "json"! "upc": 0,! "type": "beer",! "brewery_id": "110f1f2012",! "updated": "2010-07-22 20:00:20",! "description": "Dark-ruby, almost black-colored and streaked with fine top-fermenting yeast, this beer has a compact and persistent head. This is a very intense wheat doppelbock with a complex spicy chocolate-like arome with a hint of banana and raisins. On the palate, you experience a soft touch and on the tongue it is very rich and complex, though fresh with a hint of caramel. It finishes in a rich soft and lightly bitter impression.",! "style": "South German-Style Weizenbock",! "category": "German Ale"! }
  57. 57. Map  FuncXon  -­‐  Index  DefiniXon 30
  58. 58. Map  FuncXon  -­‐  Index  DefiniXon +row 30
  59. 59. Map  FuncXon  -­‐  Index  DefiniXon +row indexed key 30
  60. 60. Map  FuncXon  -­‐  Index  DefiniXon +row indexed key value(s) 30
  61. 61. Result  Set  -­‐  Brewery  ID’s  by  Beer 31
  62. 62. Result  Set  -­‐  Brewery  ID’s  by  Beer brewery_id alcohol by volume (abv) document key (of the beer) 31
  63. 63. Reduce  Values  (doc.abv)  with  _stats 34 34
  64. 64. Reduce  Values  (doc.abv)  with  _stats add _stats built-in reduction 34 34
  65. 65. Query  with  Group  and  Reduce Find average alcohol by volume per brewery. 33
  66. 66. Query  with  Group  and  Reduce Find average alcohol by volume per brewery. add _stats built-in reduction set group=true & reduce=true 33
  67. 67. Groups  Brewery_ID’s,  Reduces  for  Stats Brewery ID’s are Grouped, and _stats collected (Reduced) 35 35
  68. 68. Groups  Brewery_ID’s,  Reduces  for  Stats group=true & reduce=true number of beers by this brewery min abv max abv Brewery ID’s are Grouped, and _stats collected (Reduced) 35 35
  69. 69. INTERFACE  DEMO
  70. 70. Q  &  A
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×