Why Elasticsearch to remove the concept of type in version 7.X

Background note

Elasticsearch is based on Apache Lucene (TM) open source search engine. Whether in the field of open source or proprietary, Lucene can be considered to be by far the most advanced, highest performance, most versatile search engine library.

Elasticsearch a NoSQL databases (non-relational databases), and a conventional relational database (example: MySQL, Oralce etc.) of the basic concept of correspondence is as follows:

Elasticsearch:index   -->  type     -->   doc   -->  field

MySQL:          Database   ->    Data Sheet ->     OK      ->  Column

 

As early as relational databases than non-relational database concepts presented, and very mature and widely used.

So, then many NoSQL (including: MongoDB, Elasticsearch, etc.) and are referenced to the extension of the basic concepts of traditional relational databases.

 

An objective phenomenon and facts are as follows:

Elasticsearch recent version of the official website of the evolution of the type proposed concept is as follows:

In 5.X version, a index down to create more of the type ;

In 6.X version, a index next can only be one of the type ;

In 7.X releases directly removed type concept, that index will no longer type

 

Why remove the notion of type?

Why not start 6.X version directly remove type, but to the phasing out of type?

Why?!

 

Cause Analysis

1, why should the concept of type of removal?

A: Because the early Elasticsearch design, design patterns directly examine the relational database, there is the concept of type (data sheet) is.

However, the search engine is based on Lucene , this " gene " determines the type superfluous. The Lucene full-text search function of the reason why fast because the inverted index exists.

The generation of such inverted index is based on the index, rather than type. Multiple type but will slow down the search .

In order to maintain Elasticsearch " everything for the search ," the purpose, appropriate to make some changes (removal type) it is understandable, and it is worth it.

So, Why not? !

 

2, why not start 6.X version directly remove type, but to the phasing out of type?

A: For historical reasons, the early Elasticsearch supports multiple type of the next index, moreover, there are many projects in Elasticsearch use as a database.

If the direct removal of the concept of type, not only many applications Elasticsearch project will be faced with major changes in operations, functions and code ,

And for Elasticsearch official , it is a huge challenge (this is the beating of major surgery, many related to the type of source is to be modified).

So, on balance, to take a gradual transition, ultimately, to postpone 7.X version to complete " removal of the type " of revolutionary change .

Guess you like

Origin www.cnblogs.com/miracle-luna/p/10998670.html