具体的各种数据库的对比情况可以参考:https://db-engines.com/en/system/
一、常见的SQL
1. MySQL
2. Oracle
3. Microsoft SQL Server
三款数据库对比,可以参考https://db-engines.com/en/system/Microsoft+SQL+Server%3BMySQL%3BOracle
Editorial information provided by DB-Engines
Name | Microsoft SQL Server | MySQL | Oracle |
Description | Microsofts flagship relational DBMS | Widely used open source RDBMS | Widely used RDBMS |
Primary database model | Relational DBMS | Relational DBMS | Relational DBMS |
Secondary database models | Document storeGraph DBMSSpatial DBMS | Document storeSpatial DBMS | Document storeGraph DBMSRDF storeSpatial DBMS |
DB-Engines Ranking | Score944.81Rank#3 Overall#3 Relational DBMS | Score1206.05Rank#2 Overall#2 Relational DBMS | Score1266.89Rank#1 Overall#1 Relational DBMS |
Website(官网) | www.microsoft.com/en-us/sql-server | www.mysql.com | www.oracle.com/database |
Technical documentation | docs.microsoft.com/en-US/sql/sql-server | dev.mysql.com/doc | docs.oracle.com/en/database |
Developer | Microsoft | Oracle | Oracle |
Initial release | 1989 | 1995 | 1980 |
Current release | SQL Server 2019, November 2019 | 8.0.27, October 2021 | 19c, February 2019 |
License (许可) | commercial | Open Source | commercial |
Cloud-based only | no | no | no |
DBaaS offerings (sponsored links) | ScaleGrid for MySQL: Fully managed MySQL hosting on AWS, Azure and DigitalOcean with high availability and SSH access on the #1 multi-cloud DBaaS. | ||
Implementation language(实现的语言) | C++ | C and C++ | C and C++ |
Server operating systems(支持的操作系统) | Linux/Windows | FreeBSD Linux OS X Solaris Windows | AIX HP-UX Linux OS X Solaris Windows z/OS |
Data scheme | yes | yes | yes |
Typing | yes | yes | yes |
XML support | yes | yes | yes |
Secondary indexes | yes | yes | yes |
SQL | yes | yes | yes |
APIs and other access methods | ADO.NET JDBC ODBC OLE DB Tabular Data Stream (TDS) | ADO.NET JDBC ODBC Proprietary native API | JDBC ODBC ODP.NET Oracle Call Interface (OCI) |
Supported programming languages | C# C++ Delphi Go Java JavaScript (Node.js) PHP Python R Ruby Visual Basic | Ada C C# C++ D Delphi Eiffel Erlang Haskell Java JavaScript (Node.js) Objective-C OCaml Perl PHP Python Ruby Scheme Tcl | C C# C++ Clojure Cobol Delphi Eiffel Erlang Fortran Groovy Haskell Java JavaScript Lisp Objective C OCaml Perl PHP Python R Ruby Scala Tcl Visual Basic |
Server-side scripts | Transact SQL, .NET languages, R, Python and (with SQL Server 2019) Java | yes | PL/SQL |
Triggers | yes | yes | yes |
Partitioning methods | tables can be distributed across several files (horizontal partitioning); sharding through federation | horizontal partitioning, sharding with MySQL Cluster or MySQL Fabric | Sharding, horizontal partitioning |
Replication methods | yes, but depending on the SQL-Server Edition | Multi-source replication Source-replica replication | Multi-source replication Source-replica replication |
MapReduce | no | no | no |
Consistency concepts | Immediate Consistency | Immediate Consistency | Immediate Consistency |
Foreign keys (外键) | yes | yes | yes |
Transaction concepts (事务概念) | ACID | ACID | ACID |
Concurrency (并发) | yes | yes | yes |
Durability (持久性) | yes | yes | yes |
In-memory | yes | yes | yes |
User concepts | fine grained access rights according to SQL-standard | Users with fine-grained authorization concept | fine grained access rights according to SQL-standard |
二、常见的NoSQL
1. Redis
可以看到key-value类型的主要还是redis知名度高
2. MongoDB
可以看到文档类型的还是MongoDB知名度高
个人目前使用这几款数据库的感受而言:
- 免费的关系型首选MySQL
- 银行、证券类用Oracle的居多
- 文档型数据库选MongoDB的居多(之前自己用过MongoDB来存储博客的文档,以及对应的url连接)
- Redis用作缓存、分布式锁的居多
MySQL、Oracle至于具体的一些命令上的差别之后工作中遇到了慢慢补充到这篇博客当中。