couchbase tlv dev track 05 - exploring common models and integration

40

Upload: couchbase

Post on 07-Jul-2015

1.174 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Couchbase TLV Dev track 05 - exploring common models and integration
Page 2: Couchbase TLV Dev track 05 - exploring common models and integration

Developing with Couchbase: Exploring Common Models and Integrations

Michael Nitschinger

Engineer, Developer Solutions

Page 3: Couchbase TLV Dev track 05 - exploring common models and integration

JVM Integrations

Page 4: Couchbase TLV Dev track 05 - exploring common models and integration

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).

Page 5: Couchbase TLV Dev track 05 - exploring common models and integration

Repositories – Do this

Page 6: Couchbase TLV Dev track 05 - exploring common models and integration

Repositories – Get this

6

Page 7: Couchbase TLV Dev track 05 - exploring common models and integration

Repositories – Backed by Views

findByFirstname()

findAll(), count()

7

Page 8: Couchbase TLV Dev track 05 - exploring common models and integration

JavaConfig

8

Page 9: Couchbase TLV Dev track 05 - exploring common models and integration

Putting it together

9

Page 10: Couchbase TLV Dev track 05 - exploring common models and integration

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

Page 11: Couchbase TLV Dev track 05 - exploring common models and integration

ReactiveCouchbase

• ReactiveCouchbase

­ integrates Scala, Play and Akka

­ Very sophisticated

• i.e. Capped Collections

• N1QL Support

• Maintained by the community

• http://reactivecouchbase.org/

Page 12: Couchbase TLV Dev track 05 - exploring common models and integration

ReactiveCouchbase Core

12

Page 13: Couchbase TLV Dev track 05 - exploring common models and integration

ReactiveCouchbase Play

13

Page 14: Couchbase TLV Dev track 05 - exploring common models and integration

.NET Integrations

Page 15: Couchbase TLV Dev track 05 - exploring common models and integration

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

Page 16: Couchbase TLV Dev track 05 - exploring common models and integration

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

Page 17: Couchbase TLV Dev track 05 - exploring common models and integration
Page 18: Couchbase TLV Dev track 05 - exploring common models and integration

couchbase-model-views

• Decorate your entities to generate views for indexing the JSON behind those classes

Page 19: Couchbase TLV Dev track 05 - exploring common models and integration

Ruby Integrations

Page 20: Couchbase TLV Dev track 05 - exploring common models and integration

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

Page 21: Couchbase TLV Dev track 05 - exploring common models and integration

ActiveModel

Page 22: Couchbase TLV Dev track 05 - exploring common models and integration

Full Text Search

Page 23: Couchbase TLV Dev track 05 - exploring common models and integration

Elasticsearch Integration

Page 24: Couchbase TLV Dev track 05 - exploring common models and integration

Elasticsearch + Couchbase Workflow

ES Query (Criteria)

ES Result (IDs)

Couchbase MultiGet

Couchbase Result (Docs)

Page 25: Couchbase TLV Dev track 05 - exploring common models and integration

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

Page 26: Couchbase TLV Dev track 05 - exploring common models and integration

Dogfooding: CBUGG

• Philosophy:

­ Because all bug systems are bad and I like writing bad code.

­ Also could be CB UGG

Page 27: Couchbase TLV Dev track 05 - exploring common models and integration

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

Page 28: Couchbase TLV Dev track 05 - exploring common models and integration

Job Queue Processing

Page 30: Couchbase TLV Dev track 05 - exploring common models and integration

Hadoop

Page 31: Couchbase TLV Dev track 05 - exploring common models and integration

Ad and offer targeting

events

profiles, campaigns

profiles, real time campaign statistics

40 milliseconds to respond with the decision.

2

3

1

Page 32: Couchbase TLV Dev track 05 - exploring common models and integration

Ad Targeting: Moving Parts

Logs

Couchbase Server Cluster

Hadoop Cluster

sqoop import

LogsLogs

LogsLogs

Ad Targeting

Platform

sqoop export

flumeflow

Page 33: Couchbase TLV Dev track 05 - exploring common models and integration

Content and Recommendation Targeting

events

user profiles

make recommendations

2

3

1

ContentOriented Site

Legacy RelationalDatabase

Page 34: Couchbase TLV Dev track 05 - exploring common models and integration

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

Page 35: Couchbase TLV Dev track 05 - exploring common models and integration

Extract, Transform, Load

Page 36: Couchbase TLV Dev track 05 - exploring common models and integration

Talend Connector

Page 37: Couchbase TLV Dev track 05 - exploring common models and integration

Your Turn

Page 38: Couchbase TLV Dev track 05 - exploring common models and integration

Q&A

Page 39: Couchbase TLV Dev track 05 - exploring common models and integration

Thanks!

Page 40: Couchbase TLV Dev track 05 - exploring common models and integration