<?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: Benedetto Proietti</title>
    <description>The latest articles on DEV Community by Benedetto Proietti (@benedetto_proietti).</description>
    <link>https://dev.to/benedetto_proietti</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%2F1805651%2Fae294aac-f4ec-48a3-a847-ba4525054fb0.jpg</url>
      <title>DEV Community: Benedetto Proietti</title>
      <link>https://dev.to/benedetto_proietti</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/benedetto_proietti"/>
    <language>en</language>
    <item>
      <title>How to Build a Vector Database Using Amazon S3 Vectors</title>
      <dc:creator>Benedetto Proietti</dc:creator>
      <pubDate>Wed, 30 Jul 2025 07:35:31 +0000</pubDate>
      <link>https://dev.to/janeasystems/how-to-build-a-vector-database-using-amazon-s3-vectors-2kdl</link>
      <guid>https://dev.to/janeasystems/how-to-build-a-vector-database-using-amazon-s3-vectors-2kdl</guid>
      <description>&lt;p&gt;&lt;em&gt;And Say Goodbye to Expensive SaaS Pricing&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here’s an estimated price comparison for storing 1 billion and 10 billion vectors using the most common SaaS vector databases. These numbers are pulled directly from each provider’s pricing calculator. &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.amazonaws.com%2Fuploads%2Farticles%2F8exmvfv2yg4ydcx1w1cp.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.amazonaws.com%2Fuploads%2Farticles%2F8exmvfv2yg4ydcx1w1cp.png" alt="Assumptions: 768 dimensions, 32-bit values per vector" width="549" height="138"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h1&gt;
  
  
  Why Are Vector Databases So Expensive?
&lt;/h1&gt;

&lt;p&gt;I’ve covered this before in two articles — &lt;a href="https://medium.com/@benedetto73/desire-for-structure-read-sql-9464766ec509" rel="noopener noreferrer"&gt;Desire for Structure (read: “SQL”)&lt;/a&gt; and &lt;a href="https://medium.com/@benedetto73/beyond-the-art-of-database-indexing-436b14dcf987" rel="noopener noreferrer"&gt;(Beyond) The Art of Database Indexing&lt;/a&gt;. Traditional indexing starts to fall apart at scale — what we used to call “Big Data.” &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.amazonaws.com%2Fuploads%2Farticles%2Fvxjgohhihw4f5nmdvqkn.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.amazonaws.com%2Fuploads%2Farticles%2Fvxjgohhihw4f5nmdvqkn.png" alt=" " width="400" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Want the short version? &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Vector databases are expensive because they rely on powerful, always-on hardware. They keep in-memory indexes fresh and caches hot — and that costs money.&lt;/em&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Old Tricks, New Vector World
&lt;/h1&gt;

&lt;p&gt;For tabular or log data, we decoupled compute and storage a long time ago: store data cheaply in S3 or MinIO, and spin up compute (like Spark or Presto) only when needed. &lt;/p&gt;

&lt;p&gt;Amazon has now extended this model to vector embeddings with Amazon S3 Vectors. [Quick dive &lt;a href="https://medium.com/@benedetto73/s3-vectors-changing-how-we-think-about-vector-embeddings-b04f8af2e3cd" rel="noopener noreferrer"&gt;here&lt;/a&gt;.] &lt;/p&gt;

&lt;p&gt;S3 Vectors lets you store huge volumes of vector data at low cost and run similarity searches in under a second — ideal for batch workloads and analytics. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Can we ditch expensive Vector DBs now?&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Not quite. S3 Vectors doesn’t offer the low latency needed for real-time use cases — like fraud detection, recommendation engines, or chatbots that require sub-100 ms responses. &lt;/p&gt;

&lt;p&gt;Instead, think of S3 Vectors as the durable, budget-friendly foundation. You’ll still need a lightweight layer on top to meet real-time latency requirements. &lt;/p&gt;

&lt;h1&gt;
  
  
  Level 1: Download and Run
&lt;/h1&gt;

&lt;p&gt;Let’s start simple: use open-source software out of the box, no code changes, just run it. &lt;/p&gt;

&lt;p&gt;We lower similarity search latency by using a classic Computer Science technique — indexes — and storing data in RAM (which is fast but expensive). &lt;/p&gt;

&lt;h2&gt;
  
  
  Product Quantization (PQ): Fast, Memory-Efficient Search
&lt;/h2&gt;

&lt;p&gt;Performing exact distance calculations (cosine, Euclidean) on billions of 768-dimensional vectors is too slow and compute-heavy. &lt;/p&gt;

&lt;p&gt;Product Quantization (PQ) helps by compressing vectors into compact forms. This makes searches 10–100× faster — with minimal accuracy loss. &lt;/p&gt;

&lt;h2&gt;
  
  
  How PQ Works
&lt;/h2&gt;

&lt;p&gt;PQ splits each high-dimensional vector into smaller chunks (e.g., groups of 8 dimensions), then maps each chunk to the closest centroid in a precomputed codebook. Only the centroid IDs are stored. &lt;/p&gt;

&lt;p&gt;At query time, instead of comparing against billions of raw vectors, the system compares to ~256 centroids per chunk — massively reducing compute time. &lt;/p&gt;

&lt;p&gt;For most NLP workloads, PQ delivers excellent recall while cutting memory and compute costs. &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.amazonaws.com%2Fuploads%2Farticles%2Fuh0tf0n5lzh33kx0ti9s.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.amazonaws.com%2Fuploads%2Farticles%2Fuh0tf0n5lzh33kx0ti9s.png" alt=" " width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tool Selection
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;FAISS&lt;/strong&gt;— originally developed by Facebook AI Research — is the go-to library for efficient similarity search and clustering of dense vectors. It’s widely adopted for high-performance vector indexing at scale. But I recommend &lt;a href="https://github.com/JaneaSystems/jecq" rel="noopener noreferrer"&gt;JECQ&lt;/a&gt;, a drop-in replacement with 6× lower memory usage. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclaimer: I created JECQ. That said, it works well. But use FAISS if you prefer.&lt;/em&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  In-Memory Cache
&lt;/h2&gt;

&lt;p&gt;You can cache a subset of raw vectors in RAM using tools like Redis or Valkey, depending on your licensing needs. &lt;/p&gt;

&lt;p&gt;For 10 billion vectors (~30TB in S3), storing just 1% in RAM (about 300GB) can make a big difference. Pricey, but manageable. &lt;/p&gt;

