aem communities 6.1 - mongosv '15

44
© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Using Mongo with Adobe AEM Communities Kevin Nennig | Corporate Technical Instructor

Upload: kevin-nennig

Post on 20-Mar-2017

267 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Using Mongo with Adobe AEM CommunitiesKevin Nennig | Corporate Technical Instructor

Page 2: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. ADOBE TRAINING

SERVICES2

Adobe Media Optimizer

Adobe Social

Adobe Target

Adobe Audience Manager

Adobe Experience Manager

Adobe Campaign

Adobe Analytics

Adobe Primetime

Adobe Marketing Cloud Solution

Page 3: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. ADOBE TRAINING

SERVICES3

Adobe Media Optimizer

Adobe Social

Adobe Target

Adobe Audience Manager

Adobe Experience Manager

Adobe Campaign

Adobe Analytics

Adobe Primetime

Adobe Marketing Cloud Solution

Page 4: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

AEM Modules

Page 5: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

AEM Modules

Page 6: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Using Mongo in AEM

AEMTarM

K

AEM

MongoMK MSRP

Persistence of entire database

User generated content only

Page 7: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Using Mongo in AEM

AEM

MongoMK

Persistence of entire database

AEMTarM

KMSRP

User generated content only

Page 8: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Why use Mongo for AEM Communities?

• Flexible JSON document model• Efficient searching with indexing• Built in replication for high availability• Scaleable• High concurrent writes• Reduces operational overhead

Page 9: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Lets have a social opinion!

• http://mongosv.kevinnennig.com

• AEM Community with Mongo common store (MSRP)

• “Mongo Opinions” is based upon Yahoo Answers

• Sign up and give your opinion to a few questions!

Page 10: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Communities 6.1

10

Publish farms are preferred

1http://mongosv.kevinnennig.com

Page 11: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

TAR

Content Replication

11

TAR

AEM Publish Farm

AEM Author

Dis

patc

her

TAR

TAR

Page 12: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

TAR

Content Replication

12

TAR

AEM Publish Farm

AEM Author

Dis

patc

her

TAR

TAR

• Recommended approach

• Performance• Scalability on read

access• Failover• What about UGC?

Page 13: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Communities 6.1

13

Publish farms are preferred

1Replicating UGC

isn’t good enough

2http://mongosv.kevinnennig.com

Page 14: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

AEM Replication of UGC (earlier versions of AEM)

1

AEMPublish

AEMPublish

Comment, rating, forum post

2 Stored in repositoryand in Replication Outbox

3 Check and fetch Outbox content

4 Workflow-based moderation and spam check

AEMAuthor

Replication toall publish

Internal Network DMZ

5

5

Page 15: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

AEM Replication of UGC (earlier versions of AEM)• Everything has to go

through author• UGC is not immediately

available everywhere• Slow

1

AEMPublish

AEMPublish

Comment, rating, forum post

2 Stored in repositoryand in Replication Outbox

3 Check and fetch Outbox content

4 Workflow-based moderation and spam check

AEMAuthor

Replication toall publish

Internal Network DMZ

5

5

Page 16: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Communities 6.1

16

Publish farms are preferred

1Replicating UGC

isn’t good enough

2Need to be Fast and consistent

3http://mongosv.kevinnennig.com

Page 17: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 17

The Solution:Common Store for UGC

http://mongosv.kevinnennig.com

Page 18: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Implementing the Common Store

18

• Social Resource Provider (SRP)• An API that abstracts the storage

• Implemented three different ways• MongoMK JCR SRP (JSRP)• Adobe SRP (ASRP)• Mongo SRP (MSRP)

Page 19: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

JSRP: JCR Social Resource Provider

19

19

19AEM Author

• Publish instances are clustered with MongoMK

• Default storage mechanism• Easy to setup UGC• UGC is only available on publish

instances• Publish Farm is not utilized

MongoMK

AEM Publish

3

AEM Publish

2

AEM Publish

1

Page 20: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

ASRP: Adobe Social Resource Provider

20

TAR TAR TAR

AEM Publish Farm

Adobe Social Cloud

AEM Author

• Recommended for managed UGC

• No setup needed• Integrates with Adobe

Social Analytics Pipeline and Moderation

• Fast

Page 21: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

MSRP: Mongo Social Resource Provider

21

TAR TAR TAR

AEM Author

AEM Publish Farm

• Recommended for on prem UGC

• Required to setup a mongo replset and solr cloud

• Fast and scaleable

Page 22: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

What’s stored in the Common Store?

22

• Contextual• Comments• Reviews• Ratings• Votes/Likes

Adobe Social Cloud

MongoMK

• Standalone • Forums• Calendars• File Sharing• Activities

Page 23: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

What isn’t stored in the Common Store?

23

• External user accounts• External groups

• Community websiteAdobe Social Cloud

MongoMK

Page 24: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

What isn’t stored in the Common Store?

24

• External user accounts• External groups

• Community websiteAdobe Social Cloud

MongoMK

Replicated among publish instances but not author

Replicated from the author instance to publish farm

