Menu

Scaling Multilingual Search: Our FastAPI + PostgreSQL Architecture for Translating Books
📰

Scaling Multilingual Search: Our FastAPI + PostgreSQL Architecture for Translating Books

DEV Community: fastapi·龚旭东·3 days ago
#71iKQlJp
#devtofastapi#devto#dev#search#column
Reading 0:00
15s threshold

How we built a multilingual book platform with FastAPI and PostgreSQL's full-text search to handle translations in multiple languages.

When we started building LectuLibre, an AI-powered book translation service, we knew we'd have to handle content in many languages. Users upload EPUB or PDF books, our backend translates them using LLMs like Claude and DeepSeek, and readers can browse and search the translated versions. That meant our database needed to store and search text in dozens of languages efficiently. Here's how we built that with FastAPI and PostgreSQL, and what we learned along the way.

The Problem: Multilingual Content and Search

Early on, we stored translated text as plain strings in a PostgreSQL TEXT column. Searching was as simple as WHERE content LIKE '%query%' . That worked for a demo with a few hundred books. But as our library grew to tens of thousands of books across Spanish, French, German, Japanese, and more, LIKE queries became painfully slow.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.