با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Firebase Realtime Database یک پایگاه داده میزبان ابر است. داده ها به صورت JSON ذخیره می شوند و در زمان واقعی با هر مشتری متصل همگام سازی می شوند. وقتی برنامههای بین پلتفرمی را با پلتفرمهای Android، Apple، و جاوا اسکریپت SDK ما میسازید، همه مشتریان شما یک نمونه Realtime Database را به اشتراک میگذارند و بهطور خودکار با جدیدترین دادهها بهروزرسانیها را دریافت میکنند.
ما می توانیم از هر URL Firebase Realtime Database به عنوان نقطه پایانی REST استفاده کنیم. تنها کاری که باید انجام دهیم این است که .json به انتهای URL اضافه کرده و درخواستی از مشتری HTTPS مورد علاقه خود ارسال کنیم.
یک حساب کاربری ایجاد کنید
ابتدا بدون هیچ هزینه ای در کنسول Firebase برای یک حساب کاربری ثبت نام کنید. یک برنامه Firebase جدید با یک URL منحصر به فرد که به firebaseio.com ختم می شود برای شما ایجاد می شود. شما از این URL برای احراز هویت کاربران خود و ذخیره و همگام سازی داده ها با پایگاه داده برنامه استفاده خواهید کرد.
در کنسول Firebase می توانید برنامه های Firebase را ایجاد، مدیریت و حذف کنید. با کلیک بر روی یک برنامه Firebase خاص به شما امکان می دهد پایگاه داده برنامه خود را در زمان واقعی مشاهده و تغییر دهید. در داشبورد برنامه خود، همچنین میتوانید Firebase Realtime Database Security Rules را تنظیم کنید، احراز هویت برنامه خود را مدیریت کنید، استقرارها، و تجزیه و تحلیلها را مشاهده کنید.
یک پایگاه داده ایجاد کنید
به بخش Realtime Databaseکنسول Firebase بروید. از شما خواسته می شود که یک پروژه Firebase موجود را انتخاب کنید. گردش کار ایجاد پایگاه داده را دنبال کنید.
یک حالت شروع برای Firebase Security Rules خود انتخاب کنید:
حالت تست
برای شروع کار با کتابخانه های موبایل و کلاینت وب خوب است، اما به هر کسی اجازه می دهد داده های شما را بخواند و بازنویسی کند. پس از تست، حتما قسمت Understand Firebase Realtime Database Rules را مرور کنید.
برای شروع کار با وب، اپل یا اندروید SDK، حالت تست را انتخاب کنید.
حالت قفل شده
همه خواندن و نوشتن از مشتریان تلفن همراه و وب را رد می کند. سرورهای برنامه تأیید شده شما همچنان می توانند به پایگاه داده شما دسترسی داشته باشند.
مکانی را برای پایگاه داده انتخاب کنید.
بسته به موقعیت پایگاه داده ، URL پایگاه داده جدید به یکی از اشکال زیر خواهد بود:
DATABASE_NAME .firebaseio.com (برای پایگاههای داده در us-central1 )
DATABASE_NAME . REGION .firebasedatabase.app (برای پایگاههای داده در همه مکانهای دیگر)
روی Done کلیک کنید.
هنگامی که Realtime Database فعال می کنید، API را در Cloud API Manager نیز فعال می کند.
یک کتابخانه کمکی را انتخاب کنید
می توانید داده ها را از طریق REST API مستقیماً از خط فرمان بخوانید و بنویسید. در این راهنما ما از cURL برای همه مثال های خود استفاده خواهیم کرد. ما همچنین چندین کتابخانه کمکی شخص ثالث برای تعامل با REST API از زبان مورد علاقه شما داریم. می توانید از یکی از کتابخانه های کمکی زیر استفاده کنید یا کتابخانه خود را ایجاد کنید:
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[],[],null,["\u003cbr /\u003e\n\nThe Firebase Realtime Database is a cloud-hosted database. Data is stored as\nJSON and synchronized in realtime to every connected client. When you build\ncross-platform apps with our Android, Apple platforms, and JavaScript SDKs,\nall of your clients share one Realtime Database instance and automatically receive\nupdates with the newest data.\n\nWe can use any Firebase Realtime Database URL as a REST endpoint. All we need\nto do is append `.json` to the end of the URL and send a request from\nour favorite HTTPS client.\n\nCreate an Account\n\nFirst sign up for an account at no cost in the [Firebase console](//console.firebase.google.com/). A new\nFirebase app will be created for you with a unique URL ending in\n`firebaseio.com`. You'll use this URL to authenticate your users and\nto store and sync data to the app's database.\n\nWithin the [Firebase console](//console.firebase.google.com/) you can create, manage and delete Firebase\napps. Clicking on a specific Firebase app lets you view and modify your app's\ndatabase in real time. In your app dashboard, you can also set\nFirebase Realtime Database Security Rules, manage your\napp's authentication, deploys, and view analytics.\n\nCreate a Database\n\n1. Navigate to the **Realtime Database** section of the\n [Firebase console](https://console.firebase.google.com/project/_/database).\n You'll be prompted to select an existing Firebase project.\n Follow the database creation workflow.\n\n2. Select a starting mode for your Firebase Security Rules:\n\n Test mode\n\n : Good for getting started with the mobile and web client libraries,\n but allows anyone to read and overwrite your data. After testing, **make\n sure to review the [Understand Firebase Realtime Database Rules](/docs/database/security)\n section.**\n\n :\n | **Note:** If you create a database in Test mode and make no changes to the default world-readable and world-writeable Rules within a trial period, you will be alerted by email, then your database rules will deny all requests. Note the expiration date during the Firebase console setup flow.\n\n : To get started with the web, Apple, or Android SDK, select testmode.\n\n Locked mode\n\n : Denies all reads and writes from mobile and web clients.\n Your authenticated application servers can still access your database.\n\n3. Choose a location for the database.\n\n Depending on the\n [location of the database](/docs/projects/locations#rtdb-locations), the\n URL for the new database will be in one of the following forms:\n - \u003cvar translate=\"no\"\u003eDATABASE_NAME\u003c/var\u003e`.firebaseio.com` (for\n databases in `us-central1`)\n\n - \u003cvar translate=\"no\"\u003eDATABASE_NAME\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e`.firebasedatabase.app`\n (for databases in all other locations)\n\n4. Click **Done**.\n\nWhen you enable Realtime Database, it also enables the API in the\n[Cloud API Manager](https://console.cloud.google.com/projectselector/apis/api/firebasedatabase.googleapis.com/overview).\n\nChoose a Helper Library\n\nYou can read and write data through the REST API directly from the command line.\nIn this guide we'll use [cURL](https://en.wikipedia.org/wiki/CURL)\nfor all of our examples. We also have several third-party helper libraries for\ninteracting with the REST API from your favorite language. You can use one of\nthe following helper libraries or create your own: \n\n| Language | Libraries |\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Clojure | [taika](https://github.com/cloudfuji/taika) by [Cloudfuji](https://github.com/cloudfuji/) |\n| Dart | [IO Client](https://github.com/firebase/firebase-dart#io-client) in the official [firebase-dart](https://pub.dartlang.org/packages/firebase) library |\n| Go | [Firego](https://github.com/zabawaba99/firego) by [Steven Berlanga](https://github.com/zabawaba99) and [Tim Gossett](https://github.com/MrGossett) [Go Firebase](https://github.com/JustinTulloss/firebase) by Cosmin Nicolaescu and Justin Tulloss |\n| Java | [firebase4j](https://github.com/bane73/firebase4j) by [Brandon Gresham](https://twitter.com/bane73) |\n| Perl | [Firebase-Perl](https://metacpan.org/pod/Firebase) by Kiran Kumar and JT Smith |\n| PHP | [firebase-php](https://github.com/kreait/firebase-php) by [kreait](https://github.com/kreait) [firebase-php](https://github.com/ktamas77/firebase-php) by [Tamas Kalman](https://github.com/ktamas77) |\n| Python | [Pyrebase](https://github.com/thisbejim/Pyrebase) by [James Childs-Maidment](https://github.com/thisbejim) [python-firebase](http://ozgur.github.io/python-firebase/) by [Özgür Vatansever](https://github.com/ozgur) [python-firebase](https://github.com/mikexstudios/python-firebase) by [Michael Huynh](https://twitter.com/mikexstudios) |\n| Ruby | [firebase-ruby](https://github.com/oscardelben/firebase-ruby) by [Oscar Del Ben](https://twitter.com/oscardelben) [BigBertha](http://derailed.github.io/bigbertha) by [Fernand Galiana](https://twitter.com/kitesurfer) [rest-firebase](https://github.com/CodementorIO/rest-firebase) by [Codementor](https://www.codementor.io/) |\n\nNext Steps\n\n- Learn how to [structure data](/docs/database/rest/structure-data) for Realtime Database.\n- [Save data.](/docs/database/rest/save-data)\n- [Retrieve data.](/docs/database/rest/retrieve-data)\n- [View your database in the Firebase console.](https://console.firebase.google.com/project/_/database/data)"]]