<?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: ashfromsky</title>
    <description>The latest articles on DEV Community by ashfromsky (@ashfromsky_2dbda50649da6d).</description>
    <link>https://dev.to/ashfromsky_2dbda50649da6d</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3634921%2F4682ec6e-118d-47df-b80f-f1434d310f31.png</url>
      <title>DEV Community: ashfromsky</title>
      <link>https://dev.to/ashfromsky_2dbda50649da6d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ashfromsky_2dbda50649da6d"/>
    <language>en</language>
    <item>
      <title>Building a Type-Safe In-Memory DB</title>
      <dc:creator>ashfromsky</dc:creator>
      <pubDate>Fri, 28 Nov 2025 15:55:38 +0000</pubDate>
      <link>https://dev.to/ashfromsky_2dbda50649da6d/building-a-type-safe-in-memory-db-2p39</link>
      <guid>https://dev.to/ashfromsky_2dbda50649da6d/building-a-type-safe-in-memory-db-2p39</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hi everyone! 👋 I’d like to share a backend engineering project that I’ve been working on:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;YaraDB — a lightweight, document-oriented in-memory database built entirely with Python and FastAPI, designed to work natively with Pydantic models.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;👉 Repo:&lt;/strong&gt; &lt;a href="//github.com/illusiOxd/yaradb"&gt;Repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Technical Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    ⚡ Hybrid Storage Engine: Organize data into Tables that support both Strict Mode (rigid schema enforcement) for critical data and Free Mode (schema-less) for rapid prototyping.&lt;/li&gt;
&lt;li&gt;    🔍 Advanced Indexing: Don't just scan—search. Includes built-in Hash Indexes for O(1) lookups and B-Tree Indexes for fast range queries and sorting (O(log n)).&lt;/li&gt;
&lt;li&gt;    🛡️ Optimistic Concurrency Control (OCC): Built-in protection against race conditions using document versioning (returns 409 Conflict on mismatches).&lt;/li&gt;
&lt;li&gt;    💾 Persistence: Implements WAL (Write-Ahead Logging) and Snapshots, so you don't lose data if the server restarts or crashes.&lt;/li&gt;
&lt;li&gt;    🔌 HTTP-Native: No drivers needed — it runs on FastAPI, so you can interact with it via standard REST calls or the built-in Swagger UI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🌱 Why I Built It&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I love Redis, but for many Python microservices, I found myself writing the same validation logic over and over again to ensure the JSON I got back wasn't broken.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My goals were:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    To create a storage solution where Data Integrity is a first-class citizen (Schema-first approach).&lt;/li&gt;
&lt;li&gt;    To dive deep into database internals—implementing my own WAL, Indexing engine, and Concurrency Control logic in Python was a huge learning experience.&lt;/li&gt;
&lt;li&gt;    To make a tool perfect for AI Agents and LLMs that need structured short-term memory without the complexity of setting up a heavy SQL server.&lt;/li&gt;
&lt;li&gt;It's currently in the Alpha/MVP stage. It’s not a "Redis killer" (C is faster, obviously), but it’s a robust, developer-friendly alternative for Python-heavy stacks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🤝 Contributing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I am actively looking for feedback on the architecture, especially regarding the WAL implementation and performance optimizations.&lt;/p&gt;

&lt;p&gt;If you are interested in backend engineering, database internals, or just want a lightweight DB for your next pet project, check it out!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feedback and ⭐ stars are highly appreciated!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>database</category>
      <category>opensource</category>
      <category>fastapi</category>
    </item>
  </channel>
</rss>
