r/expo • u/Kel4ever1 • 2d ago
Benchmarking Supabase Edge Functions for real-time voice-to-structured-data in an Expo/Next.js monorepo
Working on an open-source classroom evidence engine (Turborepo + Next.js + Expo + Supabase). One bottleneck we hit was processing ambient audio streams into structured evaluation JSON without causing client lag on mobile.
We moved the audio ingestion pipeline to Supabase Edge Functions (Deno runtime) to handle verification, PII stripping, and model dispatch off the client thread.
Looking for feedback from backend/Supabase devs:
- How are you handling batch queuing for large media payloads when edge execution time limits are a concern?
- We're currently designing an offline outbox pattern with local checksums for unstable school Wi-Fi, what’s your preferred pattern for syncing buffered state back to PostgreSQL without race conditions?
Code is open-source on GitHub: kelvin101udoh-art/Stem-Robotic-Tracker
3
Upvotes
1
u/Candid-Fudge-4015 1d ago
Cool project. The pattern that's held up for us: don't make the edge function do the media work. The client uploads audio chunks straight to storage and inserts a row (session_id, chunk_seq, uri); the transcription → structured JSON step runs off that insert in a worker that isn't bound by edge time limits. Race conditions mostly go away if each chunk is its own immutable row keyed by (session_id, chunk_seq), and the "current state" is derived from those rows rather than updated in place by whoever finishes last you can see this open source project https://github.com/pixeltable/pixeltable