The most common type of database is a relational database in the SQL (Structured Query Language) family.
Popular relational databases include:
Microsoft SQL Server
Though they are implemented differently “under the hood,” they are very similar in how a developer or user interacts with them.
If you have worked with WordPress, Drupal, or Joomla, you have used a relational, SQL database.
Table Based Databases
Typical SQL-style databases store data in a series of tables, with each row of the table representing a single entry. Entries in tables can be related to entries in other tables, allowing complex data structures to be designed (hence the term “relational”).
Relational databases are excellent tools for storing structured data about a large number of fairly similar things.
That’s especially true if you know ahead of time (when you are developing the application) what types of items you will be keeping records on. It also helps if you know what information you will need to know about them.
NoSQL Databases Explained
Unfortunately, in real life, we do not always know ahead of time what information we might need to store, or even sometimes what sorts of things we may need to keep track of.
Also, some real-world domains simply aren’t structured enough to fit well into the way SQL databases organize data.
MongoDB is a document-based database, one of many new “NoSQL” or non-relational databases.
Rather than storing records in a series of inter-related table rows, where the information on a single item might be spread across multiple tables, MongoDB stores all the information about a particular item in a single document.
The database then allows for documents of various types to be group together and indexed.
This is a much looser, less structured way of organizing data, and there are both benefits and downsides.
Why Should You Choose MongoDB?
Making the right choice for your database management solution is important.
But it is worth noting that you might not have any choice with what database to use. If you are planning to use an existing Content Management System or Blogging platform, those applications are built with a specific database already.
MongoDB Is for Development
Generally, the question of what type of database to use is a question for developers of new applications.
MongoDB is often a better choice for very large datasets with a very high write load, in a situation where you will need to share the database.
It also is the right choice if your data model, or schema, is unstable and needs to evolve over time.
When Not to Use MongoDB?
Do not use MongoDB if you are building an application which will require SQL joins or transactions, or where data normalization is needed.
What Web Hosting Platforms Support MongoDB?
Shared hosting accounts and “discount” web hosting providers where your site or application shares an IP address with other accounts are totally unsuitable for hosting MongoDB.
Not a lot of choices
Dedicated resource allocation
Costs more than shared
Other Reasons to Go With Higher-End Hosting
On top of that: if you are building an application that requires the use of a NoSQL database like MongoDB, you probably have a lot of other needs. These are probably not going to be adequately provided for in a low-cost shared-hosting environment.
You Need a Dedicated IP Address
Beyond that, almost any serious web server would work fine, as long as you have a dedicated IP address and can gain access to Ports 27017 and 28017 (in many standard web hosts, you will have to request these ports be opened).
So if you can get a dedicated IP address, MongoDB can be deployed on most operating systems, and on most standard production-level hardware.
MongoDB cloud screenshot via WhoIsHostingThis
When you’re looking for a MongoDB host, make sure you go for a private hosting environment.
This can either be in the form of a virtual private server (VPS) or a dedicated server. VPS plans will be easier to manage than dedicated servers and provide a cloud environment for instant, on-demand provisioning.
What Web Hosting Platform Is Best for MongoDB?
Just because you can run MongoDB on almost any web server doesn’t mean you should run MongoDB on any web server.
MongoDB can be a bit tricky to set up, especially for developers unfamiliar with all of its ins and outs.
Much of the speed and scalability benefits are only achieved if the database is set up correctly, in an environment optimized to take advantage of its strengths.
Setting up MongoDB includes:
Setting up a local development environment
Finding a suitable server
Choosing a programming language
Designing a database
Deploying the database
Building a web app.
Pick a Host That Specializes in MongoDB
For this reason, we recommend deploying your MongoDB database on a web host experienced with MongoDB.
The makers of MongoDB have a cloud-managed MongoDB solution that works in conjunction with “the cloud infrastructure of your choice,” and there a number of other Mongo-optimized web hosting providers available.
Many of these MongoDB hosts use Amazon web services (AWS).
MongoDB solutions screenshot via WhoIsHostingThis
Some of these providers that are dedicated to MongoDB hosting include mLab, Compose, and ScaleGrid. These dedicated companies will offer the fullest breadth of features you need to fully host a MongoDB database.
But you’ll find that these MongoDB hosts will be more expensive than VPSs offered by traditional web hosting companies. Other cheaper hosting companies like A2 Hosting have specialized MongoDB hosting plans you can check out.
Pros and Cons of MongoDB
Like all applications, there are good and bad points to MongoDB. Here are the major ones of each type to keep in mind when you are shopping around.
Less upfront development time spent data designing
Ability for a data-model to evolve over time
Flexibility for exceptions, for bits of “oddball” data
Faster writing to the database
No cascading deletes.
Data may be not be normalized (eg, multiple spellings)
Less strict data modeling encourages lazy data design
No checks for data consistency at the database layer.
My Choices: The Top Three MongoDb Hosts
It can be especially hard to pick a host for MongoDB. So I’ll set you on your way with my own three favorite hosts. But remember there are others. Use our Web Hosting Search & Comparisons tool to help you out.
A2 Hosting VPS screenshot via WhoIsHostingThis
My top pick for the cheapest optimized MongoDB hosting option is A2 Hosting.
They give you some of the most affordable VPS plans with plenty of resources available for smaller sites. With their anytime money-back guarantee, there’s almost no reason not to try them out.
A2 has made it extremely easy for developers to set up a MongoDB database with just one click. Developers also get root access, so they can edit any server files they want.
InterServer VPS screenshot via WhoIsHostingThis
Like A2 Hosting, InterServer also gives you some cheap VPS plans. However, they don’t offer the same easy MongoDB set-up. You will be required to follow some steps in their knowledgebase to install it on your server.
Additionally, InterServer will charge you extra for access to their control panel and Direct Admin.
LiquidWeb VPS screenshot via WhoIsHostingThis
For people who need more power, LiquidWeb has cloud VPS hosting on high-performance servers.
Their VPS plans are much more expensive than those of A2 Hosting and InterServer. But this price comes with huge amounts of dedicated resources.
If you need this kind of performance, LiquidWeb will be cheaper than similar plans from HostGator and GoDaddy. LiquidWeb includes a dedicate IP address, included cPanel, full root access, and 100% network uptime.
MongoDB is a non-relational (NoSQL), document-oriented database management system. Its controlled from application code by drivers written for each specific programming language.
What is a non-relational database system?
Most database management systems are relational. This means that the data is stored in a number of related tables, according to a complex data scheme which has to be designed before the system is used. The data for any one actual record (for example, the record of a single user) is usually spread across several tables, so the database has to be queried and assembled when it’s accessed.
In a non-relational database, information concerning a single record is usually stored in a single place. MongoDB is a document-oriented database, which means that information about a specific record is stored in a single block of serialized data called a document.
What are the disadvantages of using non-relational databases?
A non-relational document model does not make it particularly good for highly normalized, structured data sets. Sometimes, updates can create inconsistencies. For example, if a collection of blog posts store the author’s name as an attribute, and a separate collection of authors’ names contains bio information, changing the name of the author will break the connection. This isn’t an issue with a relational database.
What data format does MongoDB use?
Why would I choose MongoDB for my project?
You don’t need to pre-determine your data model, so MongoDB is ideal for continuous development environments where the data model simply isn’t known at the beginning.
Additionally, the document model aligns with the way we think about many data domains, and the way objects are used in applications. This similarity can make programming more intuitive.
Does MongoDB use tables?
No. A single record in MongoDB is stored in a document, rather than in a row of a table. Documents of a similar type are stored in collections.
What operating systems support MongoDB?
MongoDB is cross-platform. It works on Linux, Windows, and Mac OS X.
Can I use MongoDB on shared hosting?
It isn’t usually provided as a standard feature. You will need a dedicated IP address, SSH access, and specific ports will need to be be opened. Additionally, some hosts find it to be resource-intensive, which can be an issue on shared hosting accounts. Finally, be aware that you may run into configuration problems which you won’t be able to deal with easily on a shared hosting plan.
What programming languages can I use with MongoDB?
There are drivers for C, C++, C#, Java, Node.js, Perl, PHP, Python, Ruby, and more.
What types of applications are a good fit for MongoDB?
MongoDB is a good choice for applications that have a large number of records that do not rely on relationships to other types of records. A library catalog is a good example.
Does MongoDB conform to data normalization requirements?
No. MongoDB does not enforce a strict data schema either.
In MongoDB, data normalization and the overall schema are enforced by the application layer, instead of the data layer. However, MongoDB isn’t designed to provide a high degree of formal data integrity. For that reason, it isn’t the best choice for a banking or payment system.
What is sharding?
MongoDB provides scalability by being able to shard a database. This simply means that the data is broken up into pieces, and those pieces are stored on several computers.
What are the most common alternatives to MongoDB?
Relational databases as a whole category are an alternative to MongoDB. These include MySQL, PostgreSQL, and SQLite. CouchDB is a very popular document-oriented database similar to MongoDB. Other non-document-oriented NoSQL databases include Cassandra and BigTable.
Can MongoDB handle multi-dimensional data?
Yes. Documents can be nested inside of other documents, creating data with the structure of multi-dimensional arrays.
Why can’t I do a JOIN in MongoDB?
There’s no need to JOIN anything, because the data model doesn’t support the notion that information about a single object should be spread across multiple tables.
What types of applications are not a good fit for MongoDB?
Any type of application where data consistency is highly valued or required, or where a strict data model needs to be maintained. Financial systems are a particularly bad use case.