In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
From SQL to NoSQL7 comparison query language indicators are what, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, hope you can gain something.
We will look at seven indicators that compare SQL and NoSQL.
Some people also find it confused with the name NoSQL. This acronym not only stands for "SQL", but may also be misunderstood as "no to SQL", so in order to use NoSQL databases, organizations will not only need to transform their relational data model into a document model, but will also be trained on the NoSQL database API they will choose.
In fact, the NoSQL database industry has never given up on the most popular database data access. Many NoSQL vendors are still using variants of SQL. Cosmos DB, Cassandra CQL, Elasticsearch SQL, Cockroach Labs . Even if you use the MongoDB query language, you will still find that it is based on select-join-project construction, which is the basis of the relational algebra used in SQL.
One database company in this NoSQL field (which has completely solved this problem) is Couchbase and its N1QL query language. Although Couchbase stores data in native JSON format, the data model it supports can be relational or hierarchical, and is often used in document-based models because of its schema flexibility and extensibility. This is possible because Couchbase provides a query language similar to SQL-N1QL, which extends the SQL language to allow users to manipulate the hierarchy of the document model. All of these are based on Couchbase high-performance data services with key values of API.
However, in today's NoSQL database market, there are many options, and the results can pose many challenges for organizations that want to ensure that their database technology investments can take advantage of all the benefits currently offered by NoSQL technology.
Support for structured and unstructured data
Horizontal scalability of commercial hardware
Easy to manage architectural evolution
Perhaps most importantly, you can choose a vendor in addition to the current RDBMS vendor that has dominated the database market for decades.
To help customers make decisions, Altoros, a company dedicated to helping companies transition from old IT systems to the future, released a query comparison report to compare query languages in today's most popular databases. It chooses to focus on MySQL / SQL,Couchbase N1QL and MongoDB query languages. The implementation of each query language is evaluated using the following conditions to meet different query schemes.
simple
Readability
Expressive force
Flexibility
Skills and expertise
Line of code
Number of trips from the application to the server
Examples of all queries and database dumps can be found in this GitHub repository to help deploy and run all scenarios in this report.
Altoros reporting method
The purpose of this report is to compare query languages from the perspective of traditional RDBMS applications. To do this, it chose:
The activity management application model is usually found in most CRM systems that manage sales, services, and marketing activities. Report settings include the relational model for MySQL and the document database model for Couchbase and MongoDB.
It also uses a set of query schemes that can be recognized by most users of these systems.
For each case, the report provides the appropriate solution in the SQL,N1QL and MongoDB query languages, and then provides an evaluation of each solution.
Evaluation criteria results
The following table summarizes all levels of all query scenarios. Refer to the report for a separate evaluation of each query scheme.
The report uses MySQL-SQL as a reference and evaluates Couchbase N1QL and MongoDB query languages against a number of criteria.
Notes:
Altoros, which works with MongoDB,Cassandra and RedisLab, finds that N1QL is very similar to SQL and always rates it better than the MongoDB query language.
The sample code in scenario 3 shows that for simple queries, the three query languages are relatively similar and have similar evaluation criteria scores. However, the difference appears in the query scenario, where the documents JOIN and Aggregations
The chart shows the number of lines of code for each query. Although this metric may be misstated because all query languages have their own recommended format, it can provide a simple guide to complexity.
The number of lines of code in the N1QL query language is roughly the same as that in SQL.
The MongoDB query language always has more lines of code.
For scenario 7, the MongoDB Altoros team must write 347 lines for the MongoDB query language, while N1QL has 21 lines. This outlier reflects the limitation of MongoDB query language in calculating complex aggregations and general table expressions (CTE). In the past few decades, SQL (now N1QL) has been the main advantage of relational database technology.
Note that this is the MongoDB query solution provided by the Altoros team. As with any implementation, there may be other ways to write Mongo code, but that's what the team came up with.
Number of client server trips
The figure shows the number of trips that the application must submit to the database server.
Notes:
In most cases, SQL / N1QL only needs to submit a query to the server, while MongoDB queries may result in multiple parts, so you need to access the back-end server multiple times. This is due to the expressiveness of SQL / N1QL, where the application developer simply declares the required output and the server processes and returns the results.
The lack of support for complex aggregations requires MongoDB to perform its calculations in multiple phases. This is similar to the standard SQL subquery method. The difference here is that the subquery result set needs to be maintained in the client application and then passed on to another query.
Altoros query comparison report-key findings
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.