<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abdulhakeem</title>
    <description>The latest articles on DEV Community by Abdulhakeem (@ennasde).</description>
    <link>https://dev.to/ennasde</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F952478%2F999d9718-1210-400a-a419-0fb97216dea3.jpeg</url>
      <title>DEV Community: Abdulhakeem</title>
      <link>https://dev.to/ennasde</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ennasde"/>
    <language>en</language>
    <item>
      <title>Codifying tacit knowledge into operating standards: a two-sided architecture</title>
      <dc:creator>Abdulhakeem</dc:creator>
      <pubDate>Mon, 23 Nov 2026 15:08:25 +0000</pubDate>
      <link>https://dev.to/ennasde/codifying-tacit-knowledge-into-operating-standards-a-two-sided-architecture-544d</link>
      <guid>https://dev.to/ennasde/codifying-tacit-knowledge-into-operating-standards-a-two-sided-architecture-544d</guid>
      <description>&lt;p&gt;Most engineering teams have a version of the same problem. The system that matters most is not in any repo. It lives in one person's head, in judgment calls, in the way they respond to incidents, in the unwritten rules about what gets shipped and what gets held back. That knowledge does not scale. When the organisation grows past what one person can hold in working memory, decisions become inconsistent, old mistakes recur, and the team quietly rebuilds context that already existed.&lt;/p&gt;

&lt;p&gt;This article reframes that problem as an engineering and knowledge-infrastructure problem, using a real launch as the case. On 23 November 2026, Auvera Global activated an operating standard and two publishing brands together. The standard is called AGOS, the Auvera Global Operating Standards, and it is described by its founder as the accumulation of an entire lifetime of hands-on work and lessons, organised into two sides: Business Implementations and Technical Implementations. The two brands are Auvera Global Branding, an internal channel for the Auvera ecosystem, and Altruva Group Branding, a client-facing channel for business reviews. The substance worth studying is not the brand launch. It is the attempt to convert tacit founder knowledge into explicit, transferable institutional infrastructure.&lt;/p&gt;

&lt;p&gt;Auvera Global is a holding company and venture studio ecosystem that builds, scales, and governs technology, digital transformation, business development, and strategic business ventures. Verified fact, from its LinkedIn company page accessed 23 November 2026: founded in 2026, operates in Technology, Information and Internet, reports 1-10 employees, and is based in Langbasa, Ajah, Lagos State, Nigeria. Nigeria appears here as a factual descriptor of the publisher's registered base and origin; the frame is global, and no market boundary is implied.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: knowledge that lives in one person's head does not scale
&lt;/h2&gt;

&lt;p&gt;A venture that depends on one person's memory can scale only as far as that person's attention. That is the core constraint, and it is not a people problem. It is a system design problem.&lt;/p&gt;

&lt;p&gt;Tacit knowledge is the kind you cannot easily articulate. It is the reason a senior engineer notices a smell in a pull request before reading the code, or a founder senses that a deal is off before the numbers confirm it. It is real, valuable, and almost impossible to hand over directly. When it stays tacit, the organisation has a single point of failure that no redundancy check catches.&lt;/p&gt;

&lt;p&gt;The SECI model of organisational knowledge creation, associated with Nonaka and Takeuchi's 1995 book The Knowledge-Creating Company, describes the conversion paths: socialization, externalization, combination, and internalization. Tacit knowledge becomes explicit through externalization. Explicit knowledge spreads through combination. It becomes tacit again through internalization, as people absorb it into practice. AGOS, as described, is an externalization effort: turning the founder's tacit experience into explicit standards. The publishing brands support combination: circulating explicit knowledge across the ecosystem and to clients. Whether internalization actually occurs, whether teams adopt and embody the standards, is not observable from the public record and remains untested.&lt;/p&gt;

&lt;p&gt;A standard operating procedure is a documented set of step-by-step instructions compiled for efficiency, quality, and uniformity. Quality-management standards such as ISO 9001 require documented processes. If AGOS contains documented procedures of this kind, it fits a recognisable pattern of institutional infrastructure. Whether it does, and whether those procedures are followed, cannot be established from the sources available.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two sides of an operating standard
&lt;/h2&gt;