&lt;h1&gt;
  
  
  Level 1 Architecture
&lt;/h1&gt;

&lt;p&gt;Let’s walk through the architecture: &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.amazonaws.com%2Fuploads%2Farticles%2F9jsotg9tntv2grw9neg3.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.amazonaws.com%2Fuploads%2Farticles%2F9jsotg9tntv2grw9neg3.png" alt="Image: AI-generated" width="400" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A router service handles incoming similarity search requests. It’s stateless and can scale horizontally. &lt;/li&gt;
&lt;li&gt;Each node loads a copy of the JECQ (or FAISS) index in memory. &lt;/li&gt;
&lt;li&gt;The router uses JECQ to find candidate vector IDs. &lt;/li&gt;
&lt;li&gt;It then checks Redis for raw vectors: &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache hit:&lt;/strong&gt; Redis returns vectors. Router re-ranks and returns results. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache miss:&lt;/strong&gt; Router pulls vectors from S3, re-ranks, and returns results. &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Level 2: Teaser
&lt;/h1&gt;

&lt;p&gt;Level 1 works fine for datasets up to ~1 billion vectors or demo workloads. But if you want 10–100 ms P95 latency at multi-billion scale, you’ll need more: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local raw vectors on NVMe:&lt;/strong&gt; A middle layer (5–10% of raw size, ~1.5TB) between RAM and S3 to avoid frequent S3 fetches. &lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2Frg0sihlvptis6zovtcce.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.amazonaws.com%2Fuploads%2Farticles%2Frg0sihlvptis6zovtcce.png" alt="Data layers hierarchy" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hierarchical data layers:&lt;/strong&gt; JECQ + Redis/NVMe integration enables local posting list retrieval, turning 100 ms S3 reads into 2–5 ms NVMe reads. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Index sharding:&lt;/strong&gt; Splits PQ clusters across nodes and avoids duplicating 100GB+ compressed data per node. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Advanced cache management:&lt;/strong&gt; Store frequent queries, support MFU/LFU/LRU caching strategies, and pre-load data based on user behavior. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Aggressive S3 Vectors indexing:&lt;/strong&gt; Each query hits just one index. A single S3 bucket can hold 10K indexes, each with ≤50M vectors. Smart indexing helps reduce latency significantly. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of this requires solid engineering chops — but it's necessary if you want to build a cost-effective vector database with 10–100 ms latency on top of S3 Vectors. &lt;/p&gt;

&lt;p&gt;Stay tuned for Level 2. &lt;/p&gt;

</description>
      <category>vectordatabase</category>
      <category>rag</category>
      <category>machinelearning</category>
      <category>ai</category>
    </item>
    <item>
      <title>S3 Vectors: Changing How We Think About Vector Embeddings</title>
      <dc:creator>Benedetto Proietti</dc:creator>
      <pubDate>Wed, 16 Jul 2025 16:11:26 +0000</pubDate>
      <link>https://dev.to/janeasystems/s3-vectors-changing-how-we-think-about-vector-embeddings-55nm</link>
      <guid>https://dev.to/janeasystems/s3-vectors-changing-how-we-think-about-vector-embeddings-55nm</guid>
      <description>&lt;p&gt;Inserting and maintaining data in a relational database is expensive. Every write must update one or more indexes (data structures such as B-trees) that accelerate reads at the cost of extra CPU, memory, and I/O. On a single node, tables start to struggle once they pass a few terabytes. Distributed SQL and NoSQL systems push that limit, but the fundamental write amplification costs remain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Object Storage
&lt;/h2&gt;

&lt;p&gt;To escape those costs, teams began landing raw data in cloud object stores like Amazon S3. Instead of hot indexes, query engines (Spark, Athena, Trino) rely on partition pruning and lightweight statistics. The led to dramatically lower storage bills and petabyte scale datasets on commodity hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vectors Embeddings
&lt;/h2&gt;

&lt;p&gt;AI and LLM workloads now emit vector embeddings – hundreds or thousands of dimensions per record. Answering “Which vectors are nearest to this one?” in real time is tricky:&lt;/p&gt;

&lt;p&gt;High-dimensional data breaks classic data structures.&lt;br&gt;
We lean on approximate nearest neighbor (ANN) algorithms such as HNSW or IVFPQ.&lt;br&gt;
Queries often combine a distance threshold with metadata filters.&lt;br&gt;
Recall, precision, and latency form a three-way tradeoff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Amazon S3 Vector: A Game-Changer
&lt;/h2&gt;

&lt;p&gt;Announced yesterday, Amazon S3 Vectors brings vector-aware storage classes to S3. Each vector table:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stores vectors of fixed dimensionality, compressed on write. Not possible with traditional S3.&lt;/li&gt;
&lt;li&gt;Supports ANN search with simultaneous filters on metadata. Immensely faster than S3.&lt;/li&gt;
&lt;li&gt;Delivers sub-second latency: great for batch, a bit slow for interactive UX.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Closing the Latency Gap with In-Memory Caching
&lt;/h2&gt;

&lt;p&gt;Janea Systems’ background is deeply rooted in working with in-memory, low-latency caches. Our track record includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We are the creators of Memurai, the official Redis for Windows, trusted by developers for its performance and reliability.&lt;/li&gt;
&lt;li&gt;We are active contributors to ValKey, a rapidly evolving open-source fork of Redis, pushing the boundaries of in-memory data stores.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Given the inherent characteristics of S3 Vectors, including powerful storage and batch processing, but with room for improvement in interactive scenarios, the next logical step is to strategically implement a high-performance cache on top of S3 Vectors.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Future
&lt;/h2&gt;

&lt;p&gt;We are excited about the possibilities Amazon S3 Vectors unlocks. The upcoming articles will cover how to effectively integrate Redis, Valkey, or Memurai with the S3 Vector service to achieve optimal performance for your AI/LLM workloads. Also, we will explore the new AWS service and its implications for modern data architectures in detail. Stay tuned!&lt;/p&gt;

