Discover how Bright Data optimize its Web Archive to handle petabytes of data in AWS. Learn how a $100,000 billing mistake revealed the trade-off between write speed, read speed, and cloud costs—and how we fixed it with a cost-effective Rearrange Pipeline. Spoiler: We are hiring!Discover how Bright Data optimize its Web Archive to handle petabytes of data in AWS. Learn how a $100,000 billing mistake revealed the trade-off between write speed, read speed, and cloud costs—and how we fixed it with a cost-effective Rearrange Pipeline. Spoiler: We are hiring!

Building a Petabyte-Scale Web Archive

2025/12/09 21:07

In an engineer’s ideal world, architecture is always beautiful. In the real world of high-scale systems, you have to make compromises. One of the fundamental problems an engineer must think about at the start is the vicious trade-off between Write Speed and Read Speed.

Usually, you sacrifice one for the other. But in our case, working with petabytes of data in AWS, this compromise didn’t hit our speed–it hit the wallet.

We built a system that wrote data perfectly, but every time it read from the archive, it burned through the budget in the most painful way imaginable. After all, reading petabytes from AWS costs money for data transfer, request counts, and storage class retrievals… A lot of money!

This is the story of how we optimized it to make it more efficient and cost-effective!

Part 0: How We Ended Up Spending $100,000 in AWS Fees!

True story: a few months back, one of our solution architects wanted to pull a sample export from a rare, low-traffic website to demonstrate the product to a potential client. Due to a bug in the API, the safety limit on file count wasn’t applied.

Because the data for this “rare” site was scattered across millions of archives alongside high-traffic sites, the system tried to restore nearly half of our entire historical storage to find those few pages.

That honest mistake ended up costing us nearly $100,000 in AWS fees!

Now, I fixed the API bug immediately (and added strict limits), but the architectural vulnerability remained. It was a ticking time bomb…

Let me tell you the story of the Bright Data Web Archive architecture: how I drove the system into the trap of “cheap” storage and how I climbed out using a Rearrange Pipeline.

Part 1: The “Write-First” Legacy

When I started working on the Web Archive, the system was already ingesting a massive data stream: millions of requests per minute, tens of terabytes per day. The foundational architecture was built with a primary goal: capture everything without data loss.

It relied on the most durable strategy for high-throughput systems: Append-only Log.

  1. Data (HTML, JSON) is buffered.
  2. Once the buffer hits ~300 MB, it is “sealed” into a TAR archive.
  3. The archive flies off to S3.
  4. After 3 days, files move to S3 Glacier Deep Archive.

For the ingestion phase, this design was flawless. Storing data in Deep Archive costs pennies, and the write throughput is virtually unlimited.

The Problem: That Pricing Nuance

The architecture worked perfectly for writing… until clients came asking for historical data. That’s when I faced a fundamental contradiction:

  • The System Writes by Time: An archive from 12:00 PM contains a mix of cnn.comgoogle.com, and shop.xyz.
  • The System Reads by Domain: The client asks: “Give me all pages from cnn.com for the last year.”

Here lies the mistake that inspired this article. Like many engineers, I’m used to thinking about latency, IOPS, and throughput. But I overlooked the AWS Glacier billing model.

I thought: “Well, retrieving a few thousand archives is slow (48 hours), but it’s not that expensive.”

The Reality: AWS charges not just for the API call, but for the volume of data restored ($ per GB retrieved).

The “Golden Byte” Effect

Imagine a client requests 1,000 pages from a single domain. Because the writing logic was chronological, these pages can be spread across 1,000 different TAR archives.

To give the client these 50 MB of useful data, a disaster occurs:

  1. The system has to trigger a Restore for 1,000 archives.
  2. It lifts 300 GB of data out of the “freezer” (1,000 archives × 300 MB).
  3. AWS bills us for restoring 300 GB.
  4. I extract the 50 MB required and throw away the other 299.95 GB 🤯.

We were paying to restore terabytes of trash just to extract grains of gold. It was a classic Data Locality problem that turned into a financial black hole.

Part 2: Fixing the Mistake: The Rearrange Pipeline

I couldn’t quickly change the ingestion method–the incoming stream is too parallel and massive to sort “on the fly” (though I am working on that), and I needed a solution that worked for already archived data, too.

So, I designed the Rearrange Pipeline, a background process that “defragments” the archive.

This is an asynchronous ETL (Extract, Transform, Load) process, with several critical core components:

  1. Selection: It makes no sense to sort data that clients aren’t asking for. Thus, I direct all new data into the pipeline, as well as data that clients have specifically asked to restore. We overpay for the retrieval the first time, but it never happens a second time.

    \

  2. Shuffling (Grouping): Multiple workers download unsorted files in parallel and organize buffers by domain. Since the system is asynchronous, I don’t worry about the incoming stream overloading memory. The workers handle the load at their own pace.

    \

  3. Rewriting: I write the sorted files back to S3 under a new prefix (to distinguish sorted files from raw ones).

  • Before: 2024/05/05/random_id_ts.tar → [cnn, google, zara, cnn]
  • After: 2024/05/05/cnn/random_id_ts.tar → [cnn, cnn, cnn...]
  1. Metadata Swap: In Snowflake, the metadata table is append-only. Doing MERGE INTO or UPDATE is prohibitively expensive.
  • The Solution: I found it was far more efficient to take all records for a specific day, write them to a separate table using a JOIN, delete the original day’s records, and insert the entire day back with the modified records. I managed to process 300+ days and 160+ billion UPDATE operations in just a few hours on a 4X-Large Snowflake warehouse.

