mongodb europe 2016 - using mongodb to build a fast and scalable content repository

49
C H A N G I N G F O R M O N G O D B

Upload: mongodb

Post on 07-Jan-2017

243 views

Category:

Data & Analytics


1 download

TRANSCRIPT

C H A N G I N G F O R M O N G O D B

G I V I N G S O M E

C O N T E X T

Application

WHAT DOES THE SWITCH TO MONGODB CHANGE ?

• FOR DEVELOPPERS & ARCHITECTS

• FOR OPS AND USERS OF THE PRODUCT

S W I T C H I N G T O M O N G O D B

N U X E O P L A T F O R M

We provide a Platform that developers can use to

build highly customised content applications.

We provide the components and the tools to assemble them.

https://github.com/nuxeo

N U X E O P L A T F O R M

& S T O R A G E

CONTENT REPOSITORY

N U X E O P L A T F O R M

& S T O R A G E

CONTENT REPOSITORY

STORAGE BACKEND

N U X E O P L A T F O R M

& S T O R A G E

CONTENT REPOSITORY

STORAGE BACKEND

N U X E O P L A T F O R M

& S T O R A G E

SIMPLIFY SOFTWARE ARCHITECTURE

OFFER EASY SCALABILITY OPTIONS

SMALL IMPACT ON DEVELOPMENT

S I M P L I F Y A R C H I T E C T U R E

M A K I N G W O R K E A S I E R

F O R O P S & A R C H I T E C T S

S I M P L I F Y A R C H I T E C T U R E

DEPLOYMENT

SCALABILTY

DEVELOPMENT COMPLEXITY

I M P E D A N C E M I S M A T C H

I S S U E

I M P E D A N C E M I S M A T C H

I S S U E

I M P E D A N C E M I S M A T C H

I S S U E

I M P E D A N C E M I S M A T C H

I S S U E

NO LAZY LOADING

NO CACHE

NO INVALIDATION

A LOT OF COMPLEXITY AND PROBLEMS AVOIDED !

I M P A C T O N D E P L O Y M E N T

I M P A C T O N D E P L O Y M E N T

H Y B R I D S T O R A G E

Large stream - Large storageattached blobs

Flexible Schema - Write Once/Read ManyAudit Log, activity log

Complex structures - R/W synchronousDocument properties and hierarchy

Flexible Schema - SearchSearch index

H Y B R I D S T O R A G E

Large stream - Large storageattached blobs

Flexible Schema - Write Once/Read ManyAudit Log, activity log

Complex structures - R/W synchronousDocument properties and hierarchy

Flexible Schema - SearchSearch index

C O N S O L I D A T E D S T O R A G E

Structures

AuditBlobs

Indexes

SINGLE CONSOLIDATED STORAGE Structure, Blobs, Audit & Index

FEWER BUILDING BLOCKS TO PROVISION & CONFIGURE Easier to deploy

E A S Y D E P L O Y M E N T

"BUILT-IN" - DATA REDUNDANCY & FAULT TOLERANCE

Active

Active

No ORM Hell

S I M P L I C I T Y ?

Single consolidated storage

Out of the box robust deployment

S C A L A B I T Y

A V O I D H E A D A C H E A T D E P L O Y M E N T

T I M E I M P R O V E E N D

U S E R X P

S C A L A B I LT Y WILL I BE FASTER WITH MONGODB ?

B U I LT F O R S P E E D

N O I M P E D A N C E I S S U E

D O C U M E N T L E V E L L O C K I N G

• No table level concurrency

• Fewer backend calls

• No invalidation costs

N A T I V E D I S T R I B U T E D A R C H I T E C T U R E

• Easy scale out of reads

S P E E D

https://benchmarks.nuxeo.com/continuous/index.html

Significant RAW Speed improvements for all use cases

More importantly: some use cases are much better handled

M O R E T H A N R A W

P E R F O R M A N C E

No cacheLess Memory per connection

Can handle more connectionCan handle more concurrent users

Handle more concurrent connections

M O R E T H A N R A W

P E R F O R M A N C E

Writes are not blocked by Reads

With SQL, Read and Write operation are competing

M O R E T H A N R A W

P E R F O R M A N C E

Writes are not blocked by Reads

With MongoDB writes operations are not blocked

M O R E T H A N R A W

P E R F O R M A N C E

No side effect of impedance mismatch Processing on large Objects sets is challenging with ORM

lazy loadingcache trashing

Sample batch on 100,000 documents 750 documents/s with SQL backend (cold cache)

11,500 documents/s with MongoDB / wiredTiger: x15

Will I scale better with MongoDB ?

S C A L A B I L I T Y

S C A L E O U T R E A D S

S C A L E O U T W R I T E S

• Leverage sharding

• Spread Writes

• Leverages replicasets

• Read from secondaries

No Impact at application level !

S C A L A B I L I T Y

S C A L E O U T T E S T

Use massive read operations and queries.

2 Nuxeo nodes + 1 MongoDB node 1850 docs/s

MongoDB CPU is the bottleneck (800%)

S C A L A B I L I T Y

S C A L E O U T T E S T

Use massive read operations and queries.

2 Nuxeo nodes + 2 MongoDB nodes 3400 docs/s

(using read preferences)

S C A L A B I L I T Y

S H A R D I N G T E S T

2 Nuxeo nodes +

1 MongoDB ReplicaSet

11,000 docs/s

S C A L A B I L I T Y

S H A R D I N G T E S T

2 Nuxeo nodes +

3 MongoDB Sharded ReplicaSet 27,400 docs/s

D E V E L O P M E N T I M P A C T

MEANS

• Different transaction paradigms

• Provide shared mitigation policies for critical use case

NEW STORAGE MODEL

• Document Level transaction

• No MVCC isolation

C H A N G E S F R O M A D E V

P O I N T O F V I E W

D E V E L O P M E N T I M P A C T

C O N S I S T E N C Y

I N O U R C O N T E X T

Transactions can not span across multiple documents

• Atomic Document Operations are safe • Large batch updates can not be Atomic

Multi-documents transactions can be problematic Workflows or custom event handlers

FIND A WAY TO MITIGATE APPLICATION LEVEL IMPACT

C O N S I S T E N C Y

C O N S I S T E N C Y

TRANSIENT STATE MANAGER Run all operations in Memory

Populate an Undo Log

Recover Application level Transaction Management• Commit / Rollback model

"Read uncommited" isolation• Need to flush transient state for queries• "uncommited" changes are visible to others

C H A N G E I N E R T I A

New Model New API New Query system

PROVIDE AN EASY MIGRATION PATH

C H A N G E I N E R T I A

NUXEO APPROACH

High level API + EncapsulationStorage Adapters

C H A N G E I N E R T I A

DOCUMENT REPOSITORY

Helps transitioning between storages

C H A N G E I N E R T I A

DOCUMENT REPOSITORY

C H A N G E I N E R T I A

DOCUMENT REPOSITORY

C H A N G E I N E R T I A

DOCUMENT REPOSITORY

C H A N G E I N E R T I A

DOCUMENT REPOSITORY

C H A N G E I N E R T I A

DOCUMENT REPOSITORY

T A K E A W A Y S Changing For

MongoDBSimplify

Architecture

Offer simple scalability options

Be an easy migration

Content Management + MongoDBYou should try Nuxeo !

A N Y Q U E S T I O N S ?T H A N K Y O U !

https://github.com/nuxeo nuxeo.com/careers/ @damienmetzler