couchbase tlv dev track 05 - exploring common models and integration
TRANSCRIPT
Developing with Couchbase: Exploring Common Models and Integrations
Michael Nitschinger
Engineer, Developer Solutions
JVM Integrations
Spring Data Couchbase
• Integration with Spring Data
Templates
Repositories
Exception Mapping
also @Cacheable
• Maps POJO Entities to JSON (and back)
• Under development, M2 released (RC1 soon).
Repositories – Do this
Repositories – Get this
6
Repositories – Backed by Views
findByFirstname()
findAll(), count()
7
JavaConfig
8
Putting it together
9
There is more!
• Entity mapping (Alias keys, TTLs, @Version for optimisticconcurrency,...)
• JavaConfig and XML support
• CouchbaseTemplate for lower level access
• @View to customize Views and DesignDocuments
• @Cacheable suport for transparent caching
• Spring Boot and Spring XD integration in the works
10
ReactiveCouchbase
• ReactiveCouchbase
integrates Scala, Play and Akka
Very sophisticated
• i.e. Capped Collections
• N1QL Support
• Maintained by the community
• http://reactivecouchbase.org/
ReactiveCouchbase Core
12
ReactiveCouchbase Play
13
.NET Integrations
couchbase-aspnet
• SessionState Provider Allows for storing session state in Couchbase, where it will be fast to
access, replicated, persisted
Session["Message"] = "Couchbase is awesome!”;
• OutputCache Provider Allows for retrieving some content directly from Couchbase as a cache,
rather than executing code each time.
[OutputCache(Duration = 60, VaryByParam="foo")]
public ActionResult Time(string foo)
{
return Content(DateTime.Now.ToString());
}
General Infrastructure for ASP.NET Applications
couchbase-glimpse
• CouchbaseGlimpse package available on NuGet or listed off of getglimpse.com
Allows for insight into what’s happening on the back-end as you interact with your web application
Couchbase Insight, In the Browser
couchbase-model-views
• Decorate your entities to generate views for indexing the JSON behind those classes
Ruby Integrations
ActiveModel
• Allows for idiomatic Model interaction
in Ruby and Ruby on Rails
• Simple modeling of entities
• Rich querying
• Automatic View Management
• https://github.com/couchbase/couchbase-ruby-model
ActiveModel
Full Text Search
Elasticsearch Integration
Elasticsearch + Couchbase Workflow
ES Query (Criteria)
ES Result (IDs)
Couchbase MultiGet
Couchbase Result (Docs)
The Learning Portal
• Designed and built as a collaboration
between MHE Labs and Couchbase
• Serves as proof-of-concept and
testing harness for Couchbase +
Elasticsearch integration
• Available for download and further
development as open source code
https://github.com/couchbaselabs/learningportal
Dogfooding: CBUGG
• Philosophy:
Because all bug systems are bad and I like writing bad code.
Also could be CB UGG
Couchbase Node
cbuggcbugg
cbuggcbugg
Couchbase Node
Couchbase Node
You
Elastic Search Node
Elastic Search Node
Elastic Search Node
go-couchbase REST requests
⁃ Create bug on github, closed immediately, creates a bug on cbugg.
⁃ Pull requests send to the project, create cbugg issues tagged as pull request.
⁃ Bug references can show up as comments on the bugs.
Elastic Search Connector
CBFS
CBFSNode
CBFSNode
CBFSNode
Job Queue Processing
John Connolly from The Ladders: Denormalize the Datas for Great Good
Job Queue Process
Hadoop
Ad and offer targeting
events
profiles, campaigns
profiles, real time campaign statistics
40 milliseconds to respond with the decision.
2
3
1
Ad Targeting: Moving Parts
Logs
Couchbase Server Cluster
Hadoop Cluster
sqoop import
LogsLogs
LogsLogs
Ad Targeting
Platform
sqoop export
flumeflow
Content and Recommendation Targeting
events
user profiles
make recommendations
2
3
1
ContentOriented Site
Legacy RelationalDatabase
Content Driven Site: Moving Parts
Logs
Couchbase Server Cluster
Hadoop Cluster
sqoop import
LogsLogs
LogsLogs
Content Driven
Web Site
sqoop export
Legacy RDBMS
In order to keep up with changing needs on
richer, more targeted content that is delivered
to larger and larger audiences very quickly,
data behind content driven sites is shifting to
Couchbase.
Hadoop excels at complex analytics which
may involve multiple steps of processing
which incorporate a number of different data
sources.
sqoop import
flumeflow
Extract, Transform, Load
Talend Connector
Your Turn
Q&A
Thanks!