melbourne user group oak and mongodb
TRANSCRIPT
{ }+
Agenda
• Intro to AEM
• OAK
• MongoMK
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
4
What’s inside?
• Content Management Services - Author interfaces, workflow engine, etc.
• Web Application Framework - Sling/OSGi
• Content Services - JCR
5
Key Principles
• RESTful!!
• OSGi driven– Web service registry– Track dependencies– Avoid collisions
• Sling application framework– Content-driven– Scripting inside
6
Technology Stack
OSGi
AEM Content Services
Sling
JCR
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
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
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
Sling architecture
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
Architecture
12Matija Grguric
https://www.flickr.com/photos/matijagrguric/4494622971/in/pool-lego
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
14
AEM Replication
Authors, Developers
create Templates & Pages
Visitors request
Pages
Activate/Publish
Author Publish
OAKa.k.a JCR 3
15
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
OAK Architecture
MK
• TarMK
– Similar to TarPM without clustering and better performing.
– Persists to Tar files
• MongoMK
– New, MVCC based persistence
– Persists to 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
MongoMK Data Structure
• simple JSON data model
• properties are name/value pairs
• supported property types:
– String
– Number
– Boolean
– Array
– BSON
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)
}
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
Recommended deployment
23
http://docs.adobe.com/docs/en/aem/6-0/deploy/recommended-deploys.html