<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sorted Sets on AI VOID</title><link>https://ai-blog.noorshomelab.dev/tags/sorted-sets/</link><description>Recent content in Sorted Sets on AI VOID</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 30 Dec 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://ai-blog.noorshomelab.dev/tags/sorted-sets/index.xml" rel="self" type="application/rss+xml"/><item><title>Redis Core Concepts: Sets and Sorted Sets</title><link>https://ai-blog.noorshomelab.dev/redis-guide/redis-sets-and-sorted-sets/</link><pubDate>Fri, 07 Nov 2025 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/redis-guide/redis-sets-and-sorted-sets/</guid><description>&lt;p&gt;Redis offers two powerful data structures for managing collections of unique items: &lt;strong&gt;Sets&lt;/strong&gt; and &lt;strong&gt;Sorted Sets&lt;/strong&gt;. While both store unique members, Sorted Sets add an extra dimension by associating a numerical score with each member, allowing for ordering and range queries. These are indispensable for features like user tagging, unique visitor tracking, leaderboards, and priority queues.&lt;/p&gt;
&lt;p&gt;In this chapter, we&amp;rsquo;ll explore:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The fundamental differences and uses of Sets.&lt;/li&gt;
&lt;li&gt;Commands for adding, removing, and querying members in Sets.&lt;/li&gt;
&lt;li&gt;Set operations like union, intersection, and difference.&lt;/li&gt;
&lt;li&gt;The structure and advantages of Sorted Sets.&lt;/li&gt;
&lt;li&gt;Commands for adding, updating, and querying members in Sorted Sets based on score or rank.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="redis-sets"&gt;Redis Sets&lt;/h3&gt;
&lt;p&gt;A Redis &lt;strong&gt;Set&lt;/strong&gt; is an unordered collection of unique strings. Think of it like a mathematical set. You can add elements, remove elements, and check for the existence of an element, but the order of elements is not guaranteed.&lt;/p&gt;</description></item><item><title>Redis Velocity - Data Store Essentials</title><link>https://ai-blog.noorshomelab.dev/cut-the-chase/redis-velocity/</link><pubDate>Tue, 30 Dec 2025 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/cut-the-chase/redis-velocity/</guid><description>&lt;h1 id="redis-velocity---data-store-essentials"&gt;Redis Velocity - Data Store Essentials&lt;/h1&gt;
&lt;p&gt;Redis is an open-source, in-memory data structure store, used as a database, cache, and message broker. Current stable release is Redis 7.2.x, with 7.4.x in release candidate as of late 2025.&lt;/p&gt;
&lt;h2 id="core-syntax"&gt;Core Syntax&lt;/h2&gt;
&lt;p&gt;Basic key-value operations for strings, the simplest data type.&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre class="language-redis-cli line-numbers" data-start="1" tabindex="0"&gt;&lt;code class="language-redis-cli" data-lang="redis-cli"&gt;SET user:1:name &amp;#34;Alice&amp;#34; EX 3600 NX // Set key &amp;#39;user:1:name&amp;#39; to &amp;#34;Alice&amp;#34;, expire in 3600 seconds, only if key does NOT exist.
GET user:1:name // Retrieve the value associated with &amp;#39;user:1:name&amp;#39;.
DEL user:1:name // Delete the key &amp;#39;user:1:name&amp;#39;.
INCR page:views // Increment the integer value of &amp;#39;page:views&amp;#39; by one. Creates key with 0 if non-existent.
DECRBY product:stock 5 // Decrement the integer value of &amp;#39;product:stock&amp;#39; by five.&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h2 id="essential-patterns"&gt;Essential Patterns&lt;/h2&gt;
&lt;p&gt;Redis offers diverse data structures. Leverage them for efficient data modeling beyond simple strings.&lt;/p&gt;</description></item></channel></rss>