What is the difference between SQL Server and Oracle and MySQL

Author: Sun Wenliang
Link: https://www.zhihu.com/question/19866767/answer/14942009
Source : Zhihu
The copyright belongs to the author, please contact the author for authorization.

SQL, here I understand it as SQL Server. The three are currently the relational databases with the highest market share (by installs rather than revenue), and they are very representative. DB2, which ranks fourth (belonging to IBM), is very similar to Oracle's positioning and architecture, so I won't go into details. If we want to explain the difference between the three, we must first start with history. Oracle: Chinese translation is Oracle, which is a legendary company with a legendary big boss Larry Ellision. At the age of 32, Ellision has achieved nothing, went to three universities, did not get a degree diploma, changed more than a dozen companies, and his wife left him. Starting with just $1,200, Oracle has doubled its sales every year for 12 consecutive years. Oracle was founded in 1977, and the early theoretical basis came from an IBM paper "A Relational Model of Data for Large Shared Data Banks" [1]. The author CODD selects five operations of relational algebra and constructs a new data storage model based on the operations. Based on this model, Oracle has become a very typical relational database. Therefore, it has become more rigorous, safe, high-speed, stable, and more and more large. Due to its early birth, rigorous structure, high availability, high performance and other characteristics, it is widely used in traditional database applications. Large companies in various industries such as finance, communications, energy, transportation, retail, and manufacturing basically use Oracle. , In the early years, almost 100% of the Fortune 500 were Oracle users. MySQL: The original core idea of ​​MySQL is mainly open source and easy to use. Its development dates back to 1985, and the first internal release was born in 1995. By 1998, MySQL can already support 10 operating systems, including the win platform. But there are still many problems, such as the lack of support for transaction operations, subqueries, foreign keys, stored procedures and views. The following figure is a database market share as of 2006 [2]: As can be seen from the figure, the outbreak of MySQL was actually in 2001 and 2002, especially the 4.0 Beta version released in 2002, and InnoDB was officially selected as the default The engine has greatly improved the transaction processing capability and data caching capability. In the same year, version 4.1 began to support subqueries, and MySQL has finally transformed into a mature relational database system. 5 in 2005. Version 0 added stored procedures, server-side cursors, triggers, query optimization, and distributed transaction functions, but it was copied by Oracle in the same year, and InnoDB was incorporated by Oracle. In 2008, MySQL was acquired by Sun, and in 2009, Oracle acquired Sun and MySQL. Due to the early positioning of MySQL, its main application scenario is Internet development. Basically, the outbreak of the Internet made MySQL, and the LAMP architecture swept the world. However, due to MySQL's pursuit of light weight, ease of use, and the lack of early transaction operations and complex query optimization, it has very little share in traditional database application scenarios. SQL Server: When it comes to SQL Server, people generally only think of Microsoft SQL Server, not Sybase SQL Server. SQL Server was originally developed by Microsoft, The three companies, Sybase and Ashton-Tate, blocked the business, which was developed for IBM's (again) company's OS/2 operating system. With the failure of the OS/2 project, everyone parted ways. Microsoft naturally turned to its own win operating system as part of the windows NT software package. Sybase focuses on database development in the direction of Linux/Unix. MS SQL Server is mainly for small and medium enterprises. Its biggest advantage is that it integrates various products and resources of MS company, provides a powerful visual interface, highly integrated management and development tools, and has made great achievements in the rapid construction of business intelligence (BI). MS SQL Server is an important part of MS company's software integration solution, and it has also made great contributions to the popularization of WIN system in enterprise-level applications. Typical application scenarios There is no strict definition of "large database". Some say that the amount of data prevails, and some say that the recovery time prevails. In terms of comprehensive database application scenarios, large-scale database applications have the following characteristics: massive data, high throughput; complex logic, high computational load, and high availability. From this point of view, Oracle, DB2 is a typical large database, Sybase SQL Server is also considered. The application scenarios of the first three databases are described below. Oracle. The application of Oracle is mainly in the data-based business of traditional industries, such as banking, finance, and other businesses that require extremely high availability, robustness, security, and real-time performance; retail, logistics, etc., have high requirements for massive data storage and analysis Business. In addition, high-tech manufacturing industries such as chip factories are basically inseparable from Oracle; e-commerce also has many users, such as JD.com (which is defecting to Oracle) and Alibaba (planning to de-Oracle). And because of Oracle's strong support for complex computing and statistical analysis, there are more and more applications in Internet data analysis and data mining. A typical scenario is as follows: In the data center of a branch of a telecommunications company (non-domestic), there are 4 Oracle Sun large servers used to install the Solaris operating system and Oracle and provide computing services, and 3 Sun Storage disk arrays to Provides Oracle data storage, 12 IBM minicomputers, one Oracle Exadata server, a 500T tape drive is used to store historical data, San is connected to the intranet, and Tuxedo middleware is used to ensure scalability and lossless migration. Build an Oracle database that supports high concurrency, use the OLTP system to process and operate massive data in real time, build an Oracle data warehouse with high computational load, and use the OLAP system to analyze revenue data and provide automatic reports. The total budget is about $7.5 million. MySQL. MySQL is basically born on the Internet and grows longer than the Internet. Most of its application examples are also concentrated in the direction of the Internet. MySQL's high concurrent access capability is no worse than that of large databases. At the same time, it is cheap, easy to install and use, and is deeply loved by Internet companies. And due to the open source feature of MySQL, for some applications that have special requirements on the database, targeted optimization can be achieved by modifying the code, such as SNS, LBS and other Internet services. A typical application scenario is: an Internet company, at the beginning of its establishment, only had a few PCs, and quickly built a website framework through the LAMP architecture. With business expansion and market expansion, it has rapidly developed into a medium-sized website with 6 Dell minicomputers. It has now taken three years to finally become the largest website in the vertical field. The planned data center has 40 Dell rack servers and a total budget of 200,000 US dollars. MS SQL Server. Windows ecosystem products, the advantages and disadvantages are very clear. The advantage is that it is highly integrated, and Microsoft also provides a complete set of software solutions. Basically, a set of win system is installed and it will work together. Therefore, small and medium-sized enterprises that are not so short of money but very short of IT talents will prefer MS SQL Server. For example, self-built ERP systems, business intelligence, vertical retailers, restaurants, institutions, etc. In 1996, Bill Gates personally took action, poached Daniel Anders from Borland, and got the C# language. Microsoft in 2002 to get http://ASP.NET. Mature .NET and Silverlight technologies have won part of the Internet market for MS SQL Server. Among them, MySpace, the world's largest social networking site, has a very representative development process and can be used as a special example [3]. At its peak there were more than 1. 500 million registered users and 40 billion monthly visits. It should be regarded as the largest data application supported by MS SQL Server. Architecture. In fact, the difference in execution is mainly the difference in architecture. It is the schema that causes the difference in interpretation, optimization, and efficiency of the same SQL during execution. This is only a rough description, not detailed: Oracle: Data files include: control files, data files, redo log files, parameter files, archive files, password files. This is divided according to the file function lines, and all files are binary encoded files, which greatly improves the efficiency of the database algorithm. Due to the uniformity of Oracle file management, it is possible to specify a unified standard for the analysis and optimization of SQL execution process: RBO (rule-based optimizer), CBO (cost-based optimizer) through the choice of optimizer, and invincible The HINT rule of , gives great freedom to SQL optimization, and optimizes all aspects of CPU, memory, and IO resources. MySQL: One of the biggest features is the freedom to choose a storage engine. Each table is a file, and the appropriate storage engine can be chosen. Common engines include InnoDB, MyISAM, NDBCluster, etc. However, due to this open plug-in storage engine, such as requiring loose coupling between the database and the engine. As a result, the consistency of the file is greatly reduced. In terms of SQL execution optimization, there are some inevitable bottlenecks. It is a weakness in multi-table association, subquery optimization, statistical functions, etc., and only supports very simple HINT. SQL Server: The data architecture is basically divided vertically, divided into: Protocol Layer (protocol layer), Relational Engine (relational engine), Storage Engine (storage engine), SQLOS. The SQL execution process is the process of layer-by-layer analysis. The optimizer in the Relational Engine is cost-based (CBO), and its working process is very similar to Oracle. On top of the cost, it also supports a wealth of HINTs, including: connection hints, query hints, and table hints. Data files include: control files, data files, redo log files, parameter files, archive files, and password files. This is divided according to the file function lines, and all files are binary encoded files, which greatly improves the efficiency of the database algorithm. Due to the uniformity of Oracle file management, it is possible to specify a unified standard for the analysis and optimization of SQL execution process: RBO (rule-based optimizer), CBO (cost-based optimizer) through the choice of optimizer, and invincible The HINT rule of , gives great freedom to SQL optimization, and optimizes all aspects of CPU, memory, and IO resources. MySQL: One of the biggest features is the freedom to choose a storage engine. Each table is a file, and the appropriate storage engine can be chosen. Common engines include InnoDB, MyISAM, NDBCluster, etc. However, due to this open plug-in storage engine, such as requiring loose coupling between the database and the engine. As a result, the consistency of the file is greatly reduced. In terms of SQL execution optimization, there are some inevitable bottlenecks. It is a weakness in multi-table association, subquery optimization, statistical functions, etc., and only supports very simple HINT. SQL Server: The data architecture is basically divided vertically, divided into: Protocol Layer (protocol layer), Relational Engine (relational engine), Storage Engine (storage engine), SQLOS. The SQL execution process is the process of layer-by-layer analysis. The optimizer in the Relational Engine is cost-based (CBO), and its working process is very similar to Oracle. On top of the cost, it also supports a wealth of HINTs, including: connection hints, query hints, and table hints. Data files include: control files, data files, redo log files, parameter files, archive files, and password files. This is divided according to the file function lines, and all files are binary encoded files, which greatly improves the efficiency of the database algorithm. Due to the uniformity of Oracle file management, it is possible to specify a unified standard for the analysis and optimization of SQL execution process: RBO (rule-based optimizer), CBO (cost-based optimizer) through the choice of optimizer, and invincible The HINT rule of , gives great freedom to SQL optimization, and optimizes all aspects of CPU, memory, and IO resources. MySQL: One of the biggest features is the freedom to choose a storage engine. Each table is a file, and the appropriate storage engine can be chosen. Common engines include InnoDB, MyISAM, NDBCluster, etc. However, due to this open plug-in storage engine, such as requiring loose coupling between the database and the engine. As a result, the consistency of the file is greatly reduced. In terms of SQL execution optimization, there are some inevitable bottlenecks. It is a weakness in multi-table association, subquery optimization, statistical functions, etc., and only supports very simple HINT. SQL Server: The data architecture is basically divided vertically, divided into: Protocol Layer (protocol layer), Relational Engine (relational engine), Storage Engine (storage engine), SQLOS. The SQL execution process is the process of layer-by-layer analysis. The optimizer in the Relational Engine is cost-based (CBO), and its working process is very similar to Oracle. On top of the cost, it also supports a wealth of HINTs, including: connection hints, query hints, and table hints. NDBCluster et al. However, due to this open plug-in storage engine, such as requiring loose coupling between the database and the engine. As a result, the consistency of the file is greatly reduced. In terms of SQL execution optimization, there are some inevitable bottlenecks. It is a weakness in multi-table association, subquery optimization, statistical functions, etc., and only supports very simple HINT. SQL Server: The data architecture is basically divided vertically, divided into: Protocol Layer (protocol layer), Relational Engine (relational engine), Storage Engine (storage engine), SQLOS. The SQL execution process is the process of layer-by-layer analysis. The optimizer in the Relational Engine is cost-based (CBO), and its working process is very similar to Oracle. On top of the cost, it also supports a wealth of HINTs, including: connection hints, query hints, and table hints. NDBCluster et al. However, due to this open plug-in storage engine, such as requiring loose coupling between the database and the engine. As a result, the consistency of the file is greatly reduced. In terms of SQL execution optimization, there are some inevitable bottlenecks. It is a weakness in multi-table association, subquery optimization, statistical functions, etc., and only supports very simple HINT. SQL Server: The data architecture is basically divided vertically, divided into: Protocol Layer (protocol layer), Relational Engine (relational engine), Storage Engine (storage engine), SQLOS. The SQL execution process is the process of layer-by-layer analysis. The optimizer in the Relational Engine is cost-based (CBO), and its working process is very similar to Oracle. On top of the cost, it also supports a wealth of HINTs, including: connection hints, query hints, and table hints.

 

 

