Recommended database backend for blog

2019-07-17 03:57发布

问题:

Greetings,

I'm building my personal website using php. My standard approach is to use MySQL as a database backend. I've been hearing a lot about document orienting databases and I'm wondering if these ( couchDB, mongoDB) might be a better option for me.

I understand that a low traffic site such as my personal homepage isn't going to see massive improvements from running a different DB, but I appreciate "the little things".

The database will primarily be holding textual data, such as comments and blog posts. Other than that I'll store some images.

So to sum up, can anyone give me a pros and cons, or other critique on using particular DB backends, most notably the newer document oriented one?

Thanks.

回答1:

Really, the most significant consideration is between relational databases (like MySQL) and document-oriented databases (like mongoDB). Compared to the differences between each class of database, the differences within each class are usually minor, especially for the application you're talking about.

My first recommendation is to use existing software, like WordPress. In that case, you'll want to use their backend, which is going to be a relational database.

If you're certain you want to reinvent the wheel, and you have a host which can accommodate it, I'd choose a document-oriented database. The major advantage is the loose schema; as you modify and add fields to the database you don't need to worry about modifying the data in the database--you can just deal with missing fields as they come up.