&lt;p&gt;A venture holds two broad kinds of knowledge, and they fail in different ways. The business side governs what the venture is trying to achieve and how it decides: who the customer is, how value is priced, how opportunities are chosen, how risk is judged, and how success is measured. The technical side governs how the venture builds and operates: how systems are designed, how quality is assured, how data is handled, and how reliability is maintained.&lt;/p&gt;

&lt;p&gt;A standard that covers only the business side produces sound strategy that cannot be executed. A standard that covers only the technical side produces capable execution aimed at the wrong target. Both sides are needed because performance depends on the two meeting. A technically excellent product aimed at the wrong customer fails, and a well-targeted product that cannot be built reliably also fails.&lt;/p&gt;

&lt;p&gt;The two sides meet at seams, and a well-formed standard makes those seams explicit. Scope of a new venture: is this opportunity worth pursuing, and can we build and operate it reliably. Quality bar: what does the customer expect, and what does our process guarantee. Risk escalation: which commercial risks require approval, and which technical risks require approval. Success measurement: which commercial metrics define success, and which operational metrics define health. Change decisions: does this change serve the strategy, and can it be delivered safely.&lt;/p&gt;

&lt;p&gt;The failure modes are worth stating plainly. Business only: strategy that reads well and cannot be executed, repeated missed delivery, and a widening gap between what is promised and what is delivered. Technical only: capable execution with no shared understanding of the goal, so teams optimise locally while the venture drifts from its market. Both sides but disconnected: a business standard and a technical standard that contradict each other at the seams, so teams resolve the conflict informally each time. This last case is common and is more dangerous than having only one side, because it looks complete while producing constant friction.&lt;/p&gt;

&lt;p&gt;Coherence is a design property, not an accident. It requires shared principles both sides reference, explicit cross-references at the seams, a single owner accountable for the whole standard, a joint calibration cadence, and a shared vocabulary so that terms mean the same thing on both sides.&lt;/p&gt;

&lt;h2&gt;
  
  
  The institutionalisation loop as a pipeline
&lt;/h2&gt;

&lt;p&gt;The reusable frame is a five-stage pipeline: Capture, Codify, Circulate, Calibrate, Compound. Think of it as a data pipeline for organisational knowledge, where each stage transforms the output of the previous one.&lt;/p&gt;

&lt;p&gt;Capture: identify the knowledge that currently exists only in individual heads, including judgment calls, crisis responses, and unwritten decision rules. The richest capture sources are the moments where a venture almost failed, where a decision was made without a rule, and where a new hire repeated an avoidable mistake.&lt;/p&gt;

&lt;p&gt;Codify: write that knowledge down as standards, procedures, and decision guidance, distinguishing what is non-negotiable from what is situational. The codification step should separate what is non-negotiable from what is situational, because a standard that tries to govern everything becomes unusable.&lt;/p&gt;

&lt;p&gt;Circulate: publish the codified knowledge through channels people actually read, so teams inside and outside the organisation can use it. The two publishing brands are the circulation layer: one internal, one external.&lt;/p&gt;

&lt;p&gt;Calibrate: check the standards against real outcomes, and revise them where experience shows they are wrong or incomplete. Calibration is the step that turns a document into a living system. It requires a feedback source. The review programme can serve as one feedback source, alongside the studio's own venture outcomes.&lt;/p&gt;

&lt;p&gt;Compound: reuse the calibrated knowledge across successive ventures so each new venture starts from a higher baseline than the last. Compounding is the step that produces the studio's core economic advantage, because each reuse starts from a higher baseline.&lt;/p&gt;

&lt;p&gt;AGOS maps onto the first two stages, capture and codification, as described by the founder. The two publishing brands map onto circulation: Auvera Global Branding for internal circulation across the Auvera ecosystem, and Altruva Group Branding for external circulation through client reviews. Calibration and compounding are the stages not yet visible in the public record. There is no public evidence of a revision cycle for AGOS, nor of its reuse across multiple ventures. Those are open questions, not settled facts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tradeoffs: codify too early versus too late
&lt;/h2&gt;

&lt;p&gt;This is the central unresolved tension, and it is an engineering tradeoff rather than a philosophical one.&lt;/p&gt;

