<?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: Mokshit Kaushik</title>
    <description>The latest articles on DEV Community by Mokshit Kaushik (@laniuslegate).</description>
    <link>https://dev.to/laniuslegate</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%2F4114919%2F4800724b-7c4e-4672-b6c4-b8424d78550a.jpg</url>
      <title>DEV Community: Mokshit Kaushik</title>
      <link>https://dev.to/laniuslegate</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/laniuslegate"/>
    <language>en</language>
    <item>
      <title>The Database That Tells You What It Knows</title>
      <dc:creator>Mokshit Kaushik</dc:creator>
      <pubDate>Tue, 08 Sep 2026 06:45:54 +0000</pubDate>
      <link>https://dev.to/laniuslegate/the-database-that-tells-you-what-it-knows-54f9</link>
      <guid>https://dev.to/laniuslegate/the-database-that-tells-you-what-it-knows-54f9</guid>
      <description>&lt;p&gt;“Store the data” is only the beginning of the problem.&lt;/p&gt;

&lt;p&gt;The difficult questions usually come afterward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What structure does this data actually have?&lt;/li&gt;
&lt;li&gt;Which fields are missing or inconsistent?&lt;/li&gt;
&lt;li&gt;Which values are invalid?&lt;/li&gt;
&lt;li&gt;Which changes are safe to apply automatically?&lt;/li&gt;
&lt;li&gt;What exactly changed after a repair?&lt;/li&gt;
&lt;li&gt;Can the system prove that its storage and indexes are still consistent?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I built &lt;strong&gt;Atlas&lt;/strong&gt; to answer those questions inside the database engine itself.&lt;/p&gt;

&lt;p&gt;Atlas is a zero-dependency embedded database for semi-structured data. It stores records, builds a full-text search index, infers schema, analyzes data quality, proposes safe repairs, preserves uncertain records, and records an audit trail of applied changes.&lt;/p&gt;

&lt;p&gt;It does not use SQLite or SQL. It is not intended to replace SQLite for relational workloads. Instead, Atlas focuses on a gap that is usually handled by external scripts and tools:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Data inspection, diagnosis, and safe repair as first-class database capabilities.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;That is the problem Atlas was built to solve.&lt;/code&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Why data quality belongs inside the database engine
&lt;/h2&gt;

&lt;p&gt;Most databases are very good at storing and retrieving data.&lt;br&gt;
That is necessary, but real-world data work rarely stops there.**&lt;/p&gt;

&lt;p&gt;Operational records, imported JSON, CSV files, event payloads, and semi-structured documents often arrive with problems:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"T-1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;" Connection timeout "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"priority"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"HIGH"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"T-1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"connection timeout"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"priority"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"high"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"T-2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Unicode café search"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"priority"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These records contain several potential issues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Duplicate logical identifiers&lt;/li&gt;
&lt;li&gt;Leading or trailing whitespace&lt;/li&gt;
&lt;li&gt;Inconsistent capitalization&lt;/li&gt;
&lt;li&gt;Null-like values&lt;/li&gt;
&lt;li&gt;Missing fields&lt;/li&gt;
&lt;li&gt;Mixed data types&lt;/li&gt;
&lt;li&gt;Malformed email addresses&lt;/li&gt;
&lt;li&gt;Different date formats&lt;/li&gt;
&lt;li&gt;Inconsistent structures across records&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A storage engine can preserve these values perfectly while still leaving the data difficult to understand and use.&lt;/p&gt;

&lt;p&gt;The usual response is to add external tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A schema profiler&lt;/li&gt;
&lt;li&gt;A data-quality script&lt;/li&gt;
&lt;li&gt;A search engine&lt;/li&gt;
&lt;li&gt;A cleanup job&lt;/li&gt;
&lt;li&gt;A validation pipeline&lt;/li&gt;
&lt;li&gt;An audit system&lt;/li&gt;
&lt;li&gt;A quarantine workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This creates a fragmented system. The external tools may use different assumptions from the database. Repairs may not update the search index. Scripts may mutate records without a durable audit trail.&lt;/p&gt;

&lt;p&gt;Diagnosis may happen outside the storage boundary, where the system cannot guarantee that the result still matches the data.&lt;/p&gt;

