Guides for studios and founders
Micro Drama Backend Architecture
By Mechatron Lab Engineering Team · Published
A viewer finishes two free episodes and taps episode three. The backend has to check their VIP access, give the player a valid stream, and handle the next request just as reliably when a new series brings in more viewers. This guide follows that episode through our OTT backend and explains the decisions a studio should test before launch.
Get your short drama app ready in as little as 2 weeks
Setup takes an estimated 2–4 weeks once your videos, branding, and accounts are ready. Store review timing varies. Try our live web, iOS, and Android examples below.
Try the live demo
Open MicroDrama in your browser, or install a test build on your phone.

Open the website
microdrama.mechatronlab.com
Launch player

Try on iOS
Install the beta through Apple TestFlight. TestFlight is required.
Open TestFlight

Install on Android
Download and install the test APK on an Android device.
Download test APK
Test login details
Google sign-in
Open the demo and choose the Google sign-in option.
Use a test phone number
Copy a test phone number and use the code below.
OTP
What the micro drama backend handles
Our Node.js and Express API handles the catalog, accounts, subscriptions, and requests for playback. MongoDB, accessed through Mongoose, stores records such as series, seasons, episodes, and subscription history. The video provider handles encoding and delivers the video to the player, so a viewer’s stream does not need to pass through Express.
Redis caches frequently requested data. Redis also backs BullMQ, which runs background work such as analytics events and like processing. The scheduled publishing flow uses Azure Service Bus to send a worker a message when a release is due. This lets a studio prepare tomorrow’s episode without leaving the admin panel open until release time.
From admin upload to a published episode
In the admin panel, create a series, set the episode order, and associate each episode with its video. The video provider prepares playback at several quality levels. With adaptive HLS, the player can switch quality as a viewer moves between Wi-Fi and mobile data. Check that the video is ready and that sound and captions work before releasing it.
For this example, make episodes one and two free and set episode three to VIP. In a scheduled release, the worker reads the publishing message and applies the release in the catalog. Test that a draft stays hidden until release time and that the new episode appears in the right order when it goes live.
See the publishing workflow
Follow the admin steps for preparing artwork, uploading episodes, and reviewing the published series.
Read the series publishing guide

What happens when a viewer taps a VIP episode?
In this example, the player requests episode three. The API checks the account and applies the episode’s access rule. If the viewer is allowed to watch, the API can issue a signed playback link. The video provider checks that signature and expiration before serving the protected stream.
Identify the viewer
For signed-in requests, authentication establishes which account is asking. The OTT API uses Firebase authentication for viewers and JWT-based admin authentication.
Check permission for the episode
The backend uses the catalog and the viewer’s access record to decide whether this episode is free, available with active VIP, or locked.
Issue playback access
A signed link gives the player time-limited access to a protected asset. A Mux DRM asset also needs a separate license token so a compatible player can request a license to decrypt it.
How signed playback links and DRM protect video
On Cloudflare Stream, requiring signed URLs on a video makes playback require a valid token. In the Mux DRM path, the video is encrypted and a compatible player uses a DRM license to play it. FairPlay is common on Apple platforms and Widevine on Android and supported browsers. Confirm the video provider, asset policy, and device support for the deployment you choose.
Review access at the point the API issues the link. Resolve the episode and its provider asset from the catalog on the server. Apply the same rule to direct links and requests for several episodes at once. Keep signed links and signing secrets out of logs, and make sure cached links expire before they can be handed back after their validity ends.
The API also uses Helmet security headers, a browser origin allowlist, and rate limits on selected routes such as login. Keep admin publishing actions behind role checks. Transport security, API permissions, and video protection each cover a different part of the request.
- Open the free and VIP episodes as a guest, an active subscriber, and a viewer whose access has expired.
- Repeat the test using a shared link and while advancing from episode two to episode three.
- For DRM-enabled releases, test the license request and playback on each supported browser and phone.
How a confirmed payment gives the viewer VIP access
The OTT backend has Stripe and Razorpay integrations and handles Apple and Google Play subscriptions. Choose the payment path for each client and market. A payment provider’s signed notification or a store-verified purchase lets the backend update access before the player retries the VIP episode.
A successful checkout screen gives viewers feedback while the backend confirms the purchase. Keep pending purchases pending until verified. If a viewer cancels renewal, use the plan’s paid-through date and provider rules to decide when access ends. Give support enough information to investigate a confirmed payment that didn’t unlock an episode.
For the launch, verify webhook signatures against the original request body when the provider requires it. Test that a repeated notification can be processed without granting access twice and that a late event leaves the account in the correct state. Reconcile with the provider if the order or state is unclear.
Choose which episodes viewers can unlock
Compare subscription access, episode purchases, and rewarded ads before choosing a payment model.
Read the monetization guide
What to test before a release-day traffic spike
Azure App Service can add API instances when scale-out is configured on an eligible plan. The video provider continues to serve video as API traffic grows. A useful load test follows a real viewing session: opening the catalog, playing the free preview, and requesting access to the VIP episode. Measure those steps separately so you can tell whether the bottleneck is in the API, database, payment flow, or player.
The API starts background workers alongside the web process in this setup. Adding API instances can therefore add worker processes too. Set concurrency and connection limits with MongoDB, Redis, and downstream services in mind. Review retries so a repeated job leaves publishing or analytics in the expected state.
Plan who runs the service after launch
Review cloud accounts, operating costs, and what to ask for at handover.
Read the source code and hosting guide
- Watch slow requests, errors, and MongoDB connections while traffic rises.
- Track how long jobs wait, which jobs fail, and whether retry volume grows after a provider outage.
- Check first-play failures and billing verification errors separately so the team knows where to look.
Bring one series to a walkthrough
Tell us which episodes are free, where VIP starts, and which devices you’ll launch on. We can walk through publishing, playback, and the payment options for your deployment.
Sources and further reading
- Azure App Service automatic scaling
- Azure Service Bus scheduled messages
- BullMQ: designing jobs for retries
- Mux: signed playback and DRM license tokens
- Cloudflare Stream: protect videos with signed URLs
- Stripe: webhook verification, duplicates, and event ordering
- Razorpay: validate and test webhooks
- Google Play Billing: server-side purchase verification
- OWASP: API authentication and authorization risks
- AWS: the Dramaze short drama streaming architecture