</description>
      <category>vectordatabase</category>
      <category>awsbigdata</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>JECQ: Smart, Open-Source Compression for FAISS Users—6x Compression Ratio, 85% Accuracy</title>
      <dc:creator>Benedetto Proietti</dc:creator>
      <pubDate>Wed, 09 Jul 2025 12:19:58 +0000</pubDate>
      <link>https://dev.to/janeasystems/jecq-smart-open-source-compression-for-faiss-users-6x-compression-ratio-85-accuracy-5a5n</link>
      <guid>https://dev.to/janeasystems/jecq-smart-open-source-compression-for-faiss-users-6x-compression-ratio-85-accuracy-5a5n</guid>
      <description>&lt;p&gt;Hi everyone — I'm Benedetto Proietti, Head of Architecture at Janea Systems. I spend most of my time working on performance-critical systems and solving interesting problems at the intersection of machine learning, distributed systems, and open-source technologies. This post is about a recent project I ideated and directed: &lt;a href="https://github.com/JaneaSystems/jecq" rel="noopener noreferrer"&gt;JECQ&lt;/a&gt;, an innovative, open-source, compression solution built specifically for FAISS users. I’ll walk you through the thinking behind it, how it works, and how it can help reduce memory usage without compromising too much on accuracy.&lt;/p&gt;




&lt;p&gt;Ever wonder how it takes just milliseconds to search something on Google, despite hundreds of billions of webpages in existence? The answer is Google’s index. By the company’s own admission, that index weighs in at over 100,000,000 gigabytes. That’s roughly 95 petabytes.&lt;/p&gt;

&lt;p&gt;Now, imagine if you could shrink that index by a factor of six.&lt;/p&gt;

&lt;p&gt;That’s exactly what Janea Systems did for vector embeddings—the index of artificial intelligence.&lt;/p&gt;

&lt;p&gt;Read on to learn what vector embeddings are, why compressing them matters, how it’s been done until now, and how Janea Systems’ solution pushes it to a whole new level.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Data Explosion: From Social Media to Large Language Models
&lt;/h2&gt;

&lt;p&gt;The arrival of Facebook in 2004 marked the beginning of the social media era. Today, Facebook has over 3 billion monthly active users worldwide. In 2016, TikTok introduced the world to short-form video, and now has more than a billion monthly users.&lt;/p&gt;

&lt;p&gt;And in 2023, ChatGPT came along.&lt;/p&gt;

&lt;p&gt;Every one of these inventions led to an explosion of data being generated and processed online. With Facebook, it was posts and photos. TikTok flooded the web with billions of 30-second dance videos.&lt;/p&gt;

&lt;p&gt;When data starts flowing by the millions, companies look for ways to cut storage costs with compression. Facebook compresses the photos we upload to it. TikTok does the same with videos.&lt;/p&gt;

&lt;p&gt;What about large language models? Is there anything to compress there?&lt;/p&gt;

&lt;p&gt;The answer is yes: vector embeddings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vector Embeddings: The Language of Modern AI
&lt;/h2&gt;

&lt;p&gt;Think of vector embeddings as the DNA of meaning inside a language model. When you type something like “Hi, how are you?”, the model converts that phrase into embeddings—a set of vectors that capture how it relates to other phrases. These embeddings help the model process the input and figure out how likely different words are to come next. This allows the model to know the right response to "Hi, how are you?" is “I’m good, and you?” instead of “That’s not something you’d ask a cucumber".&lt;/p&gt;

&lt;p&gt;The principle behind vector embeddings also underpins a process called “similarity search.” Here, embeddings represent larger units of meaning—like entire documents—powering use cases like retrieval-augmented generation (RAG), recommendation engines, and more.&lt;/p&gt;

&lt;p&gt;It should be pretty clear by now that vector embeddings are central not just to how generative AI works, but to a wide range of AI applications across industries.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Hidden Costs of High-Dimensional Data: Why Vector Compression is Crucial
&lt;/h2&gt;

&lt;p&gt;The problem is that vector embeddings take up space. And the faster and more accurate we want an AI system to be, the more vector embeddings it needs - and the more space to store them. But this isn't just a storage cost problem: the bigger embeddings are, the more bandwidth in the PCI bus and in the memory bus they use. It's also an issue for things like edge AI devices - edge devices don't have constant internet access, so their AI models need to run efficiently with the limited space they've got onboard.&lt;/p&gt;

&lt;p&gt;That's why it makes sense to look for ways to push compression even further - despite the fact that embeddings are already being compressed today. Squeezing even another 10% out of the footprint can mean real savings, and a much better user experience for IoT devices running generative AI.&lt;/p&gt;

&lt;p&gt;At Janea Systems, we saw this opportunity and built an advanced C++ library based on FAISS.&lt;/p&gt;

&lt;p&gt;FAISS—short for Facebook AI Similarity Search—is Meta’s open-source library for fast vector similarity search, offering an 8.5x speedup over earlier solutions. Our library takes it further by optimizing the storage and retrieval of large-scale vector embeddings in FAISS—cutting storage costs and boosting AI performance on IoT and edge devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Industry Standard: A Look at Product Quantization (PQ)
&lt;/h2&gt;

&lt;p&gt;Vector embeddings are stored in a specialized data structure called a vector index. The index lets AI systems quickly find and retrieve the closest vectors to any input (e.g. user questions) and match it with accurate output.&lt;/p&gt;

&lt;p&gt;A major constraint for vector indexes is space. The more vectors you store—and the higher their dimensionality—the more memory or disk you need. This isn’t just a storage problem; it affects whether the index fits in RAM, whether queries run fast, and whether the system can operate on edge devices.&lt;/p&gt;

&lt;p&gt;Then there’s the question of accuracy. If you store vectors without compression, you get the most accurate results possible. But the process is slow, resource-intensive, and often impractical at scale. The alternative is to apply compression, which saves space and speeds things up, but sacrifices accuracy.&lt;/p&gt;

&lt;p&gt;The most common way to manage this trade-off is a method called Product Quantization (PQ) (Fig. 1).&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.amazonaws.com%2Fuploads%2Farticles%2Fhnx6y49adn6d8sm57v1q.webp" 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.amazonaws.com%2Fuploads%2Farticles%2Fhnx6y49adn6d8sm57v1q.webp" alt="Diagram showing how an embedding is split into subspaces, each mapped to codebooks, and converted into a quantized vector using centroid indices." width="800" height="419"&gt;&lt;/a&gt;&lt;br&gt;
Fig. 1: PQ’s uniform compression across subspaces&lt;/p&gt;

&lt;p&gt;PQ works by splitting each vector into equal-sized subspaces. It’s efficient, hardware-friendly, and the standard in vector search systems like FAISS.&lt;/p&gt;

&lt;p&gt;But because each subspace in PQ is equal, it’s like compressing every video frame in the same way and to the same size—whether it’s entirely black or full of detail. This approach keeps things simple and efficient but misses the opportunity to increase compression on a case-by-case basis.&lt;/p&gt;