The Result

This change radically altered the product’s economics:

  • Pinpoint Accuracy: Now, when a client asks for cnn.com, the system restores only the data where cnn.com lives.
  • Efficiency: Depending on the granularity of the request (entire domain vs. specific URLs via regex), I achieved a 10% to 80% reduction in “garbage data” retrieval (which is directly proportional to the cost).
  • New Capabilities: Beyond just saving money on dumps, this unlocked entirely new business use cases. Because retrieving historical data is no longer agonizingly expensive, we can now afford to extract massive datasets for training AI models, conducting long-term market research, and building knowledge bases for agentic AI systems to reason over (think specialized search engines). What was previously a financial suicide mission is now a standard operation.

We Are Hiring

Bright Data is scaling the Web Archive even further. If you enjoy:

  • High‑throughput distributed systems,
  • Data engineering at massive scale,
  • Building reliable pipelines under real‑world load,
  • Pushing Node.js to its absolute limits,
  • Solving problems that don’t appear in textbooks…

Then I’d love to talk.

We’re hiring strong Node.js engineers to help build the next generation of the Web Archive. Having data engineering and ETL experience is highly advantageous. Feel free to send your CV to vadimr@brightdata.com.

More updates coming as I continue scaling the archive—and as I keep finding new and creative ways to break it!

\

Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact service@support.mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

Solana Price Stalls as Validator and Address Counts Collapse

Solana Price Stalls as Validator and Address Counts Collapse

The post Solana Price Stalls as Validator and Address Counts Collapse  appeared on BitcoinEthereumNews.com. Since mid-November, the Solana price has been resonating within a narrow consolidation of $145 and $125. Solana’s validator count collapsed from 2,500 to ~800 over two years, raising questions about economic sustainability. The number of active addresses on the Solana network recorded a sharp decline from 9.08 million in January 2025 to 3.75 million now, indicating a drop in user participation. On Tuesday, the crypto market witnessed a notable spike in buying pressure, leading major assets like Bitcoin, Ethereum, and Solana to a fresh recovery. However, the Solana price faced renewed selling at $145, evidenced by a long-wick rejection in the daily candle. The headwinds can be linked to networks facing scrutiny following a notable decline in active validators and active addresses.  Validator Exodus Exposes Economic Pressure on Solana Operators The layer-1 blockchain Solana has witnessed a sharp decline in the number of its validators from 2,500 in early 2023 to around 800 in late 2025, according to Solanacompass data. The collapse has caused an ecosystem divide between opposing camps. One side lauds the trend, arguing that the exodus comprises nearly exclusively unreal identities and poor-quality nodes that were gaming rewards without providing real hardware and uptime. In their view, narrowing the list down to a smaller number of committed validators strengthened the network rather than cooled it down. Infrastructure providers that work directly with node operators have a different story to tell. Teams like Layer 33, which is a collective of 25 independent Solana validators, say, “We personally know the teams shutting down. It is not mostly Sybils.” These operators cited increasing server costs, thin staking yields because of commission cuts, and increasing complexity of keeping nodes profitable as reasons for shutting down. Both sides agree on one thing: raw validator numbers don’t tell us much in and of…
Share
BitcoinEthereumNews2025/12/10 12:05
Surges to $94K One Day Ahead of Expected Fed Rate Cut

Surges to $94K One Day Ahead of Expected Fed Rate Cut

The post Surges to $94K One Day Ahead of Expected Fed Rate Cut appeared on BitcoinEthereumNews.com. What started as a slow U.S. morning on crypto markets has taken a quick turn, with bitcoin BTC$92,531.15 re-taking the $94,000 level. Hovering just above $90,000 earlier in the day, the largest crypto surged back to $94,000 minutes after 16:00 UTC, gaining more than $3,000 in less than an hour and up 4% over the past 24 hours. Ethereum’s ether ETH$3,125.08 jumped 5% during the same period, while native tokens of ADA$0.4648 and Chainlink LINK$14.25 climbed even more. The action went down while silver climbed to fresh record highs above $60 per ounce. While broader equity markets remained flat, crypto stocks followed bitcoin’s advance. Digital asset investment firm Galaxy (GLXY) and bitcoin miner CleanSpark (CLSK) led with gains of more than 10%, while Coinbase (COIN), Strategy (MSTR) and BitMine (BMNR) were up 4%-6%. While there was no single obvious catalyst for the quick move higher, BTC for weeks has been mostly selling off alongside the open of U.S. markets. Today’s change of pattern could point to seller exhaustion. Vetle Lunde, lead analyst at K33 Research, pointed to “deeply defensive” positioning on crypto derivatives markets with investors concerned about further weakness, and crowded positioning possibly contributing to the quick snapback. Further signs of bear market capitulation also emerged on Tuesday with Standard Chartered bull Geoff Kendrick slashing his outlook for the price of bitcoin for the next several years. The Coinbase bitcoin premium, which shows the BTC spot price difference on U.S.-centric exchange Coinbase and offshore exchange Binance, has also turned positive over the past few days, signaling U.S. investor demand making a comeback. Looking deeper into market structure, BTC’s daily price gain outpaced the rise in open interest on the derivatives market, suggesting that spot demand is fueling the rally instead of leverage. The Federal Reserve is expected to lower…
Share
BitcoinEthereumNews2025/12/10 11:51