Elasticsearch tutorial live replay

After understanding the usage scenarios of ES, the study, use and promotion of ES will be more valuable and meaningful.

#1. Scenario — Use Elasticsearch as the primary backend

In traditional projects, search engines are deployed on top of mature data stores to provide fast and relevant search capabilities. This is because early search engines could not provide durable storage or other frequently needed features such as statistics.



Elasticsearch is a modern search engine that provides persistent storage, statistics, and more.

If you are starting a new project, we recommend that you consider using Elasticsearch as the only data store to help keep your design as simple as possible.

Operations involving frequent updates and transactions are not supported in this scenario.

For example: Create a blog system that uses ES as storage. 1) We can submit new blog posts to ES; 2) Use ES to retrieve, search and statistic data.

ES as storage advantage: What happens if a server fails? You can achieve fault tolerance by copying data to different servers. Note: When designing the overall architecture, we need to weigh the need to add additional storage.

#2, Scenario 2: Add ElasticSearch to the existing system

Because ES cannot provide all storage functions, in some scenarios, ES support must be added to existing system data stores.



Example 1: ES does not support transactional, complex relationships (at least not in 1.x, 2.x has improved, but still not well supported). If you need support for these features in your system, you need to consider adding ES support to the existing architecture and storage.

Example 2: If you already have a complex system running, one of your requirements is to add retrieval services to the existing system. One very risky approach is to refactor the system to support ES. It is safer to add ES as a new component to an existing system. If you are using an SQL database and ES storage as shown below, you need to find a way to synchronize the two storage in real time. Select a synchronization plug-in based on the data composition and database. Options include: 1) Mysql, Oracle logstuck-input-JDBC plug-in. 2) Mongo Select the Mongo-connector tool.

Suppose your online retail store’s product information is stored in an SQL database. For quick and relevant searches, you install Elasticsearch. To index data, you need to deploy a synchronization mechanism, which can be either Elasticsearch plug-in or you build a custom service. This synchronization mechanism allows all data and indexes for each product to be stored in Elasticsearch, with each product stored as a Document (where document is equivalent to a row /row in a relational database).

When you enter “User type” in the search criteria on this page, the Storefront Web application queries this information through Elasticsearch. Elasticsearch returns standards-compliant product documents and sorts documents according to how you like them. The sort can be based on the relative score of the number of searches for each product, or any information stored in the product document, such as the most recent products added, the average score, or those inserted or updated. So you can just use Elasticsearch to handle searches. It’s up to the synchronization mechanism to keep Elasticsearch up to date.

#3 scenario 3: Use ElasticSearch and existing tools

In some cases, you can do a job with ElasticsSearch without having to write a line of code. Many tools work with Elasticsearch, so you don’t have to write from scratch.

For example, suppose you want to deploy a large-scale logging framework that stores, searches, and analyzes a large number of events.

To process logs and output to Elasticsearch, you can use logging tools such as rsyslog (www.rsyslog.com), Logstash (www.elastic.co/products/lo…Flume (http://flume.apache.org).

Search and visual interface to analyze these logs, you can use Kibana (www.elastic.co/ product/Kibana).



## Why are there so many tools for Elasticsearch? The main reasons are as follows:

1) Elasticsearch is open source.

2) Elasticsearch provides a JAVA API.

3) Elasticsearch provides a RESTful API that any application can access no matter what language it is written in

4) More importantly, REST requests and responses are typically in JSON (JavaScript object notation) format. Typically, a REST request contains a JSON file, and its reply is also a JSON file.

— — — — — — — — — — — — — — — — — more ES of iso related actual combat experience sharing, please scan below WeChat Ming yi world 】 【 qr code number public attention. (Update at least once a week!)

Hit Elasticsearch with you! — — — — — — — — — — — — — — — — —

Author: Ming yi Reprint please indicate the source, the original address: blog.csdn.net/laoyang360/… If you feel this article is helpful to you, please click “top” to support, your support is the biggest motivation for me to persist in writing, thank you!