&lt;p&gt;At Janea, we realized that vector dimensions vary in value—much like video frames vary in resolution and detail. This means we can adjust the aggressiveness of compression (or, more precisely, quantization) based on how relevant each dimension is, without affecting overall accuracy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution: JECQ - Intelligent, Dimension-Aware Compression for FAISS
&lt;/h2&gt;

&lt;p&gt;To strike the right balance between memory efficiency and accuracy, engineers at Janea Systems have developed JECQ, a novel, open-source compression algorithm available on GitHub that varies compression by the statistical relevance of each dimension.&lt;/p&gt;

&lt;p&gt;In this approach, the distances between quantized values become irregular, reflecting each dimension's complexity.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does JECQ work?
&lt;/h2&gt;

&lt;p&gt;The algorithm starts by determining the isotropy of each dimension based on the eigenvalues of the covariance matrix. In the future, the analysis will also cover sparsity and information density. &lt;br&gt;
The algorithm then classifies each dimension into one of three categories: low relevance, medium relevance, and high relevance. &lt;br&gt;
Dimensions with low relevance are discarded, with very little loss in accuracy.&lt;/p&gt;

&lt;p&gt;Medium-relevance dimensions are quantized using just one bit, again with minimal impact on accuracy.&lt;br&gt;
High-relevance dimensions undergo the standard product quantization.&lt;br&gt;
Compressed vectors are stored in a custom, compact format accessible via a lightweight API.&lt;/p&gt;

&lt;p&gt;The solution is compatible with existing vector databases and ANN frameworks, including FAISS.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the benefits and best use cases for JECQ?
&lt;/h2&gt;

&lt;p&gt;Early tests show memory footprint reduced by 6x, keeping 84.6% accuracy compared to non-compressed vector candidates. Figure 2 compares the memory footprint of an index before quantization, with product quantization (PQ), and with JECQ. &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.amazonaws.com%2Fuploads%2Farticles%2F0t1hkdu76inhu2t14q61.webp" 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.amazonaws.com%2Fuploads%2Farticles%2F0t1hkdu76inhu2t14q61.webp" alt="Bar chart comparing memory usage: No Quantization (highest), PQ (lower), and JECQ (lowest), with the title " width="800" height="419"&gt;&lt;/a&gt;&lt;br&gt;
Fig. 2: Memory footprint before quantization, with PQ, and with JECQ&lt;/p&gt;

&lt;p&gt;We expect this will lower cloud and on-prem storage costs for enterprise AI search, enhance Edge AI performance by fitting more embeddings per device for RAG or semantic search, and reduce the storage footprint of historical embeddings.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are JECQ’s License and Features?
&lt;/h2&gt;

&lt;p&gt;JECQ is out on &lt;a href="https://github.com/JaneaSystems/jecq" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, available under the MIT license. It ships with an optimizer that takes a representative data sample or user-provided data and generates an optimized parameter set. Users can then fine-tune this by adjusting the objective function to balance their preferred accuracy–performance trade-off.&lt;/p&gt;




&lt;p&gt;We're planning to share more tools, experiments, and lessons learned from our work in open-source, AI infrastructure, and performance engineering. If this kind of stuff interests you, stay tuned — more to come soon.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>ai</category>
      <category>vectordatabase</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>(Beyond) The Art of Database Indexing</title>
      <dc:creator>Benedetto Proietti</dc:creator>
      <pubDate>Thu, 03 Apr 2025 16:10:36 +0000</pubDate>
      <link>https://dev.to/benedetto_proietti/beyond-the-art-of-database-indexing-5fd7</link>
      <guid>https://dev.to/benedetto_proietti/beyond-the-art-of-database-indexing-5fd7</guid>
      <description>&lt;p&gt;&lt;em&gt;and Why Indexes Alone Won’t Save You&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Executive Summary
&lt;/h1&gt;

&lt;p&gt;Modern databases handle vast amounts of data — often spanning tens of terabytes or even petabytes — and relying solely on indexing is insufficient for optimal performance. Misunderstanding this can lead to degraded performance, increased operational costs, and poor user experience. This article highlights why indexing alone isn’t the solution and provides practical alternatives and strategies for scalable, efficient data management.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Indexes Alone Are Insufficient
&lt;/h1&gt;

&lt;p&gt;Indexes improve read performance but introduce overhead during writes, slowing transactional operations. Businesses frequently face performance degradation due to excessive indexing, resulting in increased operational costs and diminished customer satisfaction.&lt;/p&gt;

&lt;h1&gt;
  
  
  Technical Basics
&lt;/h1&gt;

&lt;p&gt;Data resides in three main storage systems, each with distinct performance characteristics:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RAM (volatile memory)&lt;/strong&gt;: Extremely fast, ideal for real-time data processing.&lt;br&gt;
&lt;strong&gt;NVMe Drives/SSDs&lt;/strong&gt;: Faster, persistent storage with moderate costs.&lt;br&gt;
&lt;strong&gt;Rotating hard drives&lt;/strong&gt;: Cost-effective but significantly slower.&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.amazonaws.com%2Fuploads%2Farticles%2Fn8kjjhwmn634cifeqb2z.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.amazonaws.com%2Fuploads%2Farticles%2Fn8kjjhwmn634cifeqb2z.png" alt=" " width="640" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The efficiency of your software solution (SQL, NoSQL, or caching systems) significantly depends on your choice of storage and how effectively the software manages data contention.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  When Indexing Hurts More Than It Helps
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;High-write Workloads&lt;/strong&gt;: Frequent data updates make indexing costly and inefficient.&lt;br&gt;
&lt;strong&gt;Analytics Queries&lt;/strong&gt;: Full-table scans on specialized storage can be more efficient than indexed lookups.&lt;br&gt;
&lt;strong&gt;Complex Joins and Aggregations&lt;/strong&gt;: Excessive indexing increases complexity and resource use, potentially harming performance.&lt;/p&gt;

&lt;h1&gt;
  
  
  Strategic Alternatives to Optimize Performance
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1️⃣ Separate Analytics from OLTP Systems
&lt;/h2&gt;

