<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Redis &#8211; blog.boro2g .co.uk</title>
	<atom:link href="https://blog.boro2g.co.uk/category/redis/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.boro2g.co.uk</link>
	<description>Some ideas about coding, dev and all things online.</description>
	<lastBuildDate>Wed, 09 Mar 2016 22:48:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.8</generator>
	<item>
		<title>Sitecore Redis SessionState provider</title>
		<link>https://blog.boro2g.co.uk/sitecore-redis-sessionstate-provider/</link>
					<comments>https://blog.boro2g.co.uk/sitecore-redis-sessionstate-provider/#comments</comments>
		
		<dc:creator><![CDATA[boro]]></dc:creator>
		<pubDate>Wed, 09 Mar 2016 16:42:06 +0000</pubDate>
				<category><![CDATA[Redis]]></category>
		<category><![CDATA[Sitecore]]></category>
		<guid isPermaLink="false">http://blog.boro2g.co.uk/?p=750</guid>

					<description><![CDATA[<p>Out the box Sitecore offers 3 options for how to handle session when you setup xDB. One option is to keep things in process (inProc). This is ok for testing in dev but isn&#8217;t suitable when you have &#62; 1 front end content delivery nodes as each box wouldn&#8217;t be able to share the same information. The [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/sitecore-redis-sessionstate-provider/">Sitecore Redis SessionState provider</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Out the box Sitecore offers 3 options for how to handle session when you setup xDB. One option is to keep things in process (inProc). This is ok for testing in dev but isn&#8217;t suitable when you have &gt; 1 front end content delivery nodes as each box wouldn&#8217;t be able to share the same information. The other two options are: Sql Server or Mongo. See the <a href="https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/session_state/session_state" target="_blank">docs site for more information</a> on how to configure these 2 approaches.</p>
<p>I&#8217;ve uploaded an early version of a Sitecore Redis SessionProvider to github: <a href="https://github.com/boro2g/Sitecore-Redis-Session-Provider" target="_blank">https://github.com/boro2g/Sitecore-Redis-Session-Provider</a></p>
<p>Conceptually the implementation of Session_End is easy to get your head around &#8211; when keys expire you raise up the corresponding events and Sitecore handles the rest. Redis makes this tricky as when keys timeout they don&#8217;t raise events and also the data is then gone, so how could it get flushed to xDB?</p>
<p>To work around this I&#8217;ve combined the logic in the SitecoreSessionStateStoreProvider which gives you the ability to poll the repository, along with some custom keys to manage the concept of expiration.</p>
<p>By default the asp.net redis implementation creates 3 types of keys:</p>
<ul>
<li>DataKey e.g. <em>&#8220;{&#8221; + applicationName + &#8220;_&#8221; + id + &#8220;}_Data&#8221;</em></li>
<li>LockKey<em> e.g. &#8220;{&#8221; + applicationName + &#8220;_&#8221; + id + &#8220;}_Write_Lock&#8221;;</em></li>
<li>InternalKey e.g. <em>&#8220;{&#8221; + applicationName + &#8220;_&#8221; + id + &#8220;}_Internal&#8221;;</em></li>
</ul>
<p>The new entries will also be:</p>
<ul>
<li>_log: this is a sorted set that keeps a record of all the marker sets</li>
<li>TimeoutKey e.g. <em>&#8220;{&#8221; + applicationName + &#8220;_&#8221; + id + &#8220;}_Timeout&#8221;</em></li>
<li>MarkerKey e.g. <em>yyyy MM dd HH:mm:ss_Marker</em>
<ul>
<li>Note, this will contain sets of items (i.e. everything that expires at that time)</li>
</ul>
</li>
</ul>
<p>These new keys are used to store when items are added and updated. They are also then referenced in the callback to validate whether specific entries should expire.</p>
<p>In the solution there are the implementation details for the provider along with a console app for monitoring a solution.</p>
<p><a href="http://blog.boro2g.co.uk/wp-content/uploads/2016/03/console-app.png" rel="attachment wp-att-751"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-751" src="http://blog.boro2g.co.uk/wp-content/uploads/2016/03/console-app.png" alt="console app" width="624" height="125" srcset="https://blog.boro2g.co.uk/wp-content/uploads/2016/03/console-app.png 624w, https://blog.boro2g.co.uk/wp-content/uploads/2016/03/console-app-300x60.png 300w" sizes="(max-width: 624px) 100vw, 624px" /></a></p>
<p>Do let us know how you get on! It&#8217;s worth noting this is currently an alpha release that&#8217;s undergone basic testing &#8211; any feedback / pull-requests would be greatly appreciated.</p>
<p>FYI If you want to get Redis running locally you can install via chocolatey: <a href="https://chocolatey.org/packages/redis-64" target="_blank">https://chocolatey.org/packages/redis-64</a></p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/sitecore-redis-sessionstate-provider/">Sitecore Redis SessionState provider</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.boro2g.co.uk/sitecore-redis-sessionstate-provider/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