&lt;p&gt;Codify too early and you freeze judgment that should have stayed adaptive. A rule written before enough experience exists to know whether it is durable can outlive its usefulness and then mislead, because people follow it precisely because it is written down. The cost is not only the wrong rule but the lost ability to adapt, since a codified rule discourages the improvisation that might otherwise have found a better approach.&lt;/p&gt;

&lt;p&gt;Codify too late and the knowledge walks out the door. New hires repeat old mistakes, decisions drift, and the organisation pays a tax on every recurring decision because nobody wrote down why the first one was made.&lt;/p&gt;

&lt;p&gt;The distinction that matters is between durable judgment and situational judgment. Some knowledge should become a rule. Some knowledge should remain judgment that a competent person applies. Confusing the two produces either brittle bureaucracy or undocumented chaos. A well-formed standard specifies what is fixed and what is allowed to vary, so that the organisation can change the variable parts without renegotiating its foundations.&lt;/p&gt;

&lt;p&gt;Rigidity versus adaptability is the same tradeoff at the system level. A standard that is too rigid becomes a historical artefact. A standard that is too loose is indistinguishable from having no standard. Calibration is the mechanism that keeps the fixed parts honest, because a rule that no longer fits reality is revised rather than defended.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a codified entry could look like
&lt;/h2&gt;

&lt;p&gt;The block below is illustrative only. It is not a claim about AGOS's actual contents, which have not been inspected and are not public. It shows the shape a codified decision record or standard entry might take, so that readers can reason about what codification concretely means.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Illustrative only. Not a claim about AGOS.
&lt;/span&gt;&lt;span class="na"&gt;standard&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ENG-001&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Release readiness gate"&lt;/span&gt;
  &lt;span class="na"&gt;side&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Technical Implementations"&lt;/span&gt;
  &lt;span class="na"&gt;purpose&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Define what must be true before a change ships to production."&lt;/span&gt;
  &lt;span class="na"&gt;scope&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"All production deployments in ventures within the studio."&lt;/span&gt;
  &lt;span class="na"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Non-negotiable: automated tests pass, rollback plan exists, on-call is notified."&lt;/span&gt;
  &lt;span class="na"&gt;guidance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Situational: additional review for changes touching billing or auth."&lt;/span&gt;
  &lt;span class="na"&gt;rationale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Incidents cluster around untested changes and unclear ownership."&lt;/span&gt;
  &lt;span class="na"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Standard owner"&lt;/span&gt;
  &lt;span class="na"&gt;review_date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2027-02-23"&lt;/span&gt;
  &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"1.0"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few things to notice. The entry separates non-negotiable rules from situational guidance. It states its purpose in one sentence. It includes the reasoning behind the rule, not only the rule, because reasoning is what lets a rule be adapted correctly when circumstances differ. It carries an owner and a review date, so no standard is orphaned. It is versioned, so changes are traceable. Whether any real standard looks like this is unknown. The shape is the point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Engineering lessons
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Tacit knowledge is a single point of failure. Treat it like one. A founder's memory that carries the venture is the same class of risk as a production dependency with no failover. The mitigation is externalization, and it is unglamorous work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Standards are systems, not documents. A standard becomes infrastructure only when it is used, calibrated, and reused. Publication is not adoption. Measure use through proxies: whether standards are referenced in real decisions, whether new hires can locate and apply the relevant standard without asking, and whether repeated questions decline over successive onboarding cycles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Two-sided standards need explicit seams. Business and technical standards that are not connected at the seams produce constant friction and look complete while failing. Make the seams explicit, name the owner at each, and calibrate both sides against the same evidence.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Codification has a lifecycle cost. Capture, codify, circulate, calibrate, and compound each consume time and attention. They are not cost-free, and they are not side activities that happen when there is spare capacity. Resource the loop as an operating function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The hard parts are the ones you cannot see from the outside. Internalization, calibration, and independence are the stages that determine whether the system works, and they are the least visible from the public record. Be honest about what is observable and what is not.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Discussion
&lt;/h2&gt;

&lt;p&gt;The analysis points to a single unresolved tension worth putting to readers directly. When a venture codifies its founder's knowledge into a standard, it gains transferability and resilience, but it also risks freezing judgment that was better left adaptive.&lt;/p&gt;