&lt;p&gt;The fundamental problem I chose was this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Most embedded databases provide storage and query primitives, but inspection, diagnosis, and safe repair are usually handled by external tools. Atlas brings those capabilities into the database engine itself.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The Atlas data-quality contract
&lt;/h2&gt;

&lt;p&gt;Atlas is built around a simple operational contract:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Data should be stored durably, made searchable, inspected structurally, repaired explicitly, and verified afterward.&lt;br&gt;
That contract creates a complete workflow:&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;INGEST
   |
   v
STORE
   |
   v
INDEX
   |
   v
UNDERSTAND
   |
   v
REPAIR
   |
   v
VERIFY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each stage has a clear responsibility.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ingest
&lt;/h3&gt;

&lt;p&gt;Atlas accepts JSON arrays, JSON Lines, and CSV files. CSV values receive conservative type coercion, and JSONL and CSV inputs can be processed incrementally.&lt;/p&gt;

&lt;h3&gt;
  
  
  Store
&lt;/h3&gt;

&lt;p&gt;Records are written to an append-only storage file with checksums and write-ahead journaling.&lt;/p&gt;

&lt;h3&gt;
  
  
  Index
&lt;/h3&gt;

&lt;p&gt;Atlas maintains a persisted inverted index for full-text search and updates affected documents incrementally.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understand
&lt;/h3&gt;

&lt;p&gt;The engine infers field types, profiles field statistics, measures coverage and null values, and calculates an explainable health score.&lt;/p&gt;

&lt;h3&gt;
  
  
  Repair
&lt;/h3&gt;

&lt;p&gt;Atlas detects and classifies issues. It does not modify records during diagnosis or dry-run repair.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verify
&lt;/h3&gt;

&lt;p&gt;The system checks storage blocks, journal state, index consistency, and audit-chain integrity.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;The goal is not simply to add more commands to a database CLI. The goal is to keep the entire data lifecycle connected.&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Atlas does not use SQLite
&lt;/h2&gt;

&lt;p&gt;SQLite is an excellent database. It is mature, reliable, portable, and extremely useful for embedded relational applications.&lt;br&gt;
SQLite is optimized for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tables&lt;/li&gt;
&lt;li&gt;SQL queries&lt;/li&gt;
&lt;li&gt;Transactions&lt;/li&gt;
&lt;li&gt;Joins&lt;/li&gt;
&lt;li&gt;Relational application state&lt;/li&gt;
&lt;li&gt;A mature embedded database ecosystem
Atlas targets a different optimization point.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Atlas is designed for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Semi-structured JSON-like records&lt;/li&gt;
&lt;li&gt;Built-in schema inference&lt;/li&gt;
&lt;li&gt;Full-text BM25 search&lt;/li&gt;
&lt;li&gt;Explainable data-quality analysis&lt;/li&gt;
&lt;li&gt;Safe repair proposals&lt;/li&gt;
&lt;li&gt;Quarantine of uncertain records&lt;/li&gt;
&lt;li&gt;Repair audit trails&lt;/li&gt;
&lt;li&gt;Direct inspection of the storage lifecycle&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the comparison is not that Atlas is universally better than SQLite.&lt;/p&gt;

&lt;p&gt;The more accurate claim is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Atlas is better suited when the question is not only “Can this record be stored?” but also “What is this data, what is wrong with it, which changes are safe, and how can those changes be proven?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Atlas does not use SQLite or SQL because the project is intentionally built around a different data model and workflow.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SQLite remains an excellent choice for relational application data. Atlas is designed for a different class of problem: semi-structured data that must be stored, searched, understood, repaired, and verified in one place.&lt;/code&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  The write path: durable storage with a visible trail
&lt;/h2&gt;

&lt;p&gt;Atlas uses append-only binary storage with a write-ahead journal.&lt;br&gt;
The write path is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Acquire lock
     |
     v
Write transaction to journal
     |
     v
Synchronize journal
     |
     v
Apply committed blocks to data
     |
     v
Synchronize data
     |
     v
Truncate journal
     |
     v
