melbourne user group oak and mongodb

24
{ } +

Upload: yuval-ararat

Post on 10-Jul-2015

162 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Melbourne User Group OAK and MongoDB

{ }+

Page 2: Melbourne User Group OAK and MongoDB

Agenda

• Intro to AEM

• OAK

• MongoMK

Page 3: Melbourne User Group OAK and MongoDB

3

What is AEM?

A set of content management services built on a content-centric Web application framework on top of a Java Content Repository

Page 4: Melbourne User Group OAK and MongoDB

4

What’s inside?

• Content Management Services - Author interfaces, workflow engine, etc.

• Web Application Framework - Sling/OSGi

• Content Services - JCR

Page 5: Melbourne User Group OAK and MongoDB

5

Key Principles

• RESTful!!

• OSGi driven– Web service registry– Track dependencies– Avoid collisions

• Sling application framework– Content-driven– Scripting inside

Page 6: Melbourne User Group OAK and MongoDB

6

Technology Stack

OSGi

AEM Content Services

Sling

JCR

Page 7: Melbourne User Group OAK and MongoDB

7

Stack (continued)

• Sling– Application Controller driven by URL and supporting RESTful

communication

• JCR– Java Content Repository– OAK 1.0.8 implementation

• OSGi– Universal middleware, dynamic module system.– Service centric, component-based environment.– Standardized software life-cycle management

Page 8: Melbourne User Group OAK and MongoDB

8

AEM Content Services

• CMS application:• creation, revision, publication, translation, archival and deletion• task management, portal management, collaboration• cooperative and automated business processes to move the

content through its lifecycle• intelligent versioning of content as it moves through its lifecycle

• Tech:• Ajax / JavaScript user interface, APIs, and libraries• Direct client-side JavaScript access to JCR content• Workflow engine – controls the processing of workflow instances – Workflow instances often control the process of generating and publishing

content

Page 9: Melbourne User Group OAK and MongoDB

9

Sling

• Maps content objects to components

• Server-side and AJAX scripting support

• Can be used with a range of scripting languages• JSP

• ESP

• Ruby

• Scala

Page 10: Melbourne User Group OAK and MongoDB

Sling architecture

Page 11: Melbourne User Group OAK and MongoDB

URL Decomposition

• Path – resource/servlet

• Selector – servlet/function

• Extension – Content format

• Suffix path – additional info for processing

• Params – additional info for processing

protocol host path selector extension

http:// myhost/ .print.a4 .html /tools/spy

suffix

a/b ?

param(s)

x=12

Page 12: Melbourne User Group OAK and MongoDB

Architecture

12Matija Grguric

https://www.flickr.com/photos/matijagrguric/4494622971/in/pool-lego

Page 13: Melbourne User Group OAK and MongoDB

CQ5 Deployment – Topology

13

AEMCRX

CDN*

Load Balancer

Dispatcher

Dispatcher

Forward & Reverse

Replication of Content

and Application Packages

Visitor Traffic

AEMCRX

Cache Invalidation

AEMCRX

Content DeliveryNetwork

*DeliveryPublish

Cache Invalidation

Author

Cluster

Page 14: Melbourne User Group OAK and MongoDB

14

AEM Replication

Authors, Developers

create Templates & Pages

Visitors request

Pages

Activate/Publish

Author Publish

Page 15: Melbourne User Group OAK and MongoDB

OAKa.k.a JCR 3

15

Page 16: Melbourne User Group OAK and MongoDB

Design Goals

• Scalability

– Support big distributed repositories

– Improved write throughput

– Parallel Writes

• Support for more child nodes

• Support for more ACLs

• Built in clustering. Instead of built on top

• OSGi friendly

Page 17: Melbourne User Group OAK and MongoDB

OAK Architecture

Page 18: Melbourne User Group OAK and MongoDB

MK

• TarMK

– Similar to TarPM without clustering and better performing.

– Persists to Tar files

• MongoMK

– New, MVCC based persistence

– Persists to MongoDB.

Page 19: Melbourne User Group OAK and MongoDB

MongoMK

• Exposes Micro kernel API

• Implements a DocumentStore– DocumentMK and DocumentNodeStore

• MVCC Approach

• GIT/SVN-inspired DAG-based versioning model [0]

• [0] http://wiki.apache.org/jackrabbit/RepositoryMicroKernel?action=AttachFile&do=view&target=MicroKernel+Revision+Model.pdf

Page 20: Melbourne User Group OAK and MongoDB

MongoMK Data Structure

• simple JSON data model

• properties are name/value pairs

• supported property types:

– String

– Number

– Boolean

– Array

– BSON

Page 21: Melbourne User Group OAK and MongoDB

MongoDB Nodes

{"_id": "10:/content/dam/geometrixx-media/articles/jp/2012/November/sparrow-post.txt/jcr:content/related","_lastRev": {

"r0-0-1": "r1497e6ac359-0-1"},"_commitRoot": {

"r1497e6ac359-0-1": "0"},"_deleted": {

"r1497e6ac359-0-1": "false"},"_modified": NumberLong(1415165165),"jcr:primaryType": {

"r1497e6ac359-0-1": "\"nam:nt:unstructured\""},":childOrder": {

"r1497e6ac359-0-1": "\"[0]:Name\""},"_modCount": NumberLong(1)

}

Page 22: Melbourne User Group OAK and MongoDB

MVCC

• In JCR 2 sessions always reflects the latest state of the

repository.

• In Oak a session reflects a view of the repository from the time the session was acquire

Counter = 1

Session 1

Session 2

Counter = 0

Counter = 0

getCounter()?

returns 0

Counter+1 = 1

Time

Counter = 1

Counter+1 = 1

JCR

Counter = 0

Page 23: Melbourne User Group OAK and MongoDB

Recommended deployment

23

Page 24: Melbourne User Group OAK and MongoDB

http://docs.adobe.com/docs/en/aem/6-0/deploy/recommended-deploys.html