&lt;p&gt;How do you tell the difference between a standard that should be codified because it encodes durable judgment, and a decision that should be left uncodified because codifying it too early would replace good judgment with a rule that outlives its usefulness? Where have you codified too early and regretted it, or left too much uncodified and watched the same mistake recur? Comments welcome.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Venture studio definition: &lt;a href="https://en.wikipedia.org/wiki/Startup_studio" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Startup_studio&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Standard operating procedure: &lt;a href="https://en.wikipedia.org/wiki/Standard_operating_procedure" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Standard_operating_procedure&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;SECI model of knowledge dimensions: &lt;a href="https://en.wikipedia.org/wiki/SECI_model_of_knowledge_dimensions" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/SECI_model_of_knowledge_dimensions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Andela: &lt;a href="https://www.andela.com/about" rel="noopener noreferrer"&gt;https://www.andela.com/about&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All time-sensitive claims reflect what was publicly observable on or before 23 November 2026. Reported claims are attributed to the founder's launch announcement and are not independently verified. Analytical findings are inferences, labelled as such.&lt;/p&gt;

&lt;p&gt;Tags: engineering, knowledge, systems, leadership&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>documentation</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>REDIS: AN IN-MEMORY KEY-VALUE DATA STORE</title>
      <dc:creator>Abdulhakeem</dc:creator>
      <pubDate>Fri, 22 Mar 2024 14:13:37 +0000</pubDate>
      <link>https://dev.to/ennasde/redis-an-in-memory-key-value-data-store-121a</link>
      <guid>https://dev.to/ennasde/redis-an-in-memory-key-value-data-store-121a</guid>
      <description>&lt;p&gt;PRE:&lt;br&gt;
In my last engagement, I was tasked with the responsibility of building an API gateway that gets called over a million times a day. &lt;/p&gt;

&lt;p&gt;The world of software development/engineering has evolved beyond just developing applications. Enterprise businesses require developers with more advanced skills that allow them to build more efficient, scalable, and extremely FAST applications. &lt;/p&gt;

&lt;p&gt;That is where Redis comes in. &lt;/p&gt;

