©2016 Couchbase Inc. 2
Michael NitschingerSenior Software Engineer, [email protected]
daschl
IMAGE GOES HERE
©2016 Couchbase Inc. 3
Michael NitschingerSenior Software Engineer, [email protected]
daschl
http://www.wienerwald.at/wp-content/uploads/2016/01/schnitzel_pommes.jpg
©2016 Couchbase Inc. 4
Michael NitschingerSenior Software Engineer, [email protected]
daschl
http://www.wienerwald.at/wp-content/uploads/2016/01/schnitzel_pommes.jpg
©2016 Couchbase Inc. 6
One SDK API to rule them all
http://vignette3.wikia.nocookie.net/lotr/images/e/e1/Gollum_Render.png/revision/20141216091433
©2016 Couchbase Inc.©2016 Couchbase Inc.
Services
STORAGE
Couchbase Server 1
SHARD7
SHARD9
SHARD5
SHARDSHARDSHARD
Managed Cache
Cluster ManagerCluster Manager
Data Service STORAGE
Couchbase Server 2
Managed Cache
Cluster ManagerCluster Manager
Data Service STORAGE
Couchbase Server 3
SHARD7
SHARD9
SHARD5
SHARDSHARDSHARD
Managed Cache
Cluster ManagerCluster Manager
Data Service STORAGE
Couchbase Server 4
SHARD7
SHARD9
SHARD5
SHARDSHARDSHARD
Managed Cache
Cluster ManagerCluster Manager
Index Service STORAGE
Couchbase Server 5
SHARD7
SHARD9
SHARD5
SHARDSHARDSHARD
Managed Cache
Cluster ManagerCluster Manager
STORAGE
Couchbase Server 6
SHARD7
SHARD9
SHARD5
SHARDSHARDSHARD
Managed Cache
Cluster ManagerCluster Manager
Query Service
FTS Service
Index Service
©2016 Couchbase Inc.©2016 Couchbase Inc.
Services
DataBinary11210
ViewsJSON8092
N1QLJSON8093
FTSJSON8094
AnalyticsJSON8095
©2016 Couchbase Inc.©2016 Couchbase Inc.
Balance
10https://upload.wikimedia.org/wikipedia/commons/b/b7/Unico_Anello.png
Language Specifics Uniformity across SDKs
©2016 Couchbase Inc.©2016 Couchbase Inc.
Balance
11https://upload.wikimedia.org/wikipedia/commons/b/b7/Unico_Anello.png
©2016 Couchbase Inc.©2016 Couchbase Inc.
Balance
12https://upload.wikimedia.org/wikipedia/commons/b/b7/Unico_Anello.png
©2016 Couchbase Inc.©2016 Couchbase Inc.
Balance
13https://upload.wikimedia.org/wikipedia/commons/b/b7/Unico_Anello.png
©2016 Couchbase Inc.©2016 Couchbase Inc.
Balance
14https://upload.wikimedia.org/wikipedia/commons/b/b7/Unico_Anello.png
©2016 Couchbase Inc. 15©2016 Couchbase Inc.
RFCs
• Semi-Formal process to advance SDKs in both API and behavior• One Shepherd• Collaborative consensus (hard!) compromises• Public: https://github.com/couchbaselabs/sdk-rfcs
©2016 Couchbase Inc. 20©2016 Couchbase Inc.
Key/Value
• Fastest way to access & mutate documents• Access by Document ID only• Includes subdocument manipulation• Efficient binary protocol
Latency Flexibility
©2016 Couchbase Inc. 24©2016 Couchbase Inc.
Views
• Distributed Map-Reduce• Great for Aggregations (fast)• Spatial Support
Latency Flexibility
©2016 Couchbase Inc. 26©2016 Couchbase Inc.
N1QL
• Very flexible, but get your index right• Global Index instead of Map/Reduce• Similar to SQL
Latency Flexibility
©2016 Couchbase Inc. 28©2016 Couchbase Inc.
Full Text Search
• Very Flexible, but more concepts to learn initially• Inverted Index• Still Developer Preview• Similar to Elasticsearch
Latency Flexibility
©2016 Couchbase Inc. 30©2016 Couchbase Inc.
Analytics
• Highly capable analytical storage engine• Similar to N1QL for querying• Performs great on huge datasets and aggregations• Developer Preview announced at Connect!
Latency Flexibility
©2016 Couchbase Inc. 31©2016 Couchbase Inc.
Streaming/Changes Feed
• Based on the DCP protocol• Very fast and efficient• Low level -> Building Block
Latency Flexibility
©2016 Couchbase Inc. 32©2016 Couchbase Inc.
Michael’s Super Sophisticated Flowchart to Success
Know the Doc ID(s)? SuccessUse KV
Pre GroupedAggregations?
Use Views
Need Full Text Queries?
Use FTS Use N1QL
©2016 Couchbase Inc. 33©2016 Couchbase Inc.
Michael’s Super Sophisticated Flowchart to Success
Know the Doc ID(s)? SuccessUse KV
Pre GroupedAggregations?
Use Views
Need Full Text Queries?
Use FTS Use N1QL
©2016 Couchbase Inc. 34©2016 Couchbase Inc.
Michael’s Super Sophisticated Flowchart to Success
Know the Doc ID(s)? SuccessUse KV
Pre GroupedAggregations?
Use Views
Need Full Text Queries?
Use FTS Use N1QL
©2016 Couchbase Inc. 35©2016 Couchbase Inc.
Michael’s Super Sophisticated Flowchart to Success
Know the Doc ID(s)? SuccessKV
Pre GroupedAggregations?
Views
Need Full Text Queries?
FTS N1QL
©2016 Couchbase Inc. 37©2016 Couchbase Inc.
The “Cache It While Its Hot”
• Transparently cache expensive N1QL/FTS/View results with a TTL and load while hot
©2016 Couchbase Inc. 38©2016 Couchbase Inc.
The “Cache It While Its Hot”
• Transparently cache expensive N1QL/FTS/View results with a TTL and load while hot
©2016 Couchbase Inc. 39©2016 Couchbase Inc.
The “Custom Bulk Loader”
• Perform a N1QL, FTS or View query to just fetch the doc IDs, then perform a bulk KV fetch
©2016 Couchbase Inc. 40©2016 Couchbase Inc.
The “Custom Bulk Loader”
• Perform a N1QL, FTS or View query to just fetch the doc IDs, then perform a bulk KV fetch
©2016 Couchbase Inc. 41©2016 Couchbase Inc.
The “Tarzan of the Docs”
• “Leap” from Doc to Doc via references and use bulk fetches for higher throughput
• Scales with increasing batch size• Allows to “code” intermediate steps with UDFs
©2016 Couchbase Inc. 42©2016 Couchbase Inc.
Summary
TradeoffLatency vs. Flexibility
RememberPowerful Patterns
Unsure?Think of the Flowchart
Participatein the RFCs!
Top Related