Release lock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More precisely:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Atlas acquires the database lock.&lt;/li&gt;
&lt;li&gt;It writes a transaction-begin marker.&lt;/li&gt;
&lt;li&gt;It appends record or tombstone blocks.&lt;/li&gt;
&lt;li&gt;It writes a transaction-commit marker.&lt;/li&gt;
&lt;li&gt;It synchronizes the journal.&lt;/li&gt;
&lt;li&gt;It replays committed entries into the main data file.&lt;/li&gt;
&lt;li&gt;It synchronizes the data file.&lt;/li&gt;
&lt;li&gt;It truncates the journal.&lt;/li&gt;
&lt;li&gt;It releases the lock.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The journal is not treated as temporary noise. It is the recovery boundary.&lt;/p&gt;

&lt;p&gt;If the process stops during a write, Atlas can distinguish committed transaction work from incomplete work. On the next open, committed transactions can be replayed while unfinished transactions are discarded.&lt;/p&gt;

&lt;p&gt;Each binary block contains a checksum:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[MAGIC]
[VERSION]
[BLOCK TYPE]
[SEQUENCE]
[PAYLOAD LENGTH]
[PAYLOAD]
[SHA-256 CHECKSUM]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The checksum covers the block header and payload. A damaged block is detected rather than silently accepted.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;This design also makes the storage system inspectable. The database is not just a black box that returns records. It has a visible trail of how those records reached disk.&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The database directory is part of the design
&lt;/h2&gt;

&lt;p&gt;An Atlas database directory contains separate files for separate responsibilities:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mydb/
  data.atf           primary append-only record log
  journal.atf        write-ahead journal
  index.atj          persisted inverted index
  audit.atf          chained repair audit trail
  quarantine.json    uncertain records
  meta.json          human-readable metadata
  lock               platform-native lock file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each file answers a different question.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;data.atf&lt;/code&gt;: What records are currently stored?&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;journal.atf&lt;/code&gt;: What committed work is recoverable?&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;index.atj&lt;/code&gt;: How are records searchable?&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;audit.atf&lt;/code&gt;: What repairs have been applied?&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;quarantine.json&lt;/code&gt;: Which records were preserved for review?&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;meta.json&lt;/code&gt;: What does the database know about itself?
The directory is not just an implementation detail. It is part of Atlas’s inspectability model.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Search that explains its ranking
&lt;/h2&gt;

&lt;p&gt;Atlas includes a full-text search engine based on a persisted inverted index and Okapi BM25 ranking.&lt;br&gt;
The index stores information such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"doc_lengths"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"doc_fields"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"postings"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The index tracks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Term frequency&lt;/li&gt;
&lt;li&gt;Document frequency&lt;/li&gt;
&lt;li&gt;Document length&lt;/li&gt;
&lt;li&gt;Token positions&lt;/li&gt;
&lt;li&gt;Field-specific tokens&lt;/li&gt;
&lt;li&gt;Incremental document updates
Atlas supports:&lt;/li&gt;
&lt;li&gt;Term searches&lt;/li&gt;
&lt;li&gt;Phrase searches&lt;/li&gt;
&lt;li&gt;Boolean expressions&lt;/li&gt;
&lt;li&gt;Field filters&lt;/li&gt;
&lt;li&gt;Numeric ranges&lt;/li&gt;
&lt;li&gt;Date-like ranges&lt;/li&gt;
&lt;li&gt;Explainable scoring
For example, the query language can express:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"connection timeout"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(database OR storage) AND recovery
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;priority:[2 TO 5]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Search is not implemented as a full scan for ordinary term, phrase, and field queries. Atlas uses its persisted index to find candidate records, then applies BM25 scoring to rank them.&lt;br&gt;
The result is not just a list of matches. With explanation enabled, Atlas can show how search terms contributed to the ranking.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;That is important for a database whose goal is understanding. A search result should be relevant, but it should also be explainable.&lt;/code&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Understanding data without a predefined schema
&lt;/h2&gt;

