Expand my Community achievements bar.

SOLVED

AEM 6.1 client context vs context hub

Avatar

Level 5

Are there any difference between client context and  context hub ?

why do we need 2 java script framework for  personalization in AEM ?

in which scenario they should be used assuming client context is there for a long time ?

https://docs.adobe.com/docs/en/aem/6-1/develop/personalization/client-context.html

vs

https://docs.adobe.com/docs/en/aem/6-1/develop/personalization/contexthub.html

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi

Context hub is a replacement for client context it is better and more lightweight or ClientContext is basically the old version, ContextHub its replacement..

Client context had performance problems, it forces integration to wait on stores.init.js, ajax call, which slows stuff down a lot (esp site catalyst page-view calls). Context hub is a lot faster and fixes that.
Engineering team is avoiding changes to client context. Future is context hub.

In 6.1, the feature set of ClientContext was still higher than ContextHub, which itself relied on some ClientContext core functionalities to work.

With 6.2, we should have closed the gap, and we're currently working with Product Management to get the ClientContext deprecated in favor of the ContextHub.

I guess it would be a good idea to highlight some of the major architectural changes to clarify why ContextHub soon replaces ClientContextt:

  • ContextHub decouples the Kernel from the UI leading to a much lower footprint on publish 
  • ContextHub Stores can deal with complex hierarchical objects while ClientContext was limited to key-value pairs
  • The eventing model of ContextHub is a lot more sophisticated including the fact that eventing happens as soon as stores are available and not just after „all“ stores have been loaded
  • Loading behavior can be controlled on a fine grained level (sequence of loading & synchronous as well as asynchronous store loading)

All in all ContextHub is capable of every aspect ClientContext could deal with and is optimized in the most significant areas of clientcontext that turned out not to work perfect due to the architecture. 

IOW: go for ContextHub and create issues in case you find bugs or limitations that we are not aware of yet.

 

 

I hope this answers to you question.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

View solution in original post

7 Replies

Avatar

Level 9

Hi,

I had the same concern and unfortunately there isn't much information out there to explain it. 

Here is the post where @Kunal pointed out some information about it. http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

Jitendra

Avatar

Correct answer by
Administrator

Hi

Context hub is a replacement for client context it is better and more lightweight or ClientContext is basically the old version, ContextHub its replacement..

Client context had performance problems, it forces integration to wait on stores.init.js, ajax call, which slows stuff down a lot (esp site catalyst page-view calls). Context hub is a lot faster and fixes that.
Engineering team is avoiding changes to client context. Future is context hub.

In 6.1, the feature set of ClientContext was still higher than ContextHub, which itself relied on some ClientContext core functionalities to work.

With 6.2, we should have closed the gap, and we're currently working with Product Management to get the ClientContext deprecated in favor of the ContextHub.

I guess it would be a good idea to highlight some of the major architectural changes to clarify why ContextHub soon replaces ClientContextt:

  • ContextHub decouples the Kernel from the UI leading to a much lower footprint on publish 
  • ContextHub Stores can deal with complex hierarchical objects while ClientContext was limited to key-value pairs
  • The eventing model of ContextHub is a lot more sophisticated including the fact that eventing happens as soon as stores are available and not just after „all“ stores have been loaded
  • Loading behavior can be controlled on a fine grained level (sequence of loading & synchronous as well as asynchronous store loading)

All in all ContextHub is capable of every aspect ClientContext could deal with and is optimized in the most significant areas of clientcontext that turned out not to work perfect due to the architecture. 

IOW: go for ContextHub and create issues in case you find bugs or limitations that we are not aware of yet.

 

 

I hope this answers to you question.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 10

Thanks Kautuk !! This is explains in detail !

Avatar

Level 3

Hi kautuksahni ,

When I hit http://localhost:4502/content/geometrixx-outdoors/en.html in AEM 6.2, I still see call to stores.init.js but as in AEM 6.2 Context hub takes over Client Context, why call is still coming. Is there still dependency on client context in 6.2 as well.

 

Thanks,

Neha

Avatar

Level 3

Hi kautuksahni ,

When I hit http://localhost:4502/content/geometrixx-outdoors/en.html in AEM 6.2, I still see call to stores.init.js but as in AEM 6.2 Context hub takes over Client Context, why call is still coming. Is there still dependency on client context in 6.2 as well.

 

Thanks,

Neha

Avatar

Administrator

nehacms wrote...

Hi kautuksahni ,

When I hit http://localhost:4502/content/geometrixx-outdoors/en.html in AEM 6.2, I still see call to stores.init.js but as in AEM 6.2 Context hub takes over Client Context, why call is still coming. Is there still dependency on client context in 6.2 as well.

 

Thanks,

Neha

 

I have asked internal team to have a look at this. 

~kautuk



Kautuk Sahni

Avatar

Administrator

nehacms wrote...

Hi kautuksahni ,

When I hit http://localhost:4502/content/geometrixx-outdoors/en.html in AEM 6.2, I still see call to stores.init.js but as in AEM 6.2 Context hub takes over Client Context, why call is still coming. Is there still dependency on client context in 6.2 as well.

 

Thanks,

Neha

 

 It seems there might be a bug in geometrixx outdoors where it still includes the clientcontext. 

I would request you to please create a daycare issue for this.

~kautuk



Kautuk Sahni