Introducing Mongo DB and setting up Adobe AEM6 with mongo

Preview:

DESCRIPTION

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

Citation preview

Running AEM 6 with Mongo DB

Yash Mody, PhD CTO | Tekno Point Consulting

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  

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  

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  

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  

Organization and querying

Documents

Collections

Records JavaScript based Querying and allows define map-reduce functions

www.teknopoint.us  

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  

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  

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  

Querying data

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

Mongo DB tools

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

www.teknopoint.us  

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  

Thanks

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

www.teknopoint.us