&lt;p&gt;Semi-structured data does not always arrive with a reliable schema.&lt;br&gt;
Atlas infers field structure from the records it receives. It recognizes categories such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Null&lt;/li&gt;
&lt;li&gt;Boolean&lt;/li&gt;
&lt;li&gt;Integer&lt;/li&gt;
&lt;li&gt;Number&lt;/li&gt;
&lt;li&gt;String&lt;/li&gt;
&lt;li&gt;Date-like value&lt;/li&gt;
&lt;li&gt;Array&lt;/li&gt;
&lt;li&gt;Object
The profiler also reports:&lt;/li&gt;
&lt;li&gt;Field coverage&lt;/li&gt;
&lt;li&gt;Null counts&lt;/li&gt;
&lt;li&gt;Distinct values&lt;/li&gt;
&lt;li&gt;Common values&lt;/li&gt;
&lt;li&gt;Numeric minimums and maximums&lt;/li&gt;
&lt;li&gt;Averages&lt;/li&gt;
&lt;li&gt;Nested field paths
This allows Atlas to answer questions that a basic storage layer cannot answer:&lt;/li&gt;
&lt;li&gt;Which fields are present in most records?&lt;/li&gt;
&lt;li&gt;Which fields contain mixed types?&lt;/li&gt;
&lt;li&gt;Which values are mostly null?&lt;/li&gt;
&lt;li&gt;Which fields have unexpectedly high cardinality?&lt;/li&gt;
&lt;li&gt;Which records contain nested structures?&lt;/li&gt;
&lt;li&gt;Which fields might need a repair rule?
Atlas then combines multiple signals into a health score covering:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Storage integrity
Schema consistency
Data quality
Search-index health
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;code&gt;The score is intentionally explainable. Atlas does not treat health as a mysterious number. It exposes the components behind the result.&lt;/code&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Safe repair is a database operation
&lt;/h2&gt;

&lt;p&gt;The most important difference between Atlas and a typical cleanup script is that repair is part of the engine’s controlled workflow.&lt;br&gt;
Atlas does not mutate records simply because it found something suspicious.&lt;br&gt;
The repair lifecycle is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DIAGNOSE
    |
    v
DRY RUN
    |
    v
APPLY SAFE CHANGES
    |
    v
AUDIT AND VERIFY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The repair engine classifies proposals by confidence and action.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjn6hczw6sv0gdtlhelca.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjn6hczw6sv0gdtlhelca.png" alt=" " width="538" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The important boundary is explicit mutation.&lt;/p&gt;

&lt;p&gt;Diagnosis does not modify records.&lt;/p&gt;

&lt;p&gt;Dry-run repair does not modify records.&lt;/p&gt;

&lt;p&gt;Only an explicit apply operation changes records, and only proposals classified as safe are automatically applied.&lt;/p&gt;

&lt;p&gt;Uncertain records are not silently deleted or forced into a guessed format. They are preserved in &lt;code&gt;quarantine.json&lt;/code&gt; for review.&lt;br&gt;
That makes quarantine a safety feature, not an error dump.&lt;/p&gt;


&lt;h2&gt;
  
  
  Repair must also update the rest of the system
&lt;/h2&gt;

&lt;p&gt;A repair is not complete if it changes only the record file.&lt;br&gt;
Suppose Atlas trims whitespace from a title field. The repair must also ensure that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The updated record is persisted&lt;/li&gt;
&lt;li&gt;The search index reflects the new content&lt;/li&gt;
&lt;li&gt;The audit trail records the change&lt;/li&gt;
&lt;li&gt;The health calculation sees the updated state&lt;/li&gt;
&lt;li&gt;Future verification remains consistent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is why repair belongs inside the database engine rather than in an external script.&lt;/p&gt;

&lt;p&gt;The engine understands the relationship between storage, indexes, profiling, and audit history.&lt;/p&gt;

&lt;p&gt;Every applied repair is recorded with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Timestamp&lt;/li&gt;
&lt;li&gt;Record ID&lt;/li&gt;
&lt;li&gt;Field&lt;/li&gt;
&lt;li&gt;Repair rule&lt;/li&gt;
&lt;li&gt;Result&lt;/li&gt;
&lt;li&gt;Before-value hash&lt;/li&gt;
&lt;li&gt;After-value hash&lt;/li&gt;
&lt;li&gt;Previous audit-chain hash&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;The audit log does not store raw before-and-after values. It stores hashes and chain links that make tampering detectable without duplicating sensitive content.&lt;/code&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  What zero dependencies actually means
&lt;/h2&gt;

