[Python] Efficiently Storing Transcript Language Metadata in Firestore

Discussão em 'Python' iniciado por Stack, Fevereiro 16, 2025.

  1. Stack

    Stack Membro Participativo

    Previously, due to the 1 MB document size limitation, I had to break down transcript text into smaller chunks and store them across multiple documents. The structure looked like this:

    users (Collection)
    |
    |-- {user_id} (Document)
    |
    |-- notes (Subcollection)
    |-- {note_id} (Document)
    |-- transcripts (Subcollection)
    |-- RZ290XHh3DD3vzavab1m (Document)
    |-- text: string
    |-- order: int
    |-- 8fKb3NhL2a5DXQYmZPjC (Document)
    |-- text: string
    |-- order: int


    Now, I need to introduce a new field, transcript_language, to store the language of the transcript. Is the following design a good approach?

    users (Collection)
    |
    |-- {user_id} (Document)
    |
    |-- notes (Subcollection)
    |-- {note_id} (Document)
    |-- transcripts (Subcollection)
    |-- metadata (Document) <-- Fixed document ID for storing metadata
    |-- transcript_language: string
    |-- RZ290XHh3DD3vzavab1m (Document)
    |-- text: string
    |-- order: int
    |-- 8fKb3NhL2a5DXQYmZPjC (Document)
    |-- text: string
    |-- order: int

    Continue reading...

Compartilhe esta Página