When you are developing an application, you usually need some type of data to display while you are building and testing the functionality of the app. When there aren’t any users for your application (other than you or the other programmers who are building it), you need a pre-existing data set to populate its pages and use for testing. This is where a sample database is useful.
A sample database is a pre-existing dataset that you can use for application or database testing. There are many types of sample databases available for free online. Most are designed for a certain type of database engine. Although the schema of a sample database could be inserted into multiple types of databases, the queries involved to create the database objects and entries will differ.
Even though most relational databases use SQL, the syntax of queries can differ, even between different versions of the same database engine. MySQL is an example of a database with a current data dump format that will not work with older versions of the database.
NoSQL really only means "not only SQL." Every NoSQL database uses a unique syntax and API for querying and loading data. So, having a sample database that matches your NoSQL database is even more important.
There are many datasets to choose from if you are looking for sample or testing data in JSON format for your MongoDB database. But if you have an Atlas account, you don't have to look very far for the data you need. Atlas has eight available sample datasets and makes it easy to load that sample data directly into your cluster. With these datasets, you can test your application or skills at writing aggregation queries.
Here are the sample datasets that Atlas provides:
There are two ways to load your sample data into your Atlas Cluster. You can either use the Clusters view or the Data Explorer tutorial below.
Log into Atlas. The default view is the Clusters view. Click on the ellipses button in your cluster and then click on Load Sample Dataset.
A menu will then pop up to check if you are sure. Click the Load Sample Dataset button.
It will take about a minute for the sample dataset to deploy. Once it does, you will see a message like this:
This loaded every one of the Atlas sample databases into your cluster. Clicking on the Collections buttons like the message suggests will take you to them.
The other way to load these sample datasets into your cluster is to go to the Clusters view in Atlas and instead of clicking the ellipses button, click on the Collections button.
If you have no collections, you will see a Load a Sample Dataset button:
Clicking that button will bring up the same modal. Click the Load Sample Dataset button:
This will take about a minute. Once it is done, you can browse through all of your new collections.
Samples databases are a straightforward concept, but important when building and testing your apps. MongoDB makes it simple to create sample databases with eight different data sets easily imported into MongoDB Atlas.
MongoDB Atlas provides sample datasets that you can load into your own database cluster for testing your application. These available sample datasets include analytics, movie, geospatial, sales, and weather data. You can load this data into your cluster in only a few clicks.
It is relatively simple to load sample data into your Atlas Cluster. First, you need a cluster to load the data into. Then you can load all the sample datasets that Atlas provides from either the Clusters view or the Data Explorer.