Series: Designing an Enterprise RAG Platform from Scratch (Part 2 of 5)
1. The Trap: Synchronous Document Parsing
In Part 1 , I shared why I set out to build DocLab —an enterprise-grade RAG platform on AWS using Java 21, Spring Boot 3, and pgvector.
Today, let’s talk about the first big hurdle every RAG engineer faces: Document Ingestion .
In most hobby tutorials, document ingestion looks like this:
User uploads file ──> Web Server parses file in-process ──> Generates vectors ──> Saves to DB ──> Returns 200 OK
Enter fullscreen mode
Exit fullscreen mode
When you try this in production, you encounter two immediate disasters:
The Web Thread Bottleneck: If an engineer uploads a 40MB PDF or a 100-page architectural specification, parsing that file can take 15 to 45 seconds. Synchronous worker threads in Tomcat or Netty get blocked waiting on CPU-intensive parsing.…