DEV Community

Cover image for Fuzzy-match 1M rows in under 10 minutes (2026 Edition)
Siyana Hristova
Siyana Hristova

Posted on • Originally published at similarity-api.com

Fuzzy-match 1M rows in under 10 minutes (2026 Edition)

Duplicate records are easy to ignore until they're everywhere.

Whether it's three versions of "Acme, Inc." in your CRM, a messy lead import, or a post-merger database reconciliation, fuzzy matching is the only way to find records that refer to the same entity when exact string matches fail.


The Scaling Wall: Why DIY Fails

Fuzzy matching sounds simple on a 1,000-row sample. But at scale, the math changes. A naive all-to-all comparison scales at $O(N^2)$. Once you hit 100k+ rows, the comparison space explodes, and your local script or SQL workflow will grind to a halt.

I spent a long time trying to build these pipelines myself. Most of us start with a simple Python script and end up building a monster. You quickly find yourself manually managing:

  • Infrastructure: Blocking, indexing, and parallelization.
  • Tuning: Endless threshold tweaking and "brittle" regex cleanup.
  • Maintenance: Keeping custom pipelines alive as your data volume grows.

The result? Your "simple task" turns into a permanent engineering tax.


The Technical Edge: Adaptive Preprocessing

The hardest part of fuzzy matching isn't just the comparison—it's the cleaning. Similarity API uses an internal engine that adapts its strategy depending on the input size and noise level.

Unlike local libraries that force you to write your own cleanup code, this engine:

  • Adapts to Dataset Structure: Automatically adjusts normalization strategies based on string length and density.
  • Optimized for Scale: Preprocessing is baked into the matching pipeline, ensuring that even at 1M+ rows, the "cleanup" phase doesn't become a bottleneck.
  • Configuration over Code: You don't write cleaning scripts; you toggle parameters like token_sort or remove_punctuation.

The Solution: A Production-Ready Infrastructure

After testing various approaches, I started leaning into Similarity API for my own professional workflows. It is a hosted, paid infrastructure service designed for high-performance deduplication.

The Value Prop: You aren't just buying speed; you're buying a production-ready component. By offloading matching to a dedicated API, you move the complexity out of your codebase and into a scalable, managed environment.

đź’° Note: Professional Infrastructure

This is not a free, community-maintained library. Similarity API is a commercial service. You will need to sign up for an API key, and it operates on a usage-based pricing model. Because it's a paid service, you get guaranteed uptime and dedicated support. If you are building tools for your company, offloading this to a paid service is a small price to pay to avoid the "engineering tax" of maintaining custom matching code.


Integration: Build Once, Automate Forever

While the example below runs easily in a notebook for prototyping, the real power is embedding this into repeatable production workflows.

For smaller datasets, the direct API call is the fastest route. However, if your dataset exceeds 10MB, you should use our specialized File Upload endpoint, which is designed to handle larger batches efficiently.

Because it is a standard REST API, you can integrate it into any environment that supports HTTP requests:

  • Code-First: Airflow, Prefect, GitHub Actions, or Python/Node.js backend services.
  • No-Code/Low-Code: n8n, Zapier, Make.com, or Retool.
  • Enterprise: Databricks, Snowflake, or AWS Lambda jobs.
import requests
import pandas as pd

# Professional-grade matching requires a paid API key
API_KEY = "YOUR_PRODUCTION_KEY"
API_URL = "https://api.similarity-api.com/dedupe"

# Load your production dataset
df = pd.read_csv("large_dataset.csv")
strings = df["company_name"].dropna().astype(str).tolist()

# Define your configuration
payload = {
    "data": strings,
    "config": {
        "similarity_threshold": 0.85,
        "remove_punctuation": True,
        "to_lowercase": True,
        "use_token_sort": True,
        "output_format": "index_pairs",
    },
}

# The API handles the orchestration and scaling automatically
response = requests.post(API_URL,
                         headers={"Authorization": f"Bearer {API_KEY}"},
                         json=payload,
                         timeout=3600)

results = response.json().get("response_data", [])
print(f"Workflow Complete: Found {len(results):,} duplicates.")
Enter fullscreen mode Exit fullscreen mode

⏱️ The Honest "10-Minute" Claim

I claim you can dedupe 1M rows in under 10 minutes. Here is the math:

  • 7 Minutes: The time the engine actually takes to crunch through 1,000,000 rows (based on my public benchmarks).
  • 3 Minutes: The time it takes for you to copy the code above, paste it into Colab, and grab a coffee while it runs.

If you're faster at copy-pasting, you might even finish in 8.

Want to prove it yourself? Don't take my word for it. I keep the methodology transparent—because when you pay for infrastructure, you should know exactly what you're getting.


Final Word

When data gets large, the hard part isn't the similarity function - it's the infrastructure. Similarity API is a service for teams that value engineering time over building custom deduplication scripts. It allows you to skip the pipeline work and get straight to the results: reviewing, merging, and acting on clean data.

Explore full API docs on https://similarity-api.com/documentation

Top comments (0)