&lt;p&gt;Atlas has no external runtime dependencies. The &lt;code&gt;requirements.txt&lt;/code&gt; file is intentionally empty.&lt;/p&gt;

&lt;p&gt;That means the implementation owns more of the system directly.&lt;/p&gt;

&lt;p&gt;Instead of relying on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A database wrapper&lt;/li&gt;
&lt;li&gt;A search package&lt;/li&gt;
&lt;li&gt;A schema library&lt;/li&gt;
&lt;li&gt;A data-quality framework&lt;/li&gt;
&lt;li&gt;A repair engine&lt;/li&gt;
&lt;li&gt;A file-locking package&lt;/li&gt;
&lt;li&gt;A CLI framework
Atlas uses Python’s standard library:&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;struct&lt;/code&gt; for binary framing&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hashlib&lt;/code&gt; for checksums&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;json&lt;/code&gt; for record and metadata serialization&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;csv&lt;/code&gt; for CSV ingestion&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;argparse&lt;/code&gt; for the CLI&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;re&lt;/code&gt; and &lt;code&gt;unicodedata&lt;/code&gt; for tokenization&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;fcntl&lt;/code&gt; on Linux and macOS&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;msvcrt&lt;/code&gt; on Windows&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;os.replace&lt;/code&gt; for atomic file replacement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Zero dependencies did not make the project simpler automatically. It moved more design responsibility into the project itself.&lt;/p&gt;

&lt;p&gt;Atlas had to define:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The binary block format&lt;/li&gt;
&lt;li&gt;The checksum boundary&lt;/li&gt;
&lt;li&gt;The WAL transaction markers&lt;/li&gt;
&lt;li&gt;The repair confidence rules&lt;/li&gt;
&lt;li&gt;The index representation&lt;/li&gt;
&lt;li&gt;The audit-chain format&lt;/li&gt;
&lt;li&gt;The cross-platform locking behavior&lt;/li&gt;
&lt;li&gt;The recovery behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The advantage is control. Each important behavior is visible in the codebase and documented as part of the engine’s design.&lt;/p&gt;


&lt;h2&gt;
  
  
  Cross-platform without adding a runtime package
&lt;/h2&gt;

&lt;p&gt;Atlas runs on Linux, macOS, and Windows.&lt;br&gt;
The platform-specific difference is file locking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Linux/macOS → fcntl
Windows     → msvcrt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both modules are part of Python’s standard library.&lt;/p&gt;

&lt;p&gt;On Linux and macOS, Atlas supports shared reader locks and exclusive writer locks.&lt;/p&gt;

&lt;p&gt;On Windows, the standard-library approach uses an exclusive lock for both readers and writers. This slightly reduces read concurrency, but preserves safer single-access behavior without adding a third-party package.&lt;/p&gt;

&lt;p&gt;The database format itself remains the same across platforms.&lt;/p&gt;




&lt;h2&gt;
  
  
  Verification is part of the product
&lt;/h2&gt;

&lt;p&gt;Atlas is designed around the idea that claims should be testable.&lt;/p&gt;

&lt;p&gt;The project includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Record codec tests&lt;/li&gt;
&lt;li&gt;Checksum corruption tests&lt;/li&gt;
&lt;li&gt;CRUD persistence tests&lt;/li&gt;
&lt;li&gt;WAL recovery tests&lt;/li&gt;
&lt;li&gt;Search and BM25 tests&lt;/li&gt;
&lt;li&gt;Schema inference tests&lt;/li&gt;
&lt;li&gt;Profiling tests&lt;/li&gt;
&lt;li&gt;Repair classification tests&lt;/li&gt;
&lt;li&gt;Audit-chain tests&lt;/li&gt;
&lt;li&gt;Quarantine tests&lt;/li&gt;
&lt;li&gt;Import/export tests&lt;/li&gt;
&lt;li&gt;CLI tests&lt;/li&gt;
&lt;li&gt;Cross-process lock tests&lt;/li&gt;
&lt;li&gt;Embedded self-tests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The current project checks include:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;161 unittest cases
20 embedded self-tests
0 runtime dependencies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The release builder also creates normalized archives and verifies reproducibility by comparing independently generated release ZIP files.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;That matters because “zero dependency” and “reproducible release” are not useful claims unless the project can demonstrate them.&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Honest limits
&lt;/h2&gt;