Page 25: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Comparing SRP

25

Adobe Social CloudMongoMK

Social Resource Provider

JSRP ASRP MSRP

Microkernel MongoMK TarMK TarMKSite Content Repository

Publish Server Publish Server Publish Server

UGC Repository Publish Server Adobe Social Cloud

MongoDB

When it should be used?

Default storage. Not recommended for production,

only development.

Customers using the ASC or who do

not want to support the

infrastructure

Requirements of data being on

prem or a company wants to

own the entire stack

Page 26: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Dispatcher

26

UGC is dynamic content.

Can it work with Dispatcher?

http://mongosv.kevinnennig.com

Page 27: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

TAR

Dispatcher

27

TAR

AEM Publish Farm

AEM Author

Dis

patc

her

TAR

TAR

Page 28: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Dispatcher

28

AEM Publish Farm

TAR

TAR

TAR

Dispatcher

GET PathWithComments.html

200 <html/>

GET /bin/service/userinfo.json

200 { “user” : “info” } User info

Page 29: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Performance increase using Mongo SRP

29

“Mixed transactions” test case: Based on customer data

Reverse Replication JSP components (deprecated in 6.0) CRX2 2 node active/passive cluster 5 transactions per second

Page 30: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Performance increase using Mongo SRP

30

“Mixed transactions” test case: Based on customer data

Reverse Replication JSP components (deprecated in 6.0) CRX2 2 node active/passive cluster 5 transactions per second

Mongo SRP SCF components MSRP 4 node farm Dispatcher 100 tps per instance

Page 31: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 31

Setting up MSRP

http://mongosv.kevinnennig.com

Page 32: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

MSRP: Mongo Social Resource Provider

32

AEM Author 27019

2701827017

aem

TAR

AEM Publish Farm

TAR

TAR

Page 33: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

MSRP: Mongo Social Resource Provider

33

AEM Author 27019

2701827017

aem

Database: msrp-communities

Collection: collection1

TAR

AEM Publish Farm

TAR

TAR

Page 34: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Starting a replset Mongo

34

Start Mongo ServersmongoServer1$ mongod --bind_ip nennig-osx.local --logpath logs/mongo.log --dbpath db --replSet aem --port 27017

mongoServer2$ mongod --bind_ip nennig-osx.local --logpath logs/mongo.log --dbpath db --replSet aem --port 27018

mongoServer3$ mongod --bind_ip nennig-osx.local --logpath logs/mongo.log --dbpath db --replSet aem --port 27019

Page 35: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Starting a replset Mongo

35

Create the Replica Set Connect to the mongodb you want to be Primary$ mongo nennig-osx.local:27017>

Page 36: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Starting a replset Mongo

36

Initialize the Replica Set> rs.initiate()

{"info2" : "no configuration explicitly specified -- making one",

"me" : "nennig-osx.local:27017","info" : "Config now saved locally. Should come online in about a minute.",

"ok" : 1}aem:PRIMARY> rs.conf()

{"_id" : "aem",

"members" : [{

"_id" : 0,"host" : "nennig-osx.local:27017"

}

]}

Page 37: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Starting a replset Mongo

37

Initialize the Replica Set> rs.initiate()

{"info2" : "no configuration explicitly specified -- making one",

"me" : "nennig-osx.local:27017","info" : "Config now saved locally. Should come online in about a minute.",

"ok" : 1}aem:PRIMARY> rs.conf()

{"_id" : "aem",

"members" : [{

"_id" : 0,"host" : "nennig-osx.local:27017"

}

]}

You can also use:rs.status()This will show the current status of each server including who’s PRIMARY/SECONDARY

Page 38: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Starting a replset Mongo

38

Add membersaem:PRIMARY> rs.add(“nennig-osx.local:27018”){ "ok" : 1 }aem:PRIMARY> rs.add(“nennig-osx.local:27019”){ "ok" : 1 }

Page 39: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Starting a replset Mongo

39

aem:PRIMARY> rs.conf(){

"_id" : "aem","version" : 3,"members" : [{"_id" : 0,"host" : "nennig-osx.local:27017"},{"_id" : 1,"host" : "nennig-osx.local:27018"},{"_id" : 2,"host" : "nennig-osx.local:27019"}]

}

Page 40: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Start the Solr Server

40

Download config files from the AEM server Start the Solr Server with the conf files on port 8983solrServer$ java –jar start.jar

Page 41: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Configure the Social Resource Provider on AEM

41

Page 42: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 42

Demo

http://mongosv.kevinnennig.com

Page 43: AEM Communities 6.1 - MongoSV '15

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 43

Q&AKevin Nennig

[email protected]

Slideshare: http://www.slideshare.net/KevinNennig/aem-communities-61-mongosv-15 Community Topologies: https://docs.adobe.com/docs/en/aem/6-1/deploy/communities/topologies.html MSRP: https://docs.adobe.com/docs/en/aem/6-1/administer/communities/srp/msrp.html

http://mongosv.kevinnennig.com

Page 44: AEM Communities 6.1 - MongoSV '15