You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

实时数据库进入只读非实时模式后性能变慢,如何恢复?

Fixing "Read-Only Non-Real-Time Mode" for Firebase Realtime Database

Absolutely, you can revert back to the real-time, read-write state—let’s go through some tailored steps that might resolve this even if common community fixes didn’t work for you:

  • Manually toggle the data viewer mode in the console
    Head back to your Realtime Database console page. Look for a mode-switching button (usually labeled something like "Read-only non-realtime")—it might be at the top of the data viewer, in the right-hand menu, or behind a dropdown arrow. Click it and select the "Real-time read-write" option. Sometimes this button is easy to miss, so scan the entire console header area carefully.

  • Clear browser cache and session data
    Browser cache or stale session data can sometimes stick to the read-only mode setting. Try a hard refresh first: on Windows/Linux use Ctrl+Shift+R, on Mac use Cmd+Shift+R. If that doesn’t work, clear the cache specifically for the Firebase console domain: go to your browser’s privacy settings, select "Clear browsing data", and target cookies/cache for the console’s URL.

  • Verify your database security rules
    Accidentally modified security rules can lock your database into a de facto read-only state, separate from the viewer mode. Navigate to the Rules tab in your database console. Make sure your rules aren’t set to global read-only. For example, avoid rules like this:

    {
      ".read": "false",
      ".write": "false"
    }
    

    Revert to your original rules (e.g., allowing read/write for authenticated users, or public access if that’s your intended setup).

  • Restart your app sessions
    For mobile apps: fully close the app (don’t just minimize it to the background) and relaunch it. This forces the app to establish a fresh real-time connection to the database. For web apps: close all related tabs, then reopen both your app and the Firebase console.

  • Check database load and performance metrics
    The system might switch to read-only non-realtime mode automatically if your database is under heavy load. Go to the Monitoring tab in the console to check connection counts, read/write throughput, and latency. If load is high, consider optimizing your data structure to reduce unnecessary queries, limiting real-time listeners, or upgrading your database plan to handle more traffic.

  • Use Firebase CLI to force mode reset
    If you have the Firebase CLI installed, you can directly adjust the database mode:

    1. Run firebase database:settings:get to confirm the current mode.
    2. If it’s set to non-realtime, run firebase database:settings:set --mode=realtime to switch back.

If none of these steps work, double-check that there are no ongoing maintenance notices for your Firebase project—rarely, platform-wide issues can trigger this behavior.

内容的提问来源于stack exchange,提问作者Muhammad Faisal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 08:24:17