13
Running AEM 6 with Mongo DB Yash Mody, PhD CTO | Tekno Point Consulting

Introducing Mongo DB and setting up Adobe AEM6 with mongo

Embed Size (px)

DESCRIPTION

Presented at Adobe, Bangalore - Introducing NOSQL DB, Mongo DB and setting up Mongo with Adobe AEM 6

Citation preview

Page 1: Introducing Mongo DB and setting up Adobe AEM6 with mongo

Running AEM 6 with Mongo DB

Yash Mody, PhD CTO | Tekno Point Consulting

Page 2: Introducing Mongo DB and setting up Adobe AEM6 with mongo

Introduction

The NoSQL-ness of Databases Non Relational, non row-wise database Its been around for ages (embedded devices, mainframes) Cannot solve scalability issues Flexibility like: Nested Values, Non Standardized Fields

www.teknopoint.us  

Page 3: Introducing Mongo DB and setting up Adobe AEM6 with mongo

Types of No SQl database

Document Store XML, JSON.. Collections or Documents

Key Value Store Big Table / Tabular (Google Prop Implementation) Graph DB

Data represented by series of interconnected nodes (road intersections)

Object DB OOPL

www.teknopoint.us  

Page 4: Introducing Mongo DB and setting up Adobe AEM6 with mongo

CAP THeorem

Consistency – All users see the same data Availability – All users can read and write at all times Partition Tolerance – works when divided across network

www.teknopoint.us  

Page 5: Introducing Mongo DB and setting up Adobe AEM6 with mongo

Mongo DB Fundamentals

Document Database Uses JavaScript :-* Not queried over HTTP Native drivers for each language (no n/w overhead) Only master-slave replication Consistent, Partition Tolerant Sharding using defined keys www.teknopoint.us  

Page 6: Introducing Mongo DB and setting up Adobe AEM6 with mongo

Organization and querying

Documents

Collections

Records JavaScript based Querying and allows define map-reduce functions

www.teknopoint.us  

Page 7: Introducing Mongo DB and setting up Adobe AEM6 with mongo

Setting up mongo

Install Mongo Setup data location

/Users/yash/Desktop/TRAININGS/MONGODB/test/data/db default is /data/db

Start Mongo mongod --dbpath <path to data directory>

Start Mongo Shell in data-dir- $mongo

www.teknopoint.us  

Page 8: Introducing Mongo DB and setting up Adobe AEM6 with mongo

FIRST MONGO Database Creating a DB

show dbs use testdbs

Creating Records r1 = { name : ”Adobe" } r2 = { strength : 3000 }

Adding Records to collections db.orgData.insert( r1 ) db.orgData.insert( r2) db.orgData.insert( {name: “Apple”, strength: 5000})

www.teknopoint.us  

Page 9: Introducing Mongo DB and setting up Adobe AEM6 with mongo

Retrieving info

db. orgData.find() Pass key-value for exact match: db. orgData.find({strength:3000}) Using a cursor : var c = db. orgData.find() Use the cursor as an array

Note: Data can be generated using standard js mechanisms

for (var i = 1; i <= 25; i++) db. orgData.insert( { e-code : i } )

www.teknopoint.us  

Page 10: Introducing Mongo DB and setting up Adobe AEM6 with mongo

Querying data

$lt,  $gt,  $in  www.teknopoint.us  

Page 11: Introducing Mongo DB and setting up Adobe AEM6 with mongo

Mongo DB tools

MongoDB Management Service (MMS) Fang Umongo MongoHub MongoVision Mviewer Meclipse

www.teknopoint.us  

Page 12: Introducing Mongo DB and setting up Adobe AEM6 with mongo

Mongo in AEM

Runs with Mongo 2.6.x Install and set mongod.cfg

ensure dbpath exists

Unpack AEM 6 and change the start.bat runmode “author,crx3mongo” jvm opts “-Doak.mongo.uri=mongodb://localhost:27017”

Run AEM using start.bat

www.teknopoint.us  

Page 13: Introducing Mongo DB and setting up Adobe AEM6 with mongo

Thanks

@yash_mody http://www.linkedin.com/in/modyyash

www.teknopoint.us