Best Firebase Alternatives for China
Tags: firebase, webdev, parse, china
Published: 2021-02-19 19:09:10

---
canonical_url: https://www.21cloudbox.com/solutions/firebase-alternatives-in-china.html
---
# What is Firebase?
Firebase is a real-time back-end database startup company that can help developers quickly write web and mobile applications. In October 2014, Google acquired Firebase and later integrated Firebase into Google’s cloud services.

<br>
<br>
# Does Firebase Work in China?
According to Google Beijing, **No** it can not be used in China.

According to Chinese laws, data of Chinese users must be stored on servers within China. Therefore, it is not allowed to store user data in databases outside of China. Also, using agents or other methods of data storage is not a long-term solution.

<br>
<br>
## Firebase's Open Source Alternative is Parse

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejpg5ksa8gy2rdcl2ijj.png)
*Parse Official Website*


<br>
<br>
## What is Parse?

Parse is a cloud-based back-end management platform. For developers, Parse provides back-end one-stop and package services: server configuration, database management, API, video and audio file storage, real-time message push, customer data analysis and statistics, etc. In this way, developers only need to handle the development of the front-end/client/mobile-end, and hand over the back-end to Parse.

Facebook acquired Parse in 2013, and later decided to close Parse, and finally Parse decided to open source their code, and now [Parse Server](https://github.com/parse-community)/parse-server) and [Parse Dashboard](https://github.com/parse-community/parse-dashboard), and recently [GraphQL Other functions](https://blog.parseplatform.org/announcements/release/2019/07/09/GraphQL-Announcement.html).


**21YunBox provides a Parse Server alternative to Firebase within China.  We provide an operations and maintenance free one-click hosting solution**.

<br>
<br>
## How to Create a Parse Server?
1. Register as [21YunBox member](https://www.21yunbox.com/u/signup/)
2. Create a [MongoDB](https://launch-in-china.21yunbox.com/solutions/how-to-create-a-mongo-database.html) database
3. Fork [Parse Server startup template](https://gitee.com/eryiyunbox-examples/parse-server-example)
4. Create a **cloud service** on 21YunBox and allow 21YunBox to access your code base
5. Create with the following configuration

| Environment.  | **`Node`**         |
| ------------- | :----------------: |
| Build command | **`yarn install`** |
| Start command | **`yarn start`**   |


Click **Advanced Configuration** to configure environment variables:

| KEY | VALUE |
| :--------: | :-------------: |
| **APP_ID** | Randomly generate 32-bit characters |
| **MASTER_KEY** | Randomly generate 32-bit characters |
| **MONGODB_URI** | Click **Database URL** in the cloud database console to obtain|
| **SERVER_URL** | `<APP_ID>.21cloudbox.com`, such as `parse-server-demo.21cloudbox.com`|
| **PORT** | `10000`, default port used by 21CloudBox |

> For more other Parse Server environment variable configurations, please refer to [Official Document](https://github.com/parse-community/parse-server#basic-options).

Randomly generate 32-bit characters method:
Paste the following command on the command line:

```bash
echo $(base64 /dev/urandom | head -c32)
```

After Parse is successfully deployed, you can go to `<APP_ID>.21cloudbox.com/test` for testing. When the test is successful, you will see the following:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/618xdm2bjm0h0gt8ebre.png)*Parse Deployed Successfully*

### Step-by-Step Setup and Deploy Video:

[View video demo]:(https://www.bilibili.com/video/BV1Rh411S7um) Firebase Alternative-how to deploy Parse to the server.

<br><br>
## How to use Parse Server to Create and Read Data?

You can use the `curl` command or the visual interface [Postman](https://www.postman.com/) to help you create and read data.

### Create Data

**Created in `curl` way**
```bash
curl -X POST \
-H "X-Parse-Application-Id: <APPLICATION_ID>" \
-H "Content-Type: application/json" \
-d'{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
https://<APP_ID>.21cloudbox.com/parse/classes/GameScore
```

**After the successful creation, you should receive a similar json**
```bash
{
    "objectId": "9ed7LlOzn2",
    "createdAt": "2021-03-25T07:03:28.668Z"
}
```

### Read Data

** Via `objectId`, read the data created above**
```bash
curl -X GET \
  -H "X-Parse-Application-Id: APPLICATION_ID" \
  https://<APP_ID>.21cloudbox.com/parse/classes/GameScore/9ed7LlOzn2
```

```bash
// Response
{
    "objectId": "9ed7LlOzn2",
    "score": 1337,
    "playerName": "Sean Plott",
    "cheatMode": false,
    "createdAt": "2021-03-25T07:03:28.668Z",
    "updatedAt": "2021-03-25T07:03:28.668Z"
}
```

### Create and read data demos with Postman:

[View a demo video](https://www.bilibili.com/video/BV1a5411w7h6) of Firebase domestic alternative-create and read data with Postman

In addition to the simple method of using curl or Postman to create data above, Parse also provides a multi-language SDK (iOS, Android, PHP, etc.). For more details, please refer to the official Parse technical documentation: [http://docs.parseplatform. org/](http://docs.parseplatform.org/)

<br>
### Related Articles
-[How to deploy Parse Dashboard to the server?](https://launch-in-china.21yunbox.com/solutions/how-to-deploy-parse-dashboard.html)

<br>

*For additional detail and future modifications, refer the [original post](https://launch-in-china.21yunbox.com/solutions/firebase-alternatives-in-china.html).*