Monday 6 May 2019

SUGCON 2019 Takeaways - Day 2


Using xDB at Scale by Mike Edwards


Mike gave a useful solution for applying profile cards or AB testing across a large number of pages, a lot of times we need to apply a profile cards to many pages or sections, this will need a lot of work from content editors, of course if we exclude the standard values item, the reason we exclude that is for the risk of overriding this item with deployments.


If you want to set a profile card to a single item you will need to go through the following 5 steps:
  1. Click on the head icon.
  2. Select the profile cards
  3. Click ok
  4. Save the page.
  5. Repeat on the next item.

The problem with the above is, it doesn’t scale well, content editors get bored, add to that the long time you will need to complete this in case of sections or if you need to do a little change for the sections you already completed.

Mike suggested and demonstrated a rules base profile card, where you have a centralized configuration folder, add a new item of the template you will need to set profile card on, then set your profile cards to this item as you do it for a regular item. Then use the standard Sitecore rule that will run on each request as following as example:

“Where the item is the “Content” item or of one of its descendants,
and where the current user is a member of the “Sitecore\designer” role”

Once the above is ready, you can add a processor to the ProcessItem pipeline, and run the rules on the profile card item and assign tracking field, following is code snippet from the presentation:




The advantages of the above approach, you will have a centralized location for all your profile cards settings, you can assign profile cards to a whole section, in addition to easily change and delete cards, as well as having the ability to use other attributes when assigning the profile cards.

You will need a merge logic for the rules on the configuration item and the requested page, this can be injecting a processor into the mvc.get XMLBasedLayoutDefintion where it become a simple XML manipulation, when doing the merge logic, a couple of important things you will need to take care of as following:
  1. Don’t merge the overrides (configuration item) when experience editor.
  2. Reverse the order of the overrides, so that the overrides at the top are applied last.
  3. Ignore the default rule for the override
  4. Preprocess and cache your overrides

In addition to the above, Mike showed us how the same solution can be used to overcome a lot of work needed when applying AB testing to a lot of pages.

Offline Tracking with the Sitecore Universal Tracker by Kamruz Jaman


In this session Kamruz talked about Sitecore Universal Tracker in addition to a live demo demonstrating the power and the importance of such component, feature or technology., talking about the rapid development of Sitecore Analytics starting from Online Marketing Suite in Sitecore 6.2, Digital marketing Suite in Sitecore 6.4, xDB in Sitecore 7.5 and 8.0 until the latest xConnect in Sitecore 9.0.

Sitecore universal tracker initial release 1.0 was released a long with Sitecore 9.1 in November, 2018, it is an API first. Micro-service-based tracking service to track actions from mobile apps, IoT, AR, VR, and other emerging channels.



It is important to understand that there is a difference between xConnect and Universal Tracker, xConnect only accepts immutable history, it is designed for trusted communication only and for scaling. Adding to that, xConnect store interactions that only happened, while Universal tracker is storing live interactions, as each interaction can have multiple events.
Universal Tracker session closes either by timeout or by choice, then then information will be processed and store into an xConnect interaction. Universal tracker in build on top of Sitecore Hosts, it consists of UT collection, Interaction cache, and UT processing, notice that the processing can be scaled.

The demo of universal tracker was designed using RFID cards delivered to each attendee, there were two scanner that scan these cards while attendees entering specific areas, each card has an ID and types fields only (due to GDPR Kamruz was not able to collect further information), depending on the time they were able to identify the session information if needed, when the scanner scan the card it create an interaction, push event then close interaction, the interaction is end to an Azure IoT hub which in turns pass the information into UT and then through xConnect to xDB.
Following screenshot shows you how you can start interaction, add event and close or complete interaction:





A couple of extra and useful information Kamruz shared are, you will need to enable anonymous indexing, remove the WebVisitFilter and InteractionFilter, no Live tracking, no manual processing kick-off, in addition you can’t search for interactions.

Measure if you want to go faster by Jeremy Davis


This is one of the most interesting sessions that I attended this year, Jeremy talked about a very interesting topic that we usually face during our daily work, which is performance,  he talked about the tools you can use to examine your code, in addition to the pattern or signs that tell you that something maybe wrong, add to that a practices or ideas that need to be used on any project you work on.