&lt;p&gt;Operational (OLTP) and analytical workloads should never compete for resources within the same database. Operational queries demand instant responses, while analytics queries, analyzing large historical data sets, consume extensive resources.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Actionable Step&lt;/strong&gt;: Evaluate your database architecture to segregate operational databases from analytical workloads.&lt;/p&gt;
&lt;/blockquote&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.amazonaws.com%2Fuploads%2Farticles%2Fadwfhb2w2ofkr5wbo1ff.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.amazonaws.com%2Fuploads%2Farticles%2Fadwfhb2w2ofkr5wbo1ff.png" alt=" " width="640" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2️⃣ Separate Read and Write Operations
&lt;/h2&gt;

&lt;p&gt;Using database read replicas improves scalability and resource efficiency by minimizing bottlenecks. However, it can introduce slight latency or data staleness.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Actionable Step&lt;/strong&gt;: Consider implementing read replicas to reduce load on your primary database, but assess potential data staleness impacts.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Possible Challenge!&lt;/strong&gt; Creating replicas introduces latencies to allow writes to replicate. Or some staleness in the data. Which can be ok in most (not all) scenarios. Choose wisely!&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.amazonaws.com%2Fuploads%2Farticles%2Fnnpybp8jsh77xfj69fo0.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.amazonaws.com%2Fuploads%2Farticles%2Fnnpybp8jsh77xfj69fo0.png" alt=" " width="640" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3️⃣ Implement Caching with Redis, Valkey, or Memurai
&lt;/h2&gt;

&lt;p&gt;Caching frequently accessed data significantly enhances application responsiveness by reducing database queries. This results in lower latency, reduced database loads, and improved scalability. The first cache that found tremendous popularity was Redis (for Linux). Then its unwise licensing choices lead the recent groth of Valkey, a fully open-source alternative to Redis. For Windows, there’s Memurai: a fully supported and enterprise-ready partner of Redis.&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.amazonaws.com%2Fuploads%2Farticles%2F361uqjwpezb51axf8wf6.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.amazonaws.com%2Fuploads%2Farticles%2F361uqjwpezb51axf8wf6.png" alt="Popular caches summary" width="640" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Actionable Step&lt;/strong&gt;: Consider adding code (for Reads) that access cache first, and only on a cache-miss access the DB.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  4️⃣ Shard Data to Distribute Load
&lt;/h2&gt;

&lt;p&gt;Sharding partitions data across multiple databases, distributing load and preventing bottlenecks. While traditional databases (RDBMS) require manual sharding efforts, solutions like Valkey offer built-in sharding capabilities, simplifying scaling.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Actionable Step&lt;/strong&gt;: Consider sharding if your current database struggles with heavy loads or data volumes exceeding manageable thresholds.&lt;/p&gt;
&lt;/blockquote&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.amazonaws.com%2Fuploads%2Farticles%2F3s2z5pvk4fuv7dtr6jrt.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.amazonaws.com%2Fuploads%2Farticles%2F3s2z5pvk4fuv7dtr6jrt.png" alt=" " width="640" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6️⃣ Leverage Data Lakes for Historical Data
&lt;/h2&gt;

&lt;p&gt;Storing historical data in data lakes optimizes analytics, lowers storage costs, and maintains regulatory compliance without taxing operational databases.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Actionable Step&lt;/strong&gt;: Implement clear data-retention policies and regularly move older, less frequently accessed data to data lakes to enhance database performance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  7️⃣ Summary
&lt;/h2&gt;

&lt;p&gt;Providing generic advice is inherently challenging. Please consider the recommendations in this table as guidelines rather than absolute rules.&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.amazonaws.com%2Fuploads%2Farticles%2Fn9xp6vm7x9ra0kfip99t.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.amazonaws.com%2Fuploads%2Farticles%2Fn9xp6vm7x9ra0kfip99t.png" alt=" " width="640" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Indexes alone cannot support modern database demands at large scale. Strategic decisions regarding database infrastructure directly influence your organization’s agility, costs, customer satisfaction, and competitive positioning. Making informed choices now prevents costly performance degradation later.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Are you dealing with SQL scalability headaches?&lt;br&gt;
If your data is growing and you’re unsure how to scale without breaking the bank, let’s talk. I help teams with architecture and modernization strategies — reach out if you need a second opinion.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;PS: Check out my informal podcast “&lt;a href="https://www.youtube.com/@proiex" rel="noopener noreferrer"&gt;PROIEX — Tech Experiences&lt;/a&gt;”!&lt;/p&gt;

</description>
      <category>schema</category>
      <category>nosql</category>
      <category>sql</category>
      <category>bigdata</category>
    </item>
    <item>
      <title>Desire for Structure (read “SQL”)</title>
      <dc:creator>Benedetto Proietti</dc:creator>
      <pubDate>Thu, 03 Apr 2025 14:58:58 +0000</pubDate>
      <link>https://dev.to/benedetto_proietti/desire-for-structure-read-sql-ofh</link>
      <guid>https://dev.to/benedetto_proietti/desire-for-structure-read-sql-ofh</guid>
      <description>&lt;p&gt;&lt;em&gt;Or obsession for control?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let’s admit it: we love the idea of running SQL queries on ALL our data! Not just a preference — it feels like an obsession. No matter how old or how rarely accessed, we cling to the idea that everything must remain instantly queryable.&lt;/p&gt;

&lt;p&gt;It feels so simple, until it’s not. And then bad things happen:&lt;/p&gt;

&lt;p&gt;The database grows too large, and queries slow down to death.&lt;br&gt;
Indexes sizes explode, eating up CPU and memory just to keep up.&lt;br&gt;
Schema changes become a nightmare, locking tables and causing downtime.&lt;br&gt;
The cost of scaling up SQL infrastructure skyrockets.&lt;br&gt;
Suddenly, our beautiful, structured world starts crumbling under its own weight. What seemed like an easy decision — “let’s just store everything in SQL” — becomes a scaling bottleneck that forces us to rethink our approach.&lt;/p&gt;

&lt;h3&gt;
  
  
  But why does this happen?
&lt;/h3&gt;

&lt;p&gt;Relational Databases are powerful because they provide structure, indexing, and queryability — elements that make it easy for users to analyze and manipulate data.&lt;/p&gt;

&lt;p&gt;For engineers, analysts, and business users, SQL offers:&lt;/p&gt;

&lt;p&gt;A universal way to query data — The language is standardized and widely understood.&lt;br&gt;
Ad-hoc queryability — You can ask complex questions without predefining reports.&lt;br&gt;
Data consistency — Enforced schemas and constraints prevent data corruption.&lt;br&gt;
Indexing for performance — The ability to speed up searches through optimized indexes.&lt;br&gt;
Because of these benefits, many organizations enforce SQL as the default, even when other approaches may be more suitable.&lt;/p&gt;

