קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Firebase Realtime Database
plat_ios
plat_android
plat_web
plat_flutter
plat_cpp
plat_unity
אחסון וסנכרון נתונים באמצעות מסד הנתונים בענן של NoSQL. נתונים
מסונכרן בין כל הלקוחות בזמן אמת, והוא נשאר זמין
עובר למצב אופליין.
Firebase Realtime Database הוא מסד נתונים שמתארח בענן. הנתונים מאוחסנים כ-JSON ומסונכרנים בזמן אמת עם כל לקוח מחובר. כשאתם מפתחים אפליקציות לפלטפורמות שונות באמצעות ערכות ה-SDK שלנו לפלטפורמות Apple, Android ו-JavaScript, כל הלקוחות שלכם משתפים מופע אחד של Realtime Database ומקבלים באופן אוטומטי עדכונים עם הנתונים העדכניים ביותר.
לחלופין, אפשר לנסות את Cloud Firestore לקמפיין מודרני
אפליקציות שדורשות מודלים עשירים יותר של נתונים, יכולת שאילתה, מדרגיות ועוד
זמינות.
שנתחיל? בחירת הפלטפורמה:
iOS+
Android
אתר
Flutter
Unity
C++
ניהול
API ל-REST
יכולות עיקריות
זמן אמת |
במקום בקשות HTTP רגילות, ב-Firebase Realtime Database נעשה שימוש בסנכרון נתונים – בכל פעם שהנתונים משתנים, כל מכשיר מחובר מקבל את העדכון תוך אלפיות השנייה. לספק מידע על שיתוף פעולה
בלי לחשוב על קוד של רשתות.
|
אופליין |
אפליקציות Firebase נשארות רספונסיביות גם כשהן אופליין, כי
ערכת ה-SDK של Firebase Realtime Database שומרת את הנתונים בדיסק. ברגע שיהיה חיבור
הפעלה מחדש של המכשיר, מכשיר הלקוח מקבל את השינויים שהוא לא הוחזר,
לסנכרן אותו עם מצב השרת הנוכחי.
|
גישה ממכשירי לקוח |
אפשר לגשת ישירות למכשיר Firebase Realtime Database
או דפדפן אינטרנט, אין צורך בשרת אפליקציות. אבטחה וגם
אפשר לבצע אימות נתונים דרך Firebase Realtime Database
כללי אבטחה, כללים מבוססי-ביטויים שמופעלים כשהנתונים
שנקראו או כתבו.
|
התאמה לעומס (scaling) במספר מסדי נתונים |
עם Firebase Realtime Database בתוכנית התמחור של Blaze אפשר לקבל תמיכה
צורכי הנתונים של האפליקציה שלכם בקנה מידה נרחב על ידי פיצול הנתונים בין
מכונות של מסד נתונים באותו פרויקט Firebase. תהליך אימות פשוט יותר
עם Firebase Authentication בפרויקט שלך ולאמת משתמשים בכל
את המופעים של מסד הנתונים. לשלוט בגישה לנתונים בכל מסד נתונים באמצעות
Firebase Realtime Database Security Rules בהתאמה אישית לכל מכונה של מסד נתונים.
|
איך זה עובד?
Firebase Realtime Database מאפשר לך ליצור אפליקציות עשירות ושיתוף פעולה
באמצעות מתן גישה מאובטחת למסד הנתונים ישירות מקוד בצד הלקוח. נתונים
נשמר באופן מקומי, וגם במצב אופליין, אירועים בזמן אמת ממשיכים לפעול,
לספק למשתמשי הקצה חוויה רספונסיבית. כשהמכשיר יתחבר מחדש,
Realtime Database מסנכרן את השינויים בנתונים המקומיים עם העדכונים המרוחקים
שהתרחשו כאשר הלקוח היה במצב אופליין, והמיזוג ימזג באופן אוטומטי את כל ההתנגשויות.
ה-Realtime Database מספק שפה גמישה של כללים המבוססת על ביטויים,
שנקראים Firebase Realtime Database כללי אבטחה, כדי להגדיר איך הנתונים
של נתונים מובְנים ומתי ניתן לקרוא מהם נתונים או לכתוב אליהם. בשילוב עם
Firebase Authentication, המפתחים יכולים להגדיר למי תהיה גישה לאילו נתונים ואיך
יכולים לגשת אליו.
Realtime Database הוא מסד נתונים מסוג NoSQL, ולכן יש לו אופטימיזציות ויכולות שונות בהשוואה למסד נתונים יחסי. ה-API של Realtime Database הוא
כדי לאפשר רק פעולות שניתן לבצע במהירות. כך אפשר
וליצור חוויה נהדרת בזמן אמת שיכולה לשרת מיליוני משתמשים בלי
תוך פשרות על רמת התגובה. לכן חשוב לחשוב על
האופן שבו המשתמשים צריכים לגשת לנתונים,
לבנות אותו בהתאם.
נתיב הטמעה
|
שילוב ערכות ה-SDK של Firebase Realtime Database |
כוללים במהירות לקוחות שמשתמשים ב-Gradle, ב-CocoaPods או בסקריפט. |
|
יצירת Realtime Database הפניות |
כדי להגדיר נתונים או להירשם לשינויים בנתונים, אפשר להפנות לנתוני ה-JSON, כמו 'users/user:1234/phone_number'.
|
|
הגדרת נתונים והאזנה לשינויים |
השתמשו בהפניות האלה כדי לכתוב נתונים או להירשם כמנויים לשינויים. |
|
הפעלת שמירה במצב אופליין |
מתן הרשאה לכתיבת נתונים לדיסק המקומי של המכשיר כדי שיהיו זמינים
במצב אופליין.
|
|
אבטחת הנתונים |
כדאי להשתמש בכללי האבטחה של Firebase Realtime Database כדי לאבטח את הנתונים. |
אחסון סוגים אחרים של נתונים
השלבים הבאים:
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],[],null,["# Firebase Realtime Database\n==========================\n\nplat_ios plat_android plat_web plat_flutter plat_cpp plat_unity \nStore and sync data with our NoSQL cloud database. Data\nis synced across all clients in realtime, and remains available when your\napp goes offline. \n\n### Realtime Database\n\n### Cloud Firestore\n\nPreferred \nThe Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON\nand synchronized in realtime to every connected client. When you build\ncross-platform apps with our Apple platforms, Android, and JavaScript SDKs, all of your\nclients share one Realtime Database instance and automatically receive updates with\nthe newest data.\n\nAlternatively, consider trying [Cloud Firestore](/docs/firestore) for modern\napplications requiring richer data models, queryability, scalability and higher\navailability.\n\n\u003cbr /\u003e\n\nReady to get started? Choose your platform:\n\n[iOS+](/docs/database/ios/start)\n[Android](/docs/database/android/start)\n[Web](/docs/database/web/start)\n[Flutter](/docs/database/flutter/start)\n[Unity](/docs/database/unity/start)\n[C++](/docs/database/cpp/start)\n[Admin](/docs/database/admin/start)\n[REST API](/docs/database/rest/start) \n\nKey capabilities\n----------------\n\n|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Realtime | Instead of typical HTTP requests, the Firebase Realtime Database uses data synchronization---every time data changes, any connected device receives that update within milliseconds. Provide collaborative and immersive experiences without thinking about networking code. |\n| Offline | Firebase apps remain responsive even when offline because the Firebase Realtime Database SDK persists your data to disk. Once connectivity is reestablished, the client device receives any changes it missed, synchronizing it with the current server state. |\n| Accessible from Client Devices | The Firebase Realtime Database can be accessed directly from a mobile device or web browser; there's no need for an application server. Security and data validation are available through the Firebase Realtime Database Security Rules, expression-based rules that are executed when data is read or written. |\n| Scale across multiple databases | With Firebase Realtime Database on the Blaze pricing plan, you can support your app's data needs at scale by splitting your data across multiple database instances in the same Firebase project. Streamline authentication with Firebase Authentication on your project and authenticate users across your database instances. Control access to the data in each database with custom Firebase Realtime Database Security Rules for each database instance. |\n\nHow does it work?\n-----------------\n\nThe Firebase Realtime Database lets you build rich, collaborative applications\nby allowing secure access to the database directly from client-side code. Data\nis persisted locally, and even while offline, realtime events continue to fire,\ngiving the end user a responsive experience. When the device regains connection,\nthe Realtime Database synchronizes the local data changes with the remote updates\nthat occurred while the client was offline, merging any conflicts automatically.\n\nThe Realtime Database provides a flexible, expression-based rules language,\ncalled Firebase Realtime Database Security Rules, to define how your data should be\nstructured and when data can be read from or written to. When integrated with\nFirebase Authentication, developers can define who has access to what data, and how\nthey can access it.\n\nThe Realtime Database is a NoSQL database and as such has different optimizations\nand capabilities compared to a relational database. The Realtime Database API is\ndesigned to only allow operations that can be executed quickly. This lets you\nbuild a great realtime experience that can serve millions of users without\ncompromising on responsiveness. Because of this, it is important to think about\nhow users need to access your data and then\n[structure it accordingly](/docs/database/web/structure-data).\n\nImplementation path\n-------------------\n\n|---|-----------------------------------------------|------------------------------------------------------------------------------------------------------------|\n| | Integrate the Firebase Realtime Database SDKs | Quickly include clients using Gradle, CocoaPods, or a script include. |\n| | Create Realtime Database References | Reference your JSON data, such as \"users/user:1234/phone_number\" to set data or subscribe to data changes. |\n| | Set Data and Listen for Changes | Use these references to write data or subscribe to changes. |\n| | Enable Offline Persistence | Allow data to be written to the device's local disk so it can be available while offline. |\n| | Secure your data | Use Firebase Realtime Database Security Rules to secure your data. |\n\nStore other types of data\n-------------------------\n\n- [Cloud Firestore](/docs/firestore) is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud. To learn more about the differences between database options, see [Choose a database: Cloud Firestore or Realtime Database](/docs/firestore/rtdb-vs-firestore).\n- [Firebase Remote Config](/docs/remote-config) stores developer specified key-value pairs to change the behavior and appearance of your app without requiring users to download an update.\n- [Firebase Hosting](/docs/hosting) hosts the HTML, CSS, and JavaScript for your website as well as other developer-provided assets like graphics, fonts, and icons.\n- [Cloud Storage](/docs/storage) stores files such as images, videos, and audio as well as other user-generated content.\n\nNext steps:\n-----------\n\n- Set data and listen for changes using the [Apple platforms](/docs/database/ios/start), [Android](/docs/database/android/start), [Web](/docs/database/web/start), [Admin](/docs/database/admin/start) SDKs, or the [REST API](/docs/database/rest/start).\n- Add Firebase Realtime Database to your [Apple](/docs/database/ios/start), [Android](/docs/database/android/start), or [Web](/docs/database/web/start) app.\n- Learn about how to secure your files using [Firebase Realtime Database Security Rules](/docs/database/security)."]]