Simple question, when should one not use MySQL?
There are two facets to my curiosity:
- When to avoid MySQL in particular?
- When to not use relational databases in general?
I wanted to be sure of my choice of MySQL (with PHP on Apache) as my employer was insistent on using something that's not free or open-source but I insisted otherwise. So I just want to be sure.
When your data is not relational, or when (based on your data access pattern and/or data model) you can choose better model, than the relational, use it. If you are not sure there is a better model for your problem, use RDBMS - of of the reasons of it's popularity is that it fits really good for most of the problems. Facebook and Google use MySQL (although not only MySQL, but major part of Facebook is on top of MySQL), so thing about this when you considering a NoSQL solution.
There are different type of databases, like graph databases, which are good for specific tasks. If you have such specific task, research the field of the task.
As for choosing vendor for a RDBMS, this is more a business objective, then a technical one. Sometimes the presense of support, certified professionals, training/consulting, and even matching the company infrastructure (if it has extensive Windows network and experienced windows-administrator it may prefer using windows server over a linux-based one) are the reasons particular software to be choosen.
1. When to avoid MySQL in particular?
When concurrent database sessions are both modifying and querying the database.
MySQL is fine for read-only or read-mostly scenarios (it is no accident that MySQL is frequently used for Web), but more advanced multi-version concurrency control capabilities of Oracle, MS SQL Server, PostgreSQL or even Firebird/Interbase can often handle read-write workloads not just with better performance but with better correctness as well (i.e. they are better at avoiding various concurrency artifacts that may endanger data consistency).
Even traditional "locking" databases such as DB2 or Sybase are likely to handle read-write workloads better than MySQL.
2. When to not use relational databases in general?
In short: when your data is not relational (i.e. it does not fit well in the paradigm of entities, attributes and relationships).
That being said, many modern DBMSes have capabilities outside traditional relational model, such as ability to "understand" hierarchical structure of XML. So even unstructured data that would not normally be stored in the relational DB (or at best would be stored in a BLOB) is no longer necessarily off-limits.
Not a difficult question to answer. Don't use MySQL if another DBMS is going to prove cheaper / better value. Other leading DBMSs like Oracle or SQL Server have many features that MySQL does not. Also if your employer already has a large investment in other DBMSs it may be prohibitively expensive and difficult to support MySQL without good reason. For what reason are you insisting on MySQL?
Also bear in mind that no business buys a DBMS. They buy a complete solution of which the DBMS is part. Consider the return on investment of the whole solution and not just the DBMS.
精彩评论