&lt;p&gt;But what happens when this need for structure becomes a liability rather than an asset?&lt;/p&gt;

&lt;p&gt;We will look a bit into the problem space, and then we will explore (not exhaustively!) the solution space.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. The Problem space: When Structure Becomes a Limitation
&lt;/h1&gt;

&lt;h2&gt;
  
  
  2.1. The cost of our need for Structure
&lt;/h2&gt;

&lt;p&gt;While SQL provides clarity, it also introduces constraints. Let’s look at the most important ones.&lt;/p&gt;

&lt;h3&gt;
  
  
  Schema
&lt;/h3&gt;

&lt;p&gt;A schema demands data to be organized in a set of tables. And for each table it needs a set of columns (names and types) and primary key column. You can also introduce relationships between tables, but we are not going to talk about that here (that’s why, incidentally, they are called “relational databases”).&lt;/p&gt;

&lt;p&gt;Schema changes are delicate operations. They must be deployed before application changes to ensure compatibility. But even when done correctly, they introduce risks — what if your production data has unexpected edge cases your test environment didn’t? What if rollback becomes a nightmare?&lt;/p&gt;

&lt;p&gt;Oh wait! Do we push the DB schema changes first, or the application changes first? schema changes first of course! Then just pray that the application you are pushing has the exact same schema. Yes you tested in the test environment… which is always perfectly identical to the production environment… right?&lt;/p&gt;

&lt;p&gt;Well… not always.&lt;/p&gt;

&lt;h3&gt;
  
  
  Indices
&lt;/h3&gt;

&lt;p&gt;A dear friend of mine and accomplished engineer used to say that “writing Databases is the art of writing indices”.&lt;/p&gt;

&lt;p&gt;What is an index? An index is a type of data structure that helps finding the data when you do a search.&lt;/p&gt;

&lt;p&gt;You put the data into a table as it comes. Now you want to search for all the orders for Mr Smith. If you indexed the LastName column…. The index has an acceleration data structure (probably a kind of tree) where it quickly can find all the rows where the last name is equal to “Smith”.&lt;/p&gt;

&lt;p&gt;Nice right? Yah.&lt;/p&gt;

&lt;p&gt;You know what it takes? Let’s try to list of what it takes:&lt;/p&gt;

&lt;p&gt;· Fast memory (RAM) where to keep the fast data structure.&lt;/p&gt;

&lt;p&gt;· Time: it needs to lock the index while it is searching it, so that mutations on the index do not make it crash. Yes these locks can be avoided or reduced most of the times but… you get the gist. Let’s stop it here for now.&lt;/p&gt;

&lt;p&gt;Now what happens if you need more data?&lt;/p&gt;

&lt;p&gt;You need more memory? Sure but there’s a limit to physical memory on a single machine.&lt;/p&gt;

&lt;p&gt;Let’s go distributed, let’s use a cluster. Now I ask you to do the mental exercise to imagine how to lock a distributed index data structure across a cluster of 4 nodes. Well… difficult but possible.&lt;/p&gt;

&lt;p&gt;But what if your data is really, REALLY huge? You might need 400 nodes. Or 4,000. Or 40,000. It’s impossible. Why?&lt;/p&gt;

&lt;p&gt;Because indexes improve query speed — but they also introduce contention. Updating an index requires locking portions of it, slowing down concurrent writes. In a single-node setup, this is manageable. But in a distributed database spanning hundreds of nodes, keeping indexes in sync becomes a nightmare. This is why most distributed databases avoid global indexes or use eventually consistent indexing approaches. Without careful design, a single overloaded index update can throttle an entire system, creating cascading slowdowns.&lt;/p&gt;

&lt;p&gt;And probably spending so much time and engineering effort in calibrating indexes does not align with your core business.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusions so far
&lt;/h3&gt;

&lt;p&gt;That’s why you need to give up and think about other ways of storing your data.&lt;/p&gt;

&lt;p&gt;The first place you store the data “in general” should not go into a relational SQL database (RDBMs if we want to use a formal language). That might not be the case for specific cases, for example where credit cards or money is involved.&lt;/p&gt;

&lt;p&gt;If you are convinced about that, please continue reading. Otherwise please stop reading. There is no value for you to continue.&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Exploring the solution space
&lt;/h1&gt;

&lt;h2&gt;
  
  
  3.1. Hot/Cold
&lt;/h2&gt;

&lt;p&gt;First of all, not all data needs to be hot. Or indexed.&lt;/p&gt;

&lt;p&gt;In most of the use cases queries need last week’s data, or last month’s data. Why then are you keeping 3 years’ worth of data in expensive indexed RDBMs?&lt;/p&gt;

&lt;p&gt;1 week out of 3 years is less than one percent of the entire data! (0.6% to be precise).&lt;br&gt;
1 month out of 3 years is about 2.5% of the entire data.&lt;/p&gt;

&lt;p&gt;Maybe, it makes sense to place “hot” data in a fast (and costly) database (or even a cache), and the cold data in a cheaper (and slower) data storage. It will cost a bit in terms of latency to access such data but… you will save a ton on money.&lt;/p&gt;

&lt;p&gt;So why do companies still keep years of data in expensive RDBMS instances? Often, it’s habit — ‘we might need it someday’ — or a lack of proper data lifecycle planning. But in reality, only a fraction of the data needs to remain hot.&lt;/p&gt;

&lt;h3&gt;
  
  
  A real-world Example
&lt;/h3&gt;

&lt;p&gt;A real-world example of this concept is NYC Taxi ride data:&lt;/p&gt;

&lt;p&gt;· Total Dataset: ~1.1 billion rides per year (~550GB of storage).&lt;/p&gt;

&lt;p&gt;· Last 3 years of data: ~3.3 billion rides (~1.6 TB of storage).&lt;/p&gt;

&lt;p&gt;· Last Month’s Data: ~70 million rides (~35GB of storage).&lt;/p&gt;

&lt;p&gt;· Last Week’s Data: ~18 million rides (~9GB of storage).&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.amazonaws.com%2Fuploads%2Farticles%2Frhybj944jllf4djgmrgk.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.amazonaws.com%2Fuploads%2Farticles%2Frhybj944jllf4djgmrgk.png" alt=" " width="640" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3.2. Columns
&lt;/h2&gt;

