How to Host a MongoDB Database in China?
Tags: mongodb, cpp, database, china
Published: 2021-03-19 21:00:49

---
canonical_url: https://www.21cloudbox.com/solutions/how-to-create-a-mongo-database.html
---
# What is MongoDB?

MongoDB (from the English word "Humongous", which means "large" in Chinese) is a document database, a database based on distributed file storage. Written in the C++ language, it is designed to provide scalable high-performance data storage solutions for WEB applications.

MongoDB is a product between relational and non-relational databases. It is the most versatile and most like relational database among non-relational databases.
The data structure it supports is very loose, it is a bson format similar to json, so it can store more complex data types.

The biggest feature of MongoDB is that the query language it supports is very powerful and its syntax is somewhat similar to an object-oriented query language.
One can realize most of the functions similar to single-table query of relational database, and it also supports indexing of data

[21YunBox](https://www.21cloudbox.com/) provides one-click hosting and out of the box operation and maintenance free solution for a MongoDB database.

# How to Create and Deploy a MongoDB database?

1. Register as [21YunBox member](https://www.21yunbox.com/u/signup/)
2. Select "Database" in the console
3. Then click "Add Database"
4. Create with the following configuration

| Options           | Explanation                                               |
| ----------------- | :-------------------------------------------------------: |
| **Database**      | Give the currently created database instance a name       |
| Database Username | The username of the database when connecting to the database. If not specified, the system will automatically generate it. |

> Note: **Database Username** cannot be changed after creation.

You will find that in the above configuration, the database password is not filled in. This is because the system will automatically generate it and no additional filling is required.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jmv1mm6vlhdwo1u3pjo4.png) *Create a MongoDB database showing configuration screenshot*

## How to Connect to the Database Remotely?

In most cases, we connect to the database to add, delete, modify or search and other actions are connected by code.
We have automatically spliced ​​the URL connected to the database, you only need to paste it to complete the configuration and use.

### How to Connect to the Database Under the Intranet?
Under the intranet of 21YunBox, you can directly use **database URL** to connect.

For details, please refer to the database connection section:
- Python Flask or Django project, please refer to [How to deploy Django project to the server?](https://launch-in-china.21yunbox.com/solutions/how-to-deploy-django-project-in-production-server.html)
- PHP Laravel project, please refer to How to [deploy Laravel]](https://launch-in-china.21yunbox.com/solutions/how-to-deploy-laravel-project-in-production-server.html) project to server?

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ylpcthpj76tammgxaei.png) *Screenshot of MongoDB after Set-up*


### How to Connect to the Database Under an External Network?
Under the external network of 21YunBox, you can connect to it by using a visualization tool, such as [Robot 3T (previously called Robomongo)](https://robomongo.org/)

<br>
<br>
# Why Choose 21YunBox?

> 21YunBox is a Cloud Service Platform based out of Beijing, China. We specialize in modern web hosting and automation solutions. This enables you to set up websites instantly.  

> **Have questions about hosting and deploying in China? Let us know, we are happy to help!** <21YunBox@gmail.com> 

To learn about the differences between 21YunBox and these foreign (outside of China) cloud service platforms, please refer to:

* [21YunBox vs Heroku](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-heroku-in-china.html)
* [21YunBox vs Netlify](https://launch-in-china.21yunbox.com/blog/solutions/alternatives-to-netlify-in-china.html)
* [21YunBox vs Vercel](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-vercel-in-china.html)
* [21YunBox vs Gatsby Cloud](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-gatsby-cloud-in-china.html)
* [21YunBox vs Github Pages](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-github-pages-in-china.html)
* [21YunBox vs Surge.sh](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-surgesh-in-china.html)
* [Compare in terms of function and price: 21YunBox vs Heroku, Netlify, Vercel](https://www.21yunbox.com/compare-others/)

<br>
*This article's content originated [here](https://launch-in-china.21yunbox.com/solutions/how-to-create-a-mongo-database.html)*

*For additional detail and future modifications, refer the original post.*