&lt;p&gt;Atlas is deliberately focused.&lt;/p&gt;

&lt;p&gt;It is not:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A network database server&lt;/li&gt;
&lt;li&gt;A distributed database&lt;/li&gt;
&lt;li&gt;An MVCC engine&lt;/li&gt;
&lt;li&gt;A replacement for every SQLite workload&lt;/li&gt;
&lt;li&gt;A relational query engine&lt;/li&gt;
&lt;li&gt;An encrypted storage system&lt;/li&gt;
&lt;li&gt;A high-concurrency database&lt;/li&gt;
&lt;li&gt;A stemming or fuzzy-search engine&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Atlas uses a single-writer model. Range queries use linear scans. On Windows, reads are serialized through the same exclusive locking approach used for writes.&lt;/p&gt;

&lt;p&gt;Repair confidence values are design heuristics, not statistical certainty. A proposal classified as &lt;code&gt;REVIEW&lt;/code&gt; still requires human judgment.&lt;/p&gt;

&lt;p&gt;These limits are not hidden from the user. They are part of the project’s design boundary.&lt;/p&gt;

&lt;p&gt;A focused system is easier to understand when it is honest about what it does not try to be.&lt;/p&gt;




&lt;h2&gt;
  
  
  The design principles behind Atlas
&lt;/h2&gt;

&lt;p&gt;If I designed Atlas again, I would still start with the same principles.&lt;/p&gt;

&lt;h3&gt;
  
  
  Define the data-quality boundary first
&lt;/h3&gt;

&lt;p&gt;Before adding repair rules, define exactly what the engine is allowed to change automatically and what must be reviewed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Separate diagnosis from mutation
&lt;/h3&gt;

&lt;p&gt;A diagnostic command should not change records. A dry run should not change records. Mutation should always be explicit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Treat storage and data quality as connected systems
&lt;/h3&gt;

&lt;p&gt;Repairing a record without updating its index, health score, or audit trail is an incomplete repair.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preserve uncertainty
&lt;/h3&gt;

&lt;p&gt;A system that guesses silently is more dangerous than one that asks for review. Quarantine keeps uncertain data available without pretending it is correct.&lt;/p&gt;

&lt;h3&gt;
  
  
  Make limitations visible
&lt;/h3&gt;

&lt;p&gt;The goal is not to claim that Atlas solves every database problem. The goal is to make a specific problem smaller and more trustworthy.&lt;/p&gt;




&lt;h2&gt;
  
  
  The fundamental idea
&lt;/h2&gt;

&lt;p&gt;Atlas is not simply another embedded database.&lt;br&gt;
Its value is the combination of capabilities that are normally split across several tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Storage
+ Search
+ Schema inference
+ Profiling
+ Health analysis
+ Safe repair
+ Quarantine
+ Auditability
+ Verification
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The core idea is straightforward:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Data inspection, diagnosis, and safe repair should not be external afterthoughts. They should be capabilities of the database engine that stores the data.&lt;br&gt;
SQLite remains the right choice for many relational applications. Search engines remain the right choice for large-scale distributed search. Data-quality platforms remain valuable for enterprise pipelines.&lt;br&gt;
Atlas occupies a narrower space:&lt;br&gt;
A transparent, zero-dependency, embedded engine for semi-structured data that needs to be stored, searched, understood, repaired, and verified in one place.&lt;br&gt;
It does not just store data.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;It helps users understand what they stored, decide what can be safely changed, preserve what is uncertain, and prove what happened afterward.&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; &lt;a href="https://github.com/GeneralReznov/Atlas" rel="noopener noreferrer"&gt;Atlas GitHub repository&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Demo:&lt;/strong&gt; &lt;a href="https://drive.google.com/file/d/1X9in-384-jGjoNmMzzwBDslG_4BNUO3x/view?usp=drivesdk" rel="noopener noreferrer"&gt;Atlas Demo Video&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Atlas: Store it. Search it. Understand it. Repair it.
&lt;/h3&gt;

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