&lt;p&gt;I have often seen relational databases with hundreds — sometimes even thousands — of columns, storing an incredible amount of data. Yet, most of these columns are rarely queried. They can’t be discarded because they hold valuable information, but they still come at a cost.&lt;/p&gt;

&lt;p&gt;Every column, whether used frequently or not, adds overhead in disk storage, CPU, and memory — even when it’s not indexed. And that brings us to another issue: we can’t index all hundreds of columns for obvious reasons. As a result, we end up in a paradoxical situation:&lt;/p&gt;

&lt;p&gt;We pay for an expensive and often slow relational database system.&lt;/p&gt;

&lt;p&gt;Yet, hundreds of columns remain unindexed, making queries inefficient.&lt;/p&gt;

&lt;p&gt;This raises an important question: Are we truly benefiting from keeping all columns “hot” and queryable, or are we just paying for an illusion of accessibility?&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Big Data: an introduction
&lt;/h1&gt;

&lt;p&gt;The term Big Data is thrown around a lot, but how big is “big”?&lt;/p&gt;

&lt;p&gt;Here’s my personal definition: Big Data is an amount of data that cannot fit in a small cluster — but it still needs to be queryable.&lt;/p&gt;

&lt;p&gt;A modern approach to Big Data consists of several components, and the key principle is separating compute from storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.1. Storage: The Data Lake
&lt;/h2&gt;

&lt;p&gt;Big Data is typically stored in a distributed object storage system, which I loosely call a Data Lake.&lt;/p&gt;

&lt;p&gt;Here’s my informal definition of a Data Lake:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Virtually infinite capacity — There is no practical storage limit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Massively parallel — It can handle many simultaneous operations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High throughput — Huge input/output bandwidth.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High latency — It is not optimized for low-latency access.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simple REST API — Accessible through standard cloud APIs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4.2. Compute: Processing Data from the Data Lake
&lt;/h2&gt;

&lt;p&gt;From the Data Lake, data branches into separate workflows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Analytics workloads → Data warehouses, batch processing, OLAP queries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Online applications → Real-time transactional workloads (OLTP), NoSQL solutions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But before going further, let me clarify something crucial:&lt;/p&gt;

&lt;h2&gt;
  
  
  4.3. Analytics &amp;amp; Online Processing Should Be Completely Separate
&lt;/h2&gt;

&lt;p&gt;They should not share the same datastore, cluster, or even availability zone.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Analytics deals with historical data — end-of-day sales reports, customer behavior insights, trend analysis, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Online processing serves live production workloads — API responses, real-time transactions, and user interactions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mixing the two is a huge risk. Allowing analytical queries to run on your live production system is an enterprise disaster waiting to happen. You risk:&lt;/p&gt;

&lt;p&gt;❌ Slow application performance — Customers may experience delays.&lt;/p&gt;

&lt;p&gt;❌ Production downtime — A heavy analytical query could lock tables or exhaust resources.&lt;/p&gt;

&lt;p&gt;❌ Jeopardizing business operations — A reporting query should never interfere with live transactions.&lt;/p&gt;

&lt;p&gt;🚨 DO NOT DO IT. Keep them separate.&lt;/p&gt;

&lt;p&gt;Besides, each requires different technologies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Online processing → Needs an RDBMS (SQL or NoSQL). These systems are designed for transactional speed and reliability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Analytics → Requires Big Data tools to efficiently process vast datasets.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4.4. Analytics Compute: Processing Big Data
&lt;/h2&gt;

&lt;p&gt;There are many ways to query and process Big Data. A full discussion would take an entire book, so here’s a short list of key technologies:&lt;/p&gt;

&lt;h3&gt;
  
  
  Spark
&lt;/h3&gt;

&lt;p&gt;✅ The de facto distributed compute engine for Big Data.&lt;/p&gt;

&lt;p&gt;✅ Has been around since 2014, gaining widespread adoption.&lt;/p&gt;

&lt;p&gt;✅ Processes petabytes of data with relative ease.&lt;/p&gt;

&lt;p&gt;⚠️ Not without its issues, but still one of the easiest ways to run large-scale distributed queries.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flink
&lt;/h3&gt;

&lt;p&gt;✅ A newer competitor to Spark, with fresher architecture.&lt;/p&gt;

&lt;p&gt;✅ Focuses on real-time and batch processing.&lt;/p&gt;

&lt;p&gt;⚠️ Similar trade-offs as Spark but gaining traction.&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS Athena
&lt;/h3&gt;

&lt;p&gt;✅ Serverless querying of S3 data.&lt;/p&gt;

&lt;p&gt;✅ Pay-as-you-go pricing (great for occasional queries).&lt;/p&gt;

&lt;p&gt;⚠️ Can become expensive at scale if queries are frequent.&lt;/p&gt;

&lt;h3&gt;
  
  
  ClickHouse
&lt;/h3&gt;

&lt;p&gt;✅ The cool new kid in town — Incredibly fast analytics.&lt;/p&gt;

&lt;p&gt;✅ Can store data internally or query data directly from S3.&lt;/p&gt;

&lt;p&gt;✅ Supports indexes, making queries much faster than traditional Data Lakes.&lt;/p&gt;

&lt;p&gt;✅ Available as fully managed or self-hosted.&lt;/p&gt;

&lt;p&gt;🔥 An excellent choice for high-performance analytics.&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS Redshift (or another DataWarehouse)
&lt;/h3&gt;

&lt;p&gt;This is a crossover scenario. Redshift is a semi-managed RDBMS but with beefy architecture, a columnar approach (why is columnar better? That’s a question for another article) a lot of cache and a cluster architecture that makes it super-fast.&lt;/p&gt;

&lt;p&gt;Redshift offers fast, scalable columnar storage, making it great for heavy analytical queries. But it comes at a cost — both financial and operational. While Redshift excels for structured reporting, it’s not ideal for ad-hoc exploratory analysis, where a more flexible solution like Athena or ClickHouse might be better.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.5. Final Thoughts on BigData
&lt;/h2&gt;

&lt;p&gt;Big Data requires rethinking storage and compute:&lt;/p&gt;

&lt;p&gt;· Store everything in a Data Lake (cheap, scalable storage).&lt;/p&gt;

&lt;p&gt;· Compute happens separately, using the right tool for the job.&lt;/p&gt;

&lt;p&gt;· Never mix analytics with production systems — that’s asking for trouble.&lt;/p&gt;