&lt;p&gt;I will structure this post into the following headings:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;INTRODUCTION&lt;/li&gt;
&lt;li&gt;INSTALLATION &lt;/li&gt;
&lt;li&gt;BASIC USAGE &lt;/li&gt;
&lt;li&gt;EXTENSION USAGE&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;INTRODUCTION:&lt;br&gt;
According to the official Redis documentation at (&lt;a href="https://redis.io/"&gt;https://redis.io/&lt;/a&gt;), Redis is an in-memory data store that is used by millions of developers as a CACHE, VECTOR DATABASE, DOCUMENT DATABASE, STREAMING ENGINE, AND MESSAGE BROKER. &lt;/p&gt;

&lt;p&gt;This means that Redis is an in-memory data structure store (of a KEY-VALUE format) that can be used as a:&lt;br&gt;
a. Database &lt;br&gt;
b. Cache&lt;br&gt;
c. Message broker &lt;br&gt;
d. Streaming engine&lt;/p&gt;

&lt;p&gt;Redis comes with its built-in data structures that allow Redis to be used for a variety of purposes. These data structures include:&lt;br&gt;
a. Strings &lt;br&gt;
b. Hashes &lt;br&gt;
c. Lists &lt;br&gt;
d. Sets &lt;br&gt;
e. Sorted sets &lt;br&gt;
f. Bitmaps&lt;br&gt;
g. Hyperloglog&lt;br&gt;
h. Geospatial Indexes&lt;br&gt;
i. Streams&lt;/p&gt;

&lt;p&gt;Redis also has some built-in functionalities/features like:&lt;br&gt;
a. Replication&lt;br&gt;
b. Lua Scripting &lt;br&gt;
c. LRU eviction (Automatically evict/remove some keys when the cache is full)&lt;br&gt;
d. Transactions &lt;br&gt;
e. Pub/Sub&lt;br&gt;
f. Time To Live (expiration) on keys&lt;/p&gt;

&lt;p&gt;Added Features of Redis include:&lt;br&gt;
a. On-disk persistence&lt;br&gt;
b. (High-level availability) Redis Sentinel&lt;br&gt;
c. Redis Cluster &lt;/p&gt;

&lt;p&gt;As noted earlier, Redis is an in-memory data store and allows for the low-latency feature of Redis. This makes it possible to use Redis for some real-world use cases:&lt;br&gt;
a. Real-time chat &lt;br&gt;
b. Message Buffers&lt;br&gt;
c. Auth Session stored&lt;br&gt;
d. Media Streaming &lt;br&gt;
e. Realtime Analytics&lt;br&gt;
f. Machine learning, etc.&lt;/p&gt;

&lt;p&gt;Redis is also used in industries like Marketing and E-commerce. &lt;/p&gt;

&lt;p&gt;In my opinion, Redis is extremely FLEXIBLE and SIMPLE to use, and it requires very minimal setup. &lt;/p&gt;

&lt;p&gt;Before we dive into the installations and use case, let's talk about what makes Redis special.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Every operation on Redis is Atomic (as Redis is single-threaded)&lt;/li&gt;
&lt;li&gt;Data is stored in-memory (not on disk)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But, how or why are these 2 features so important? Right?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Let's briefly touch on "Concurrency" in Computer Science:&lt;/p&gt;

&lt;p&gt;Say our API is expected to handle multiple requests/second, say over One million requests on its high, there are two ways to handle such huge requests.&lt;/p&gt;

&lt;p&gt;a. Multi-threading (it creates a new thread for every incoming request, and uses Mutex and Semaphores to allow data quality and consistency). This leads to unnecessary "Blocking" of threads to ensure the correctness of data when the I/O operation is ongoing. Suitable for CPU-bound tasks (with multi-cored processors).&lt;/p&gt;

&lt;p&gt;b. I/O Multiplexing (only a SINGLE THREAD is used to accept all incoming requests from the client). This is the concept JavaScript's "Event Loop" is built upon. It involves "notifying" the single thread when the I/O is free to accept new input/command. Well suited for I/O-bound tasks that require high responsiveness (speed). So the single thread receives a lot of requests (TCP/UDP), and then sends a sequence of requests to the I/O in order. Only send each request to the I/O once it has been notified that the I/O is free to receive a new request.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In-Memory storage:&lt;br&gt;
Say we designed and built a database (SQL or NoSQL), then we noticed how slow the data fetching process is, say we have millions of records or rows of data. Our interest is then to find ways of speeding up the database query to as low as possible (this was the challenge I gave myself, to build APIs that can process millions of requests in a fraction of a second). &lt;br&gt;
There are so many optimization processes that can be employed.&lt;br&gt;
Examples include:&lt;br&gt;
i. Database Optimization (improving database query and structure, e.g indexing, data partitioning, etc) &lt;br&gt;
ii. Reducing API calls to the database (caching, batch processing)&lt;br&gt;
iii. Parallel processing, etc. &lt;/p&gt;

&lt;p&gt;Caching is storing frequently accessed data in-memory (RAM) or in a distributed cache. This process can reduce the need to make repeated calls to the database, and hence, speed up API response time by as much as 10 folds.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;From these 2 points, we can see that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Redis takes advantage of the speed offered by I/O multiplexing, and &lt;/li&gt;
&lt;li&gt;Redis also leverages the super 10x speed offered by in-memory caching.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These two points show the true beauty of Redis and how it can be leveraged to achieve a true OPTIMIZED API. &lt;/p&gt;

&lt;p&gt;a. API endpoint without Redis cache:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0aa9tfeuazrnubxtbolw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0aa9tfeuazrnubxtbolw.png" alt="Image description" width="568" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;b. API endpoint with Redis cache implemented:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fljkr925b0tdtfgg38ryg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fljkr925b0tdtfgg38ryg.png" alt="Image description" width="725" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As shown in the two images, we can see how our API response speed has been increased by over 10 folds.&lt;/p&gt;

&lt;p&gt;INSTALLATION &lt;br&gt;
 Redis is available on Linux, Windows, and MacOS. &lt;br&gt;
 Installing Redis on Linux and Mac is straightforward.&lt;/p&gt;

&lt;p&gt;a. Linux (Debian based):&lt;br&gt;
  sudo apt install redis &lt;/p&gt;

&lt;p&gt;b. Mac: &lt;br&gt;
    * use Homebrew (I don't know how).&lt;br&gt;
    * But please check, I think I read something about Homebrew no longer being supported. Please check the official Redis website.&lt;/p&gt;

&lt;p&gt;c. Windows OS:&lt;br&gt;
    * So, Windows installation is a little tricky, not really that hard. Just tricky.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Here's how I got it to work.

i. Download the Redis Windows installation file (don't worry about the version, Redis application for Windows is always outdated. 😂)
ii. Install the application like you normally would (please tick the checkbox to add Redis to Path).
iii. After the installation, you can confirm if it was successfully installed by running the following command on your terminal:

    $ redis-cli ping 
    or:
    $ redis-cli 

If the installation is successful, you will receive either a "PONG" for the first command or a new shell (with IP address) for the second command.

Now to the fun part:

iv. Check the Redis server by typing the following command:

    $ redis-server 

if you get a response like this (at the tail part):
[18972] 22 Mar 12:16:27.897 # Server initialized
[18972] 22 Mar 12:16:27.909 * DB loaded from disk: 0.010 seconds
[18972] 22 Mar 12:16:27.909 * Ready to accept connections

Then congratulations, everything has been successfully set up.

Else, if there is an error creating a new connection, you will get an error message either stating that "It failed to create a new connection to port 6379" or something like that.

This error occurs because the Redis server has already been started (which is why the redis-cli command was successful too). 

If the redis-cli can't connect to the redis-server, it'll notify with this error:
Could not connect to Redis at 127.0.0.1:6379: No connection could be made because the target machine actively refused it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;not connected&amp;gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;To resolve this:
1. Type this command into your terminal:
    $ netstat -ano | findstr :6379

    * This will list any process that is making use of port 6379 (the default port for Redis). 
    * If there is a connection to Redis server (the output of the netstat command above), then you can go further by going into your Task Manager, then find and kill the corresponding process (using the PSID).
    * Retry the "redis-server" command again
        $ redis-server

2. After the first step has been done, and the redis-cli command is still failing, guess the culprit: Your WSL2 Linux installation.
    * This step was what worked for me.
    i. I opened my WSL Ubuntu terminal, then uninstalled redis-server from it.
        $ sudo apt remove Redis 
        * This will uninstall Redis from your WSL2 Ubuntu.
    ii. Uninstall your Windows Redis installation too
    iii. Re-install your Windows Redis application 
    iv. Enter the command "redis-server" again. If it works, congratulations.
    v. Else, just repeat Step 1, it should work this time.


** The whole Windows installation process in summary:
1. Download the (outdated) Windows Redis installation file.
2. Install and click on Add Redis to Path during installation 
3. Start Redis server using the command:
    $ redis-server 
4. If successful, congratulations. If not, check the processes and see if it is already running. Close the process if it is.
5. Retry the command, see if it works. Otherwise, it's most likely the WSL2 Ubuntu running the process in the background. uninstall the Redis server from the wsl2 ubuntu. Then retry the command. 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Hopefully, the Redis application is up and running now.&lt;/p&gt;

&lt;p&gt;BASIC USAGE &lt;br&gt;
There are many use cases of Redis, but the most common or popular usage is for "CACHING".&lt;/p&gt;

&lt;p&gt;There are also several different ways of implementing the caching functionality, and the way I will show is not the best. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This is just for educational purposes only!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I will be touching on a practical use case of implementing Redis in a Nodejs Application. &lt;/p&gt;

&lt;p&gt;Redis uses the concept of a KEY-VALUE pair for storing data.&lt;br&gt;
This means that before any data can be stored, there has to be a given 'name' (index) for the data.&lt;/p&gt;

&lt;p&gt;This also allows for the speed of Redis as all data are indexed by default (using the key attributes).&lt;/p&gt;

&lt;p&gt;e.g:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;redis-cli&amp;gt; set name "Abdulhakeem"&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This is used to add the key "name" to the cache with the value of "Abdulhakeem". &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;redis-cli&amp;gt; get name &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;returns "Abdulhakeem" &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;redis-cli&amp;gt; set age 30&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;returns "OK" every time we add/del a key &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;redis-cli&amp;gt; get age &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;returns 30 ( the value given to the "age" key)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;redis-cli&amp;gt; del age &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;deletes the "age" key as well as the value it holds.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, lets see it in action:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Open a terminal and run the redis-server command &lt;br&gt;
    $ redis-server&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Open your Nodejs application in your IDE, and let us add Redis caching to it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create a new redis.js/ts file, and implement all your Redis-related functionalities in it.&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;redis.utils.js  (your choice)

import {createClient} from "redis";

// set up redis 
const redisClient = createClient()

await redisClient.connect()

// set up expiration (you can also set it in your .env file)
const EXPIRES_IN = 3600 * 24 * 7 // 7 days 

// ############ Redis FUnctions ########## //
// get or set key and value 
export const getOrSetCache = async (key, cb) =&amp;gt; {
    try {
        let data = await redisClient.get(key);

        if (data != null) return JSON.parse(key)
        else {
            // run the db query if key not found in cache
            data = await cb;
            await redisClient.SETEX(key, EXPIRES_IN, JSON.stringify(data))  // save data to cache
            return data
        }
    } catch (error) {
        return false
    }
}

// get or set List datatype 
export const getOrSetListCache = async (key, cb) =&amp;gt; {
    try{
        let data = await redisClient.LRANGE(key, 0, -1); // fetch all elements in the list 

        if (data.length &amp;gt; 0) return JSON.parse(data);
        else {
            data = cb;
            await redisClient.LPUSH(key, EXPIRES_IN, JSON.stringify({data}));

            return data
        }
    } catch (error) {
        return false
    }
}

// ... More can be added as desired/needed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, to use this redis functions:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;import the functions into the file&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UserModel from "./../models/user.model.js"
import {
  getOrSetCache,
  getOrSetListCache,
} from "./../utils/redis.utils.js";

&amp;gt; Call these functions inside where and when needed:

// get all users 
export const getUsers = async (req, res) =&amp;gt; {
    try {
        // create a function to query your database for users
        const foundUsers = async () =&amp;gt; {
            try {
                const allUsers = await UserModel.find()

                return allUsers
            } catch (err) {
                return err
            }
        }

        // check the cache for users key or run the function to fetch users from db
        const users = await getOrSetCache(allUsers, foundUsers())

        return res.status(200).json({
            success: true,
            message: "Fetched all users!",
            data: users
        })

    } catch (error) {
        return res.status(500).json({
            success: false,
            message: `${error.message}`
        })
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also call the "getOrSetListCache" function this same way.&lt;/p&gt;

&lt;p&gt;But this is used to GET or CREATE a new List key with the element.&lt;/p&gt;

&lt;p&gt;I used the LPUSH method (this appends the new element to the top/left of the list) so new elements are at the top, while the old elements are pushed to the bottom (and can easily be removed using the RPOP()).&lt;/p&gt;

&lt;p&gt;These simple implementations &lt;/p&gt;

&lt;p&gt;EXTENSION USAGE&lt;br&gt;
We've seen how we can implement Redis caching and how we can store or retrieve data from it.&lt;br&gt;
We also briefly touched on setting Expiration time for the key (so we don't have outdated keys in our store).&lt;/p&gt;

&lt;p&gt;But what happens on endpoints with millions of records and requests that have been accessed regularly?&lt;/p&gt;

&lt;p&gt;For example, we set an expiration on the cache to say 7 days (to minimize the call to d db). If say a user updates his/her record or a new user is added, but the cached record has not yet expired, won't the Redis cache be holding outdated data then?&lt;/p&gt;

&lt;p&gt;Two challenges:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reduce API calls to the database as much as possible (e.g, databricks tables are not optimal for querying, and they hold too large unstructured data)&lt;/li&gt;
&lt;li&gt;Keep the Redis cache updated with the latest data.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In other to solve these 2 challenges, I created an updateCache function to update the Redis cache every time there is a CRUD call to the database, except GET/READ requests.&lt;/p&gt;

&lt;p&gt;The updateCache function is called on every Create, Update, and Delete record that is related to a key in the Redis cache.&lt;/p&gt;

&lt;p&gt;This is how I got my Redis to work, how did you implement yours?&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