Sitecore debugging mode

Sitecore debug mode is a very useful tool that you can use on each page, just open experience editor then switch to debug mode from the ribbon, It gives information about the total and own time for each component, items read, data cache misses, data cache hits in addition to physical reads.
The number of items being read is a very important indicator that gives you indication if this is a normal number of items you are expecting or not, if the number you are seeing for one of the components is too high then most likely you will need to review the logic of pulling items for this one.



Visual Studio’s profiler

Another very important tool that will help you a lot to detect performance issue in your application, from within Visual Studio open the profiler and attached it to the w3wp.exe of your application, a report of CPU usage will be displayed as you can see from the following screenshot:



From the above window you can switch to the modules view from the “Current View” dropdown, which is a list of the loaded dlls, if you sort by inclusive samples you will see the most performance affecting modules at the top, then worth review, so what you can do is right click on any, and click on show function details to go to the details and review.

Visual Studio Debugger

Another useful tool that you should use is the debugger, the memory measure provided by this tool is a great way to know where is your application using memory the most, see the following screenshots for more information:



Patterns

In addition to the tools described above, Jeremy also talked about the patterns that indicate you have or will have a performance issues, these patterns are:
1.       A component loads a large number of items
2.       A component uses a large piece of the execution time.
3.       A UI component without output cache.

Also, there are three memory patterns for memory you can see that maybe an indication of a performance issue:
1.       When you have a high solid bar, this means the memory is max out, this is an indication that your code will not scale well.
2.       The castle wall graph, that means that the CPU is doing some work then waiting for something to happen, most likely this will be due an IO operation.
3.       The rising memory graph, if the memory usage is increasing overtime then you will definitely need to review your code.

Recommendations

A couple of recommendations Jeremey provided while development process:
1.       Measure regularly and measure early.
2.       Try not to pre-optimize your plans, measure before you optimize.
3.       Your test content is important, write a script to add content if needed.

As a conclusion, you will need to use the tools and listen to them, the data from the tools help you to priorities what to do in addition to measure again your enhancements.     

What’s new in JSS by Adam Weber & Kam Figy


Sitecore JSS team gave us a presentation about Sitecore JSS progressing since released with Sitecore 9.1, everyone should know now that Sitecore JSS allowed building modern JavaScript apps with Sitecore Content; it know has 2800 download/week, in addition to 100+ Github star, also you should know the setting up Sitecore JSS will need 5 minutes with 4 commands.

Sitecore JSS + SXA

The new news shared is now you will be able to manage JSS application with SXA, you will have a new SXA site management for JSS Apps, it will have page and partial designs, and yes JSS integrate with SXA but it retains JSS structure.

This is coming with next Sitecore measure release which is 9.2, a couple of things to notice that SXA component library not supported, no toolbox support, theming/creative exchange is also not supported, SXA layout feature won’t work with disconnected mode, and it will have all the awesome features of JSS. 

Sitecore JSS + Sitecore Forms

Sitecore forms will be integrated into Sitecore JSS, you will have the multistep sitecore forms form, Full client-side support, adding to that the ability to create custom client and server validation.

Sitecore 9.2 the Hidden Bits by Pieter Brinkman


The closing was with a quick overview of what is coming with Sitecore 9.2 (the next major release), why Sitecore is the better and better, because of the following Sitecore areas of focus:
  1. Innovation, by finding solutions to solve the problems of tomorrow,
  2. Time to Market, To speed through the project lifecycle.
  3. Enhancements, to rock solid stability and performance, this is also based on the feedback.


Sitecore JSS

·         JSS + SXA support
·         JSS + Sitecore forms integration
·         No requirement for windows for local development

Sitecore Hosts

·         Upgraded to latest Sitecore .net core version
·         Architecture changes to support future direction

Identify improvements

·         Single Sign Out
·         Token validation
·         Persistent storage

Sitecore Publishing service

·         Sitecore publishing service is now on top of Sitecore Hosts.

Horizon Phase 2

This is new experience editor, functions, improvements and features build based on community feedback, The R&D continue and feedback loops, this is not coming with the next release.

No comments:

Post a Comment