&lt;p&gt;Big Data isn’t about blindly throwing everything into SQL — it’s about choosing the right technologies for scale, cost, and performance.&lt;/p&gt;

&lt;p&gt;The diagram (source: AWS documentation) depicts a serverless “datalake centric” analytics architecture&lt;/p&gt;

&lt;h1&gt;
  
  
  5. Small Data: Flexibility &amp;amp; Fewer Constraints
&lt;/h1&gt;

&lt;p&gt;When dealing with small datasets, storage flexibility is far greater than in the Big Data world.&lt;/p&gt;

&lt;p&gt;Unlike Big Data, where storage and compute must be carefully architected, small data is forgiving.&lt;/p&gt;

&lt;p&gt;You don’t have to worry about distributed storage, multi-cluster orchestration, or separating compute from storage.&lt;/p&gt;

&lt;p&gt;Instead, you get to focus on what really matters: choosing the right tool for the job.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.1. Where Can You Store Small Data?
&lt;/h2&gt;

&lt;p&gt;With small datasets, you have many options:&lt;/p&gt;

&lt;p&gt;· SQL databases — Classic, structured, reliable. Perfect for transactional workloads.&lt;/p&gt;

&lt;p&gt;· NoSQL databases — Flexible, schema-free, and great for hierarchical or document-based data.&lt;/p&gt;

&lt;p&gt;· Flat files (CSV, JSON, Parquet) — Easy to use, easy to share. Works great for logs, configs, and lightweight processing.&lt;/p&gt;

&lt;p&gt;· In-memory databases (Redis, Memcached) — Blazing fast, ideal for caching and ephemeral data storage.&lt;/p&gt;

&lt;p&gt;· Embedded databases (SQLite, DuckDB) — Self-contained, no external dependencies, excellent for local processing.&lt;/p&gt;

&lt;p&gt;Each of these options has trade-offs, but the beauty of small data is that you don’t need a complex architecture.&lt;/p&gt;

&lt;p&gt;You pick what works and move forward — no need for extensive capacity planning or complex scaling strategies.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.2. The Cost vs. Performance Trade-Off
&lt;/h2&gt;

&lt;p&gt;With small data, performance and cost concerns are less critical compared to Big Data.&lt;/p&gt;

&lt;p&gt;· Scaling is rarely an issue — One machine, or a few, are usually enough.&lt;/p&gt;

&lt;p&gt;· Disk and memory overhead is minimal — A few gigabytes of data can fit comfortably on SSDs or even in memory.&lt;/p&gt;

&lt;p&gt;· Cold vs. hot data isn’t a problem — All data is small enough to be ‘hot’ by default.&lt;/p&gt;

&lt;p&gt;But there’s still an important question to ask:&lt;/p&gt;

&lt;h2&gt;
  
  
  5.3. Structure vs Flexibility
&lt;/h2&gt;

&lt;p&gt;With small datasets, the temptation is to throw everything into SQL, because it just works. But does it always make sense?&lt;/p&gt;

&lt;p&gt;· If your data is deeply hierarchical (e.g., JSON, XML), would a document store be a better fit?&lt;/p&gt;

&lt;p&gt;· If your access patterns are key-value based, why not use an in-memory store like Redis?&lt;/p&gt;

&lt;p&gt;· If your data is static, would a simple CSV or JSON file suffice instead of a full-blown database?&lt;/p&gt;

&lt;p&gt;SQL forces structure, which is great when you need consistency, transactions, and relational integrity.&lt;/p&gt;

&lt;p&gt;But flexibility is often more important when dealing with small, isolated datasets that don’t require complex relationships.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.4. Over-engineering
&lt;/h2&gt;

&lt;p&gt;I’ve seen teams deploy Kafka clusters to process just a few thousand messages per day — a classic case of overengineering. Sometimes, a simple cron job writing to an SQLite database does the job just fine.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.5. Final Thoughts
&lt;/h2&gt;

&lt;p&gt;With Big Data, you need careful storage and compute separation just to make the system work.&lt;/p&gt;

&lt;p&gt;With small data, you don’t. You have options, and you should take advantage of them.&lt;/p&gt;

&lt;p&gt;· Don’t default to SQL just because it’s familiar.&lt;/p&gt;

&lt;p&gt;· Think about your access patterns first.&lt;/p&gt;

&lt;p&gt;· Pick the simplest tool that solves the problem.&lt;/p&gt;

&lt;p&gt;After all, flexibility is the true advantage of small data. 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  5.6. Big or Small Data
&lt;/h2&gt;

&lt;p&gt;Many workloads labeled as ‘Big Data’ are simply poorly optimized small data.&lt;br&gt;
The industry loves the term, but not all “Big Data problems” are truly big. Sometimes, what appears to be a scaling issue is just a lack of proper indexing, partitioning, or query optimization.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If your system struggles to process a few terabytes of structured data, you might not need Hadoop or Spark — you may just need better schema design and indexing.&lt;/li&gt;
&lt;li&gt;If your pipeline relies on daily batch jobs to process logs, a simpler event-driven system with proper aggregation could be more efficient than a full-blown Big Data stack.
Before reaching for complex distributed computing tools, ask:
Do I have a Big Data problem, or do I have a poorly optimized Small Data problem?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5.7. Conclusion
&lt;/h2&gt;

&lt;p&gt;SQL databases are a great tool — but not the only tool. The human desire for structure often leads us to over-rely on relational databases, even when they introduce inefficiencies.&lt;/p&gt;

&lt;p&gt;The best architecture balances structure with flexibility. Before defaulting to SQL, ask yourself:&lt;/p&gt;

&lt;p&gt;Does all this data need to be hot and indexed?&lt;br&gt;
Is SQL the right tool, or am I forcing structure where it’s not needed?&lt;br&gt;
Can I reduce costs and improve performance with a better data lifecycle strategy?&lt;br&gt;
Are you dealing with SQL scalability headaches?&lt;br&gt;
If your data is growing and you’re unsure how to scale without breaking the bank, let’s talk. I help teams with architecture and modernization strategies — reach out if you need a second opinion.&lt;/p&gt;

&lt;p&gt;PS: Feel free to also visit my informal podcast “&lt;a href="https://www.youtube.com/@proiex" rel="noopener noreferrer"&gt;PROIEX — Tech Experiences&lt;/a&gt;”.&lt;/p&gt;

</description>
      <category>schema</category>
      <category>nosql</category>
      <category>sql</category>
      <category>bigdata</category>
    </item>
  </channel>
</rss>