SQL is a standard, in fact, a very general standard. The difference between oracle and mysql is too obvious. Just look at the installation file, oracle is about 2g, and mysql is more than 100 m. Functionally, oracle provides very rich functions, while mysql only provides basic relational database functions. In terms of supported data, because oracle can use san/nas, the data stored in a single oracle database and the number of users it supports are far more than mysql. And the reliability of oracle is much higher than that of mysql. So it is said to be a large database. As for when the database executes sql, each database has its own implementation mechanism. Although the principles are similar, the actual execution details are very different.

 

Author: pig pig
Link: https://www.zhihu.com/question/19866767/answer/21368254
Source: Knowing
that the copyright belongs to the author, please contact the author for authorization.

Add some more. 1. Database comparison. ----1.Oracle: The most expensive, the most functions, the least convenient to install, the other related components in the Oracle environment are the most, the number of supported platforms is average, the use is moderately convenient, the development is moderately convenient, the operation and maintenance is moderately convenient, not open source, speed Slowest and safest. ----2. Microsoft SQL Server 2014: Moderately expensive, least functional, moderately easy to install, least other related components in Microsoft SQL Server 2014 environment, least supported platform, most convenient to use, most convenient to develop, most convenient to operate and maintain, Not open source, medium speed, generally safe. ----3.Mysql: Free, medium function, most convenient to install, medium number of other related components in Mysql environment, most supported platforms, least convenient to use, least convenient to develop, least convenient to operate and maintain, open source version available , the fastest, and the least secure. 2. From the perspective of different occupations. ----1. For children who are beginners in database, such as students, it is recommended to learn Microsoft SQL Server 2014. The reason is mainly convenience. The Microsoft platform, from the Windows operating system, VS development tools, C# language, etc., is very convenient to install, use, and learn, and there are many books. Using this platform allows you to focus more on your studies and avoid distractions from many irrelevant factors. For example, if you install Oracle, you need to know a lot of non-database knowledge. When you are a student, you have little time, so it is not recommended to learn Oracle during this period. ----2. For people in state-owned enterprises and institutions, it is recommended to be proficient in Windows\Office\C#\Microsoft SQL Server 2014, because such jobs will often do the rapid development of small software and data Fast processing. ----3. For those who are in Internet companies such as Baidu and Alibaba, it is recommended to be proficient in Mysql. Because such enterprises are unwilling to spend money on genuine software, and at the same time need to customize the source code, Mysql is most suitable for such enterprises. ----4. For companies specializing in the development of large-scale software projects, as well as telecommunications, e-commerce, finance, etc., such enterprises are rich and attach the most importance to data security. Therefore, such enterprises are suitable for using Oracle.

 

Oracle traditional, cross-platform, stable, suitable for OLTP, closest to the database design paradigm, consistent processing is the best and the most complex. Suitable for financial, telecommunications and other enterprises. In order to use it well and give full play to its performance, the administrator's ability is required to be high. Another maintenance cost is higher. SqlServer can only be executed in the Windows series at present, which limits its development, so high availability, disaster recovery, and concurrency are also limited by win. The advantages are that it is simple to operate, has low personnel requirements, and has a low learning curve, and is said to be in use by the NYSE. MySql is suitable for developers, simple. However, with the entry of Oracle, the functions have become more and more complete, and because of its open source, Alibaba has developed and improved a large database, and its performance and application scenarios have been continuously expanded.

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326481410&siteId=291194637