Amazon Elasticsearch Service로 우리 서비스에 날개 달기-박진우,솔루션즈 아키텍트,AWS::AWS Summit Online Korea 2021

Amazon Web Services Korea
7 Sept 202125:03

Summary

TLDRThe video script introduces Park Ju-Mi, a Solutions Architect, who explores the use of Amazon Elasticsearch Service to enhance service capabilities. The script covers the basics of the service, its benefits for handling increasing data from various sources, and how it simplifies deployment and scaling. It also delves into implementing search services, analyzing data, and utilizing KNN for recommendations. The session concludes with insights on performance and cost optimization, emphasizing the service's flexibility and efficiency in managing real-time search and analytics.

Takeaways

  • 😀 The speaker, Park Jumi, is a Solutions Architect who is passionate about Amazon's Elastic Search Service and its capabilities.
  • 📈 The demand for data-related services is growing due to the increase in data from various sources like mobile, IoT, and online activities accelerated by the pandemic.
  • 🔍 Amazon Elastic Search Service is praised for its ability to handle complex search requirements, real-time analytics, and machine learning without the need for manual server management.
  • 🛠️ The service offers ease of setup and scalability, with features like hot and cold storage options, index state management, and integration with other AWS services for data ingestion and processing.
  • 📊 The speaker shares an example of implementing search services for a customer using Amazon Elastic Search, highlighting how it addressed issues with performance and synonym search in traditional RDBMS setups.
  • 📈 The use of inverted indices in Elastic Search allows for fast and flexible search capabilities, including handling synonyms and phrase searches that were challenging with RDBMS.
  • 🌐 The service supports various data analysis queries, such as histograms, summations, and other statistical operations, facilitating real-time monitoring and insights.
  • 🔑 Elastic Search's vector space model and the BM25 algorithm are mentioned for ranking search results based on term frequency and inverse document frequency, enhancing search relevance.
  • 🛑 The importance of performance and cost optimization is discussed, including considerations for instance types, shard sizes, and index refresh intervals to balance efficiency and resource usage.
  • 💰 Tips for cost-effective use of Elastic Search are provided, such as managing index states for data lifecycle, using UltraWarm storage for cost savings, and avoiding unnecessary replication during scaling operations.
  • 🔍 The script concludes with an invitation for feedback, emphasizing the value of the session and the potential of Amazon Elastic Search Service to enhance various services.

Q & A

  • Who is the speaker in the provided transcript?

    -The speaker is Park Ju-Mi, a Solutions Architect.

  • What is the main topic discussed by Park Ju-Mi in the transcript?

    -The main topic discussed is the use of Amazon Elastic Search Service to enhance service capabilities.

  • What are the key requirements for data handling mentioned in the script?

    -The key requirements mentioned are fast querying, easy setup, operational convenience, strong security, real-time analytics, and machine learning.

  • Why is Amazon Elastic Search Service considered a 'hero service' by the speaker?

    -Amazon Elastic Search Service is considered a 'hero service' because it simplifies complex architecture and provides a scalable, easy-to-use solution for various data-related problems.

  • How does Amazon Elastic Search Service handle data growth and increasing demands?

    -It handles data growth by providing a scalable service that can manage large volumes of data from various sources like IoT devices, mobile, and web environments, and it meets increasing demands through features like real-time search and analytics.

  • What are the advantages of using Amazon Elastic Search Service for search implementation?

    -Advantages include the ability to start quickly without manual server setup, easy instance modification and upgrades, and automated data management for hot and warm storage tiers.

  • How does Amazon Elastic Search Service support real-time search and analytics?

    -It supports real-time search and analytics by allowing data to be indexed and searched immediately, providing APIs for easy integration, and enabling dashboards for quick insights.

  • What is the role of K-Nearest Neighbors (KNN) in Amazon Elastic Search Service?

    -KNN is used for recommendations, fraud detection, and finding similar images or documents by measuring the distance between data points in a vector space.

  • How does the speaker address the issue of performance optimization in Amazon Elastic Search Service?

    -The speaker discusses performance optimization by suggesting appropriate instance selection based on workload, proper shard distribution, and adjusting refresh intervals to balance performance and cost.

  • What cost optimization strategies are mentioned in the script?

    -Cost optimization strategies include managing index states to move data to cheaper storage options over time, using UltraWarm storage for older data, and deleting data that is no longer needed.

  • What additional features of Amazon Elastic Search Service are highlighted in the transcript?

    -Additional features highlighted are support for SQL queries, integration with other AWS services, and the use of machine learning algorithms like BM25 for ranking search results.

Outlines

00:00

😀 Introduction to Amazon Elasticsearch Service

The speaker, Park Ju-mi, a Solutions Architect, introduces the Amazon Elasticsearch Service, which is a fully managed service that simplifies the process of deploying, operating, and scaling search and analytics applications in the cloud. The service supports open-source Elasticsearch, which allows for easy setup and management without the need for manual server configuration. The speaker will discuss how to implement search services, perform analytics, and use machine learning for recommendations, as well as touch on performance and cost optimization.

05:03

🔍 Implementing Search Services with Amazon Elasticsearch

The speaker provides a case study of how Amazon Elasticsearch Service was used to improve search functionality for a customer. The customer, who had been using a relational database for search, faced performance issues and lacked full-text search capabilities. By migrating to Amazon Elasticsearch, they were able to implement a more robust search solution that supports full-text search, synonym searches, and provides faster performance. The service's real-time indexing and analysis capabilities were highlighted, along with the ease of integration with other AWS services.

10:05

📊 Data Analysis with Amazon Elasticsearch

The speaker discusses the data analysis capabilities of Amazon Elasticsearch, sharing their experience of implementing the service for a major Korean portal's various services, including blogs, cafes, news, and shopping. The service's performance and cost-effectiveness were emphasized, as it provided extensive support for operational statistics and API configuration. The speaker also explains how to perform various statistical queries on stored data, such as histograms, summaries, and trends, and how to visualize this data for users.

15:05

🤖 Using KNN for Recommendations and Similarity Searches

The speaker introduces the k-nearest neighbors (KNN) algorithm supported by Amazon Elasticsearch, which can be used for product recommendations, fraud detection, and similar image searches. The KNN plugin leverages a lightweight algorithm to quickly and efficiently measure distances between vectors. The speaker demonstrates how to use KNN for color-based searches, showing that similar colors can be found even if the exact text is not present in the data.

20:07

🚀 Performance and Cost Optimization for Amazon Elasticsearch

The speaker concludes by discussing strategies for optimizing performance and cost when using Amazon Elasticsearch. They recommend selecting the appropriate instance types based on the workload, adjusting the number of shards to ensure even distribution across nodes, and managing index states to efficiently handle data storage and retrieval. The use of Amazon Elasticsearch's UltraWarm storage for older data was highlighted as a cost-saving measure, along with the service's support for other features like field-level security and anomaly detection without additional costs.

Mindmap

Keywords

💡Solution Architect

A Solution Architect is a professional who designs and plans solutions to business problems, often involving IT systems and infrastructure. In the context of the video, the speaker, Park Ju-Mi, introduces herself as a Solution Architect, indicating her expertise in designing solutions that leverage Amazon Elastic Search Service to enhance service capabilities.

💡Amazon Elastic Search Service

Amazon Elastic Search Service is a fully managed service that allows for the creation of search indexes using the open-source Elasticsearch technology. The service is highlighted in the video as a key component in the speaker's solution architecture, enabling scalable and efficient search functionality without the need for manual server management.

💡Data Analysis

Data Analysis refers to the process of inspecting, cleaning, transforming, and modeling data with the goal of discovering useful information, drawing conclusions, and supporting decision-making. The video discusses how Amazon Elastic Search Service can be used for performing various types of data analysis, such as generating histograms and statistics from web logs.

💡Real-time Search and Analytics

Real-time Search and Analytics is the capability to perform searches and analyze data as it is being collected or generated, without significant delay. The script mentions the need for real-time capabilities in handling the increasing amounts of data, which Amazon Elastic Search Service facilitates by allowing for immediate indexing and querying of data.

💡Indexing

Indexing in the context of search services is the process of creating a data structure that improves the speed of data retrieval operations. The video script describes how data can be indexed in Amazon Elastic Search Service to enable fast and efficient searching, using examples such as product information for a marketplace.

💡KNN (K-Nearest Neighbors)

KNN is a simple, non-parametric machine learning algorithm used for classification and regression. The video explains how Amazon Elastic Search Service supports KNN for recommendations and similarity searches, such as finding similar products or identifying similar images based on vector proximity.

💡Performance Optimization

Performance Optimization involves improving the efficiency and effectiveness of a system or process. The script discusses various strategies for optimizing the performance of Amazon Elastic Search Service, including choosing the right instance types and managing shards effectively to handle different workloads.

💡Cost Optimization

Cost Optimization is the process of minimizing expenses while maintaining or improving quality and performance. The video script provides insights into cost-effective practices when using Amazon Elastic Search Service, such as using different storage options like 'UltraWarm' for older data to reduce costs.

💡Inverted Index

An Inverted Index is a data structure used by search engines to allow fast full-text searches. The video script explains how Amazon Elastic Search Service creates an inverted index in real-time for each field, enabling fast and flexible search operations, regardless of the order of search terms.

💡Vector Search

Vector Search is a method of search that involves representing text, images, or other data as vectors in a multi-dimensional space and finding the closest matches based on vector similarity. The video demonstrates how Amazon Elastic Search Service can perform vector searches using KNN to find similar color values, even when the exact text is not present.

💡API (Application Programming Interface)

An API is a set of protocols and tools for building software applications, allowing different systems to communicate with each other. The video script mentions that Amazon Elastic Search Service provides APIs for various operations, including data indexing, search, and analysis, which simplifies the integration with other services and applications.

Highlights

Introduction to Amazon ElasticSearch Service by Solutions Architect, Park Ju Mi.

Overview of how to enhance services using Amazon ElasticSearch Service.

Explanation of the increasing data due to web, mobile, IoT, and online activities accelerated by COVID-19.

Demand for fast queries, easy setup, operational convenience, strong security, real-time analytics, and machine learning.

The complexity of architecture in meeting these demands with traditional services.

Introduction of Amazon ElasticSearch as a managed service that simplifies deployment and scaling.

Features of Amazon ElasticSearch including visual interface, Kibana, and easy data storage and search.

How to implement search services using Amazon ElasticSearch with a case study of a pet product search.

Comparison of traditional RDBMS search limitations versus the benefits of using ElasticSearch for search functionality.

Demonstration of setting up Korean morphological analysis for search implementation.

Real-time indexing and search capabilities of Amazon ElasticSearch.

Use of APIs for easy integration with other Amazon services for data streaming and storage.

Analysis of web logs using ElasticSearch to provide real-time statistics and visualizations.

Support for SQL queries in ElasticSearch for familiar data querying options.

Introduction to KNN (K-Nearest Neighbors) plugin for recommendation systems and anomaly detection.

Demonstration of KNN search using RGB color vectors for image and product recommendations.

Performance and cost optimization strategies for ElasticSearch including instance selection and index state management.

Use of UltraWarm storage for cost-effective management of older data with less frequent access.

Conclusion summarizing how Amazon ElasticSearch Service can enhance services with practical applications and optimization tips.

Transcripts

play00:00

[음악]

play00:03

wer 으

play00:05

[음악]

play00:15

아 으

play00:21

안녕하세요 저는 솔루션스 아키텍트

play00:23

박주미 입니다 오늘은 제가 사랑하는

play00:26

아마존 엘라스틱 사치 서비스를

play00:28

사용해서 어떻게 우리 서비스의 날개를

play00:30

달아줄 수 있는지에 대해서 함께

play00:32

살펴보도록 하겠습니다 먼저 아 듯

play00:34

아젠다 인데요 먼저 아마존 엘라스틱

play00:37

설치 서비스에 대해서 간단히 소개를

play00:39

드리고

play00:41

아마존 ls31 사용해서 차례대로

play00:44

검색 서비스를 구현하는 방법 분석

play00:47

서비스를 구현하는 방법 그리고 knn

play00:50

추천에 대해서 한번 살펴보도록

play00:51

하겠습니다

play00:53

그리고 마지막으로 구 액 분들이

play00:54

관심이 많은

play00:56

성능 및 비용 최적화 에 대해서도

play00:58

한번 말씀 드리도록 하겠습니다

play01:01

그럼 잠시 아마 전 엘라 티 서치

play01:03

서비스에 대해서 살펴보는 시간을

play01:05

가지도록 하겠습니다

play01:07

왜 아마존 엘라스틱 사치 서비스

play01:09

일까요

play01:12

데이터는 날로 증가를 하고 있습니다

play01:14

예를 들어서 기존의 웹 환경 뿐만

play01:16

아니라 모바일로 진화를 하면서 더

play01:19

많은 사용자들의 행동이 수집 되기에

play01:21

이르렀고

play01:22

대 법수 환경 그리고 자동화된 기기

play01:24

대해서 로 그들이 쏟아져 나오고

play01:27

있습니다

play01:29

그리고 iot 커넥티드 카 와 같은

play01:31

4배수 들로 로깅 가 체어

play01:34

이런 데이터들이 상상 이상으로 쏟아져

play01:36

나오고 있구요 또 코로나 로 업무

play01:39

쇼핑 에 이르기까지 삶의 많은 부분이

play01:41

온라인으로 이동을 했고 이런 것들이

play01:44

데이터 생산을 더 가속하는 원인이

play01:47

되고 있습니다

play01:49

그에 따라서 데이터에 대한 요구

play01:50

사항은 점점 늘고 있죠 여기 보시는

play01:53

빠른 질의 2 4등 닭 쉬운 설치

play01:56

운영 편의성 보안 강력한 분석 실시간

play02:00

대시보드 머신 러닝 이런 것들이 바로

play02:03

그런 요구 사항 이라고 보시면 됩니다

play02:06

이런 요구사항들이 개발자 인 나에게로

play02:09

왔을 때 정신을 차려보면

play02:12

이러는 항상 적고 살펴볼 서비스

play02:14

굉장히 많습니다

play02:16

이런 요구사항을 살펴보다 보면 많은

play02:19

서비스 들을 살펴 보게 되고요

play02:21

정신을 차려보면 이렇게 복잡한

play02:23

아키텍처가 제압해 있습니다 정말

play02:25

이렇게 많은 서비스 들로 복잡한

play02:27

아키텍처를 만드는게 정답일까요

play02:31

아닙니다 여기 이렇게 아마존 엘라스틱

play02:33

서치 서비스라는 제가 정말 좋아하는

play02:36

히어로 서비스가 하나 있습니다

play02:39

아마존 엘라 티 서치 서비스로 다양한

play02:41

문제를 어떻게 해결할 수 있는지

play02:42

지금부터 살펴보도록 하겠습니다

play02:46

일단 아마존 엘라스틱 서치 서비스는

play02:48

오픈 소스 고요 완전 관련 이기

play02:50

때문에 aws 콘 선에서 생성하면

play02:54

개별 서버에 들어가셔서 컴프 개 레이

play02:56

션 하거나 하실 필요없이 이렇게

play02:58

비쥬얼 아이즈 할 수 있는 키바 나와

play03:01

엘라스틱 서치 클러스터가 바로 제공이

play03:03

됩니다

play03:04

그래서 배포 유형 이라던가 버전

play03:07

그리고 인스턴스 타입을 왼쪽과 같이

play03:10

고르시면

play03:12

보시는 바와 같이 바로 시작을

play03:14

하실수가 있습니다

play03:15

생성을 하고

play03:17

잠시후 면 바로 엘라스틱 설치와 키바

play03:20

나에 대한 & p 주소가 나옵니다

play03:23

바로 데이터를 저장하고 키바 나의

play03:25

검색을 해 보실 수가 있는 거죠

play03:28

아마존 알라 c 터치 서비스 를

play03:30

사용하시면 콘솔이나 cli 를 통해서

play03:32

쉽게 인스턴스의 변경 그리고

play03:36

업그레이드를 하실 수가 있구요 그래서

play03:38

플러스터 에 대한 모니터링 및 확장에

play03:41

아주 쉽습니다

play03:42

또 주기적인 데이터 관리를 위한 핫

play03:45

모험 스토리지 적요 그리고 삭제를

play03:47

인덱스 상태 관리를 통해서 쉽게

play03:50

적용을 하실수가 있습니다

play03:52

이 모든 것이 api 로 이미

play03:54

제공되고 있어서 서비스 적용 시에

play03:57

쉽게 추가적인 api 의 구성을

play03:59

하실수가 있고 기반 화를 통한 빠른

play04:01

대시보드를 구성을 하실수가 있습니다

play04:04

덕분에 적은 인원으로 실시간 검색

play04:07

그리고 분석을 진행하실 수가 있는

play04:09

거죠

play04:11

모든게 a 폐로 이루어지기 때문에

play04:13

cell 명령 을 통해서도 쉽게

play04:15

데이터를 넣을 수가 있구요

play04:17

보시는 것처럼 제이슨 으로 원하는

play04:20

데이터를 구조화 해서 포스 틈에서

play04:23

도로 인덱싱 을 하시면 됩니다

play04:26

이렇게 잘 마련된 api 와 함께

play04:28

저희 아마 전 서비스 들과도 쉽게

play04:31

연동이 되는데요 보시는 바와 같이

play04:33

컴퓨팅 자원 에서 apa 칼라 이벤트

play04:37

등을 사용해서 바로 데이터를 넣으실

play04:39

수가 있구요 또 디비나 s3 등

play04:42

다양한 소스에서 이벤트 처리 혹은

play04:45

데이터 스트림 그리고

play04:47

어이 mr 하드 환경에서도 쉽게

play04:49

데이터를 저장을 하실 수가 있습니다

play04:52

그래서 어떤 아키텍처 에서도 쉽게

play04:55

아마 전 엘라 티 서치 서비스를

play04:57

넣으실 수 가 있어요

play05:00

이렇게 저장된 데이터를 왼쪽처럼

play05:02

실시간으로 커즈 해보시거나

play05:06

기반 와 를 통해서 오른쪽처럼

play05:07

시각화를 해보실 수도 있죠

play05:10

그리고 지금 보시는 것들이 모두

play05:11

api 를 통해서 동작을 하고 있기

play05:13

때문에 우리 서비스의 바로 연결해서

play05:16

사용하는 하실수가 있습니다

play05:19

그럼

play05:20

아마존 엘라스틱 서치 서비스를

play05:22

사용해서 검색을 한번 만들어 보도록

play05:24

하겠습니다

play05:25

최근에 고객분들과 검색 관련

play05:27

요구사항을 아마존 엘라스틱 서치

play05:30

서비스로 해결 했구요

play05:32

관련해서 자주 말씀하시는 사례를

play05:34

기반으로 시다 리오를 하나

play05:36

만들었습니다

play05:37

실제로 고객분들이 한달정도 안에

play05:40

검색을 서비스의 도입을 하셨습니다

play05:43

여기 보시면

play05:45

양양 일을 좋아하는 사람들을 위한

play05:46

양양 막힐 수 있고요

play05:49

약력 마켓은 기존의 rdb rdb 의

play05:52

검색 용으로 따로 데이터를 처리를

play05:55

해서 저장을 하고

play05:56

라이트 커리를 통해서 사용자에게 검색

play05:59

기능을 제공하고 있었습니다

play06:01

이렇게 진행하시는 경우에 결국 이런

play06:04

문제들을 겪게 됩니다

play06:05

검색이 들면서 허리 성능에 문제가

play06:08

생기게 되구요

play06:09

형태에서 분석이 되지 않기 때문에

play06:11

고양이용 레이저 포인터로 검색 씨의

play06:14

고향 이라는 단어가 검색이 안될 수도

play06:16

있고

play06:17

동의어 등에 대한 검색이 지원되지

play06:19

않아서

play06:21

양양이 로 검색을 하실때 고양이

play06:23

검색이 되지 않으실 수도 있습니다

play06:26

또 랭킹을 직접 만들어야 되고 이런

play06:29

모델의 운영은 굉장히 어려울 수가

play06:31

있습니다

play06:32

지금 보시는 것이 기존 아키텍처

play06:34

이고요 rdb 를 사용해서 왼쪽처럼

play06:36

파트 노사가 등록한 상품을 rdb 에

play06:39

넣고 고객들이 오른쪽처럼 rdb 에서

play06:43

라이트 검색을 하시는 거죠

play06:45

rdb 를 사용해서 화장실 검색 씨의

play06:47

보시는 바와 같이 위에서 아래도

play06:50

하나하나 라이크 로 많은 검색을

play06:53

찾아서 동작을 하게 되지만

play06:55

문서가 많아지면 느려지고 트림을

play06:58

사용해서 공백을 없앤다 거나 해도

play07:00

여러 단어 검색 시에는 검색어에

play07:03

순서에 따라서 찾지 못하는 문서들 도

play07:06

나옵니다

play07:09

검색엔진은 이런 검색을 위해 인버티드

play07:12

인덱스를 가지고 있고 해당 단어에

play07:14

대해서 어떤 문서들이 이 단어를

play07:17

가지고 있는지 저장해 놓는 형태입니다

play07:20

이런걸 인버티드 인 디스 라고

play07:22

부릅니다

play07:24

그래서 화장실을 검색하면 바로 어떤

play07:27

문서들의 있는지를 알 수가 있게 되고

play07:29

단어의 순서를 상관이 없이 빠르게

play07:32

검색이 가능해 지는 거죠

play07:36

lsc 는 이렇게 필드 마다

play07:39

임대 킹을 실시간으로 진행을 하고

play07:41

검색 씨의 결과를 리턴 을 해줍니다

play07:45

보시면 왼쪽에 문서가 하라 보이는데요

play07:48

여기에 있는 각 필드에 대해서 텀

play07:51

그러니까 단어들을 분석을 해서 아까

play07:53

말씀드린 인버티드 인덱스로 저장을 해

play07:56

놓는 거죠

play07:57

그럼 검색어가 들어왔을 때 다음과

play08:00

같이 검색 단어 즉 텀 에 대해서

play08:04

대상 문서를 중 맞는 문서를

play08:06

랭킹에 따라서 우리에게 이렇게 빠르게

play08:09

돌려주게 됩니다

play08:14

그래서 이런 상품등록 씨의 기존에는

play08:16

검색을 위한 데이터를 따로 처리를

play08:19

하셔서

play08:20

rdb 에 넣었다면 이제는 이

play08:22

데이터를 제이슨 형태로 ls 설치

play08:25

서비스의 이렇게 넣어 주시기만 하면

play08:28

검색이 완성이 됩니다

play08:31

그럼 제가 한국어 검색을 아주 빠르게

play08:33

구현하는 것을 한번 보여 드리도록

play08:35

하겠습니다

play08:40

먼저 이렇게 세팅 새 한국어 형태소

play08:43

분석을 위한 언어 라이저 설정을 하고

play08:45

요 밑에 보시면 맵핑 에서 형태소

play08:49

분석을 할 필드 들을 저렇게 지정을

play08:51

해 줍니다

play08:52

보시면 타이틀과 다른 필드에서 저장할

play08:56

때 또 검색할 때에 비해서 위에 세팅

play08:58

3 에서 설정한

play09:00

마이어 널 라이저 를 사용하도록 해서

play09:02

형태소 분석을 하도록 했습니다

play09:07

그리고 보시는 것처럼 고양이 오뚜기

play09:10

장난감 과 고양이 환자 등 화장실

play09:13

제품 2개를 인덱싱 을 했습니다

play09:15

보시면 상품명과 브랜드 카테고리

play09:20

그리고 가격정보를 넣어서

play09:22

텍스트로 검색을 하시거나 아니면

play09:24

가격대별로 검색을 가능하도록 이렇게

play09:26

두가지 문서를 저장 해봤습니다

play09:33

이렇게 이 백신을 하자마자

play09:36

여기 보시는 것처럼 자연어 로

play09:38

고양이가 수역 좋아할 화장실 이라는

play09:42

검색어에도 적절한 상품이 검색이 되는

play09:45

것을 보실 수가 있습니다

play09:47

자연어 로 검색이 되는 거죠 그럼

play09:50

랭킹도 잘 관리된 지 보기 위해서

play09:52

문서를 하나 추가해 보도록 하겠습니다

play09:55

문서를 보시면 고양이 화장실 이란

play09:59

단어가 etc 필드에 저렇게 초록색

play10:01

처럼 더 많이 들어간 문서입니다

play10:04

검색할 단어 가 더 많이 들어가면

play10:07

검색이 좀 더 잘 돼야 될 것

play10:08

같습니다

play10:11

그래서

play10:12

초록색으로 이렇게 하이라이트 한

play10:14

것처럼

play10:15

타이틀만 으로 대상을 했을 때는

play10:17

대상으로 검색을 했을 때는 캡 범

play10:20

고양이

play10:21

반자동 화장실이 더 검색 결과 상위를

play10:23

차지 하지만 새로 넣은 문서와 스콘은

play10:27

비슷한 것을 확인하실 수가 있습니다

play10:29

밑에가 새로 넣은 문서 이고요

play10:31

반대로 타이틀 만이 아닌 전체 필드에

play10:34

대해서 검색을 하면 새로 추가한

play10:36

문서가 더 상위를 차지하는 것을 보실

play10:38

수가 있습니다

play10:39

ls 터치 서비스는 bm 2nd

play10:41

파이브 알고리즘을 사용을 하는데요

play10:44

쉽게 문서 내에서 단어의 빈도 수가

play10:47

높을수록 그리고 많은 문서에서 흔히

play10:50

발견되지 않는 단어일 수도 점수를

play10:52

놓게 준다고 보시면 됩니다

play10:54

문서를 저장하면 이렇게 랭킹이 알아서

play10:57

반영이 됩니다

play10:59

추가로 또 이런 스코 에 대해서도

play11:01

원하시는 설정이 가능 하시구요

play11:04

고양이를 양양이 로 검색하기 위한

play11:07

동의와 사전 등도 쉽게 추가를 하실

play11:10

수가 있습니다

play11:15

그래서 일반적으로는 이렇게 원하시는

play11:18

상품이나 컨텐츠의 데이터를

play11:21

어 다이나모 db 에 저장을 하시고

play11:22

해당 상품정보를 인덱싱 해서 바로

play11:26

검색에 안녕을 하실수가 있습니다

play11:29

여기 보시는 게 그런 아키텍처 이고요

play11:35

또 s3 의 이미지가 올라오면 이런

play11:38

이미지에 대해서

play11:40

남 다 가 자동으로 트리거 링 되서

play11:43

레코 게 네이션 api 에 집일 하고

play11:44

또 이런 사진에 대한 라벨 정부를

play11:47

추가를 하실 수가 있는데요 이

play11:49

이미지의 s3 위치와

play11:52

또 추가된 라벨 정도를

play11:56

아마존 ls 서비스의 넣어서 이미지에

play11:59

대한 검색을 만드실 수도 있습니다

play12:02

그럼 이번에는 분석도 한번 살펴보도록

play12:04

하겠습니다

play12:06

저는 데이터 블레스 에 조인 하기

play12:08

전에 국내에 가장 큰 포탈에 건 널리

play12:11

쓰 서비스와 블로그 카페 뉴스 쇼핑

play12:16

통계를

play12:17

ls 서치 서비스로 만든 경험이

play12:18

있습니다

play12:20

우리나라 대부분이 사용하는 포털에서

play12:23

통계 를 지원하기 위해 제가 여러가지

play12:26

ng 를 검토를 했었는데요

play12:28

lsc 가 운영 성능 통계 지원

play12:33

그리고 확장 api 구성 등에 대해서

play12:36

가장 적은 비용이 들었습니다

play12:39

물론 성능은 말할것도 없구요

play12:45

그래서 우리가 서비스를 하다보면 서버

play12:48

로그 혹은 제이슨 우 같은 다양한

play12:50

데이터들이 이렇게 발생을 하게 됩니다

play12:53

ls 서치 는 저장된 데이터에 대해서

play12:56

다양한 통계 쿼리를 제공하는데요

play12:59

오른쪽에 보시는 것처럼 히스토그램 썸

play13:02

이맥스 터 뭐 그 레이션 등 굉장히

play13:05

다양한 분석할 이를 지원을 합니다

play13:12

웹 로그를 예로 들어보면 여기 보시는

play13:15

것처럼 유저 에이전트 호스트 ip

play13:18

위치 정보 그리고 os 등 다양한

play13:22

정보를 가지고 있구요

play13:24

이런 정보를 지속적으로 lsc

play13:27

서비스의 저장을 하시고 쉽게 분석을

play13:29

하실 수가 있습니다

play13:31

저희가 sl 그룹 빠이 파운 틀을

play13:35

하시는 것처럼 터 뭐 그리 게이

play13:37

션으로 api 를 사용해서 각 os

play13:40

별로 방문한 횟수를 실시간으로 보실

play13:42

수가 있습니다

play13:44

왼쪽에 보시면 커리에 대한 os 별

play13:48

카운트가 결과로 이렇게 리스판스 로

play13:51

나오게 되고

play13:52

기반 아 등으로 시각화를 해서 이런

play13:54

통계가 사용자에게 다시 제공될 수

play13:56

있는 거죠

play13:58

또 유니크 카운트를 위해서 이렇게

play14:01

카디널 리티 커리를 사용해서 유익한

play14:03

방문자수를 구하실 수도 있습니다

play14:07

보시면 키바 나도 내부적으로는 이렇게

play14:09

쿼리를 사용해서 시각화를 해 준다고

play14:11

보시면 됩니다

play14:14

방금 말씀드린 엘라 스 쌓지 커리가

play14:16

어렵다면 요 sql 5도 허리를

play14:18

하실수가 있습니다

play14:20

아마존 엘라 티 서치 서비스는

play14:22

라이센스 등의 추가 구매 없이 sql

play14:25

쿼리를 지원하고 있습니다

play14:27

여기 보시는 것처럼 sql 자체를

play14:29

api 에 넣어서 질의를 하시면

play14:32

오른쪽과 같은 결과를 봐 주실 수가

play14:35

있습니다

play14:37

저에게 익숙한 spa 를 사용해서

play14:39

아까

play14:41

os 벨 방문자수를 똑같이 보실 수도

play14:43

있고요

play14:44

왼쪽에 보시면 터 뭐 그리 게이 션

play14:46

카이로 구했던 os 벨 박문수 를

play14:49

동일한 sql 로 똑같이 구하시는

play14:51

것을 보실 수가 있습니다

play14:55

또 여기 보시면 아까 방문자 수에서

play14:58

에 대해서도 동일하게 sql 쿼리로

play15:01

도 지리를 하셔서 같은 결과를 얻으실

play15:04

수가 있습니다

play15:05

왼쪽의 쿼리 결과가

play15:07

비쥬얼 라이즈는 까지 이렇게 동일하게

play15:09

갈 수 있는 거죠

play15:13

그럼 추천 서비스도 한번

play15:14

살펴보겠습니다

play15:17

아마존 엘라스틱 서치 서비스는 케인의

play15:19

플러그인을 지원을 하고 있습니다

play15:21

사람은 끼리끼리 놀기 때문에

play15:23

착한 사람은 착한 사람 나쁜 사람은

play15:25

나쁜 사람끼리 모여 있다고 상상을 해

play15:27

보겠습니다

play15:28

그랬을 때 여기 노란 사람이

play15:30

보이는데요 노란색 동그라미

play15:32

노란 사람과 가까운 사람 사용한 봤을

play15:34

때는 이 사람이 나쁜 사람이 더

play15:37

많아서 나쁜 사람일 수가 있고

play15:39

6명을 보면 착한 사람이 더 많기

play15:41

때문에

play15:43

착한 사람들이라고 볼 수 있습니다

play15:45

사실은 뭐 그저 그런 사람일 수

play15:47

있고요

play15:49

그래서 이 knn 을 사용하면 비슷한

play15:51

벡터를 가진 제품 추천 사기 탐지

play15:54

유사이미지 또 심해 틱한 문서 검색을

play15:57

하실 수가 있게 되구요

play15:59

경량 알고리즘을 사용해서 속도가

play16:01

빠르고 효율적입니다

play16:04

가까운 거리를 측정하기 위해서

play16:05

유클리드 1 디스턴스 코 4s 밀라

play16:08

지지를 제공하고 있구요

play16:10

아마존 엘라스틱 서치 서비스를 사용

play16:12

하시면 바로 사용이 가능합니다

play16:16

데모를 보시기 전에 잠시 설명드리면

play16:18

rgb 는 색을 rgb 각각의 대해서

play16:22

2 0 에서 255 숫자로 나타내고

play16:26

비슷한 값을 가지면 비슷한 색이라고

play16:27

보시면 됩니다

play16:29

만약 텍스트 검색 으로 블루 라는

play16:31

텍스트 검색을 하시면 블루 라는

play16:33

단어가 있어야만 검색이 되는데 knn

play16:37

으로 블루 세계 rgb 까 그러니까

play16:40

벡터 로 검색을 하면 울트라 말인가

play16:43

같이 어 단어가 아닌 유사한 색상

play16:46

검색도 가능해 지는 거죠

play16:49

이 예제에서 에 대해서 잠시 데모를

play16:51

한번 보여 드리도록 하겠습니다

play16:54

여기 보시는 것처럼 엘라스틱 서치

play16:56

서비스를 클릭을 하고요

play16:57

미리 만든 knn 클러스터의 들어가서

play17:00

키바 나로 접근해 보겠습니다

play17:03

기반 하에서 대부 출수를 클릭을 하면

play17:05

이렇게 esl 쿼리를 던질 수 있는

play17:08

화면이 나오는데요

play17:09

여기에서 컬러 값으로 knn 추천 얼

play17:12

할 인덱스를 하나 만들어 보겠습니다

play17:14

그리고 보시는 것처럼

play17:16

어 생성이 되었고요

play17:19

이제 콘솔에 가서 보시는 것처럼

play17:21

플러스 점 csv 에 미리 색상

play17:24

데이터를 제 pc 에 다운로드

play17:25

해놨는데

play17:26

보시면 색상이 이름과 rgb 값들이

play17:28

저장이 되어 있는 것을 보실 수가

play17:29

있습니다

play17:31

이 데이터를 로그 스탯이 를 통해서

play17:33

어이 엘라 스 서치 서비스의 넣어

play17:34

보도록 하겠습니다

play17:35

보시면

play17:36

임프 3 더 데이터 위치가 지정 되어

play17:39

있고요

play17:39

필터의

play17:41

보시면 다 필드 들을 저장을 하고

play17:44

rgb 값 들로부터 knn 용 벡터

play17:46

로 쓰일 rgb 백제를 필드를 1

play17:48

추가를 했습니다

play17:49

그리고 아웃은 jls 서 t 로

play17:52

지정을 했구요

play17:55

보시면 지금 저희가 생성한 인덱스에서

play17:58

rgb 팩터 와 데이터에서 넣어주는

play18:01

알지 벡터가 같은 것을 보실 수가

play18:02

있습니다

play18:09

그럼 이제 로고 쎄씨 로 데이터를

play18:12

한번 넣어 보도록 하겠습니다

play18:14

이렇게 루스 10 명령으로 데이터

play18:17

이렇게 되면 데이터들이 들어가게

play18:18

되고요

play18:20

데이터가 많지 않아서 아마 등 각

play18:22

들어가게 될겁니다

play18:29

데이터가 다 들어가면 잘 들어갔는지

play18:31

다음과 같이 써 치커리 로 한번

play18:33

확인을 해보실 수가 있고요

play18:36

지금 보시면 커리를 하고

play18:39

결과에서 865 개 데이터가 들어간

play18:42

것을 확인을 하실수가 있습니다

play18:46

다음으로 우리가 기존처럼 텍스트

play18:48

검색을 한 하던 블루 로 검색을 한번

play18:50

해볼 겁니다

play18:51

보시면

play18:52

검색 결과의 블루 라는 단어들이

play18:54

들어간 것만 나오고 있고요

play18:56

이번에는 그 다음에는 rgb 벡터로

play18:59

블루 색상의 벡터로 검색을 한번

play19:01

해보도록 하겠습니다

play19:03

잘 보시면

play19:06

즉 예 지금 검색을 해 볼텐데요 rg

play19:09

벡터로 검색을 하고 나면

play19:13

기존의 블루 텍스트가

play19:15

검색이 안 되던 것들이 블루계열

play19:17

세상들이 벡터로 인해서

play19:20

일렉트릭 울트라마린 같은 세상이

play19:22

검색되는 것을 보실 수가 있을 겁니다

play19:24

4 텍스트는 검색할 수 없는

play19:26

부분이고요

play19:30

다음은 핑크로 한번 검색을

play19:31

해보겠습니다

play19:32

마찬가지로 텍스트로 검색 시에는 핑크

play19:34

라는 글자가 들어있는 문서들이 검색이

play19:36

되고 있고요

play19:38

다시 핑크에 rgb 벡터로 검색을

play19:40

했을 때는

play19:42

버블껌 이라는 세상이 검색이 될

play19:43

텐데요

play19:45

한번 저희가 검색을 통해서 이걸 보게

play19:48

되시면

play19:50

버블껌 2

play19:51

핑크 새 행성 껍 색깔인 것을

play19:54

확인하실 수가 있습니다

play19:56

그래서 이렇게 비슷한 색상을 텍스트가

play19:59

아닌 벡터로 검색을 해 보셨고 요

play20:02

데모에서 보신 것처럼 이런 knn 을

play20:04

사용해서 머신 언행을 통해 이미지

play20:07

벡터 를 추출해 내고 이 벡터를

play20:09

저장해 놓으시면 우리가 좋아하는

play20:11

원피스에 대한 사진을 커리 로 해서

play20:13

유사한 상품을 추천을 해 주실 수가

play20:15

있습니다

play20:16

혹은 버트 같은 모델을 통해서 언어에

play20:19

대해서도 벡터 모델이 있다면

play20:21

결혼 드레스 라는 검색어로

play20:23

웨딩드레스에 대한 결과를 얻으실 수도

play20:25

있는 거죠

play20:27

마지막으로 성능과 비용 최적화에

play20:29

대해서 알아보도록 하겠습니다

play20:32

엘라스틱 서치 는 다양한 인스턴스 를

play20:34

제공하고 있습니다

play20:35

검색 영도로 어 형태소 분석을 사용

play20:38

하 고 인덱싱 될 테스트가 많으면

play20:40

cpu 를 많이 사용할 수가 있고요

play20:42

어글이 게이 션 커리가 많은 경우에는

play20:44

메모리를 많이 사용할 수도 있습니다

play20:46

위에는

play20:47

보시는 표는 저희 블로그를 좀 제가

play20:50

최신 할을 해 본 건데요

play20:53

링크에 있는 것을 최신화 해 본 거고

play20:55

데이터 양이나 워크로드 특성에 따라서

play20:57

클러스터 구성 시에 참고를 하시면

play20:59

좋을 것 같습니다

play21:00

세부적인 인스턴스 선택은 직접

play21:02

테스트를 해 보시기를 추천해드립니다

play21:07

고객문의 중에 성능에 관련된 문의가

play21:10

많은데요 간혹 잘못된 사용으로 아마존

play21:13

엘라스틱 서치 서비스 의 성능을

play21:14

최대한 활용 못하시는 경우들이

play21:16

많습니다

play21:17

예를 들어서 샤드 수를 설정 시에

play21:20

현재 노드 스에 잘 분포되어 수 있는

play21:23

숫자 인지를 감안하셔서 만약에 세대가

play21:25

운영 중이시라면

play21:27

어 샤드 수를 세계 혹은 6개 등으로

play21:29

지정을 하셔서 특정 노드의 읽기나

play21:31

쓰기가 몰리지 않도록 해주시면

play21:33

좋습니다

play21:34

또 운영상 노드를 추가하거나

play21:37

리플리케이션 수를 바꾸실 때는

play21:39

밸런싱 과 같은 작업 때문에 샤드 가

play21:41

이동을 하거나 복사 되면서 io 가

play21:44

늘어날 수가 있습니다 이런 작업은

play21:46

사용자 커리가 많은 시간을 피해서

play21:48

진행해 주시면 좋을 것 같습니다

play21:52

또 하나의 샤드 가 너무 크거나 또

play21:54

샤드 가 너무 많은 경우 불필요한 이

play21:57

소스를 많이 사용하거나 또는 병

play21:58

결성을 해칠 수가 있습니다 그래서

play22:00

저장되는 샤드 의 크기를 보시고

play22:02

적절한 용량에 맞게 샤드 수를 조절해

play22:05

주시고 또 벌크 아닌데 싱이 필요한

play22:08

시점에 는 리프레시 인터 벌을 늘려

play22:11

주시는 것이 좋습니다

play22:12

기본이 1초 로 되어있는데요 이

play22:14

설정에 따라서 성능에 영향을 많이

play22:16

받습니다

play22:17

또 많은 문서들을 한꺼번에 인덱싱 을

play22:19

진행하실 때는

play22:21

국제 분수를 줄이 셔서 한 번에

play22:23

라이트 하는 양을 줄이시고

play22:25

나중에 한가한 시간에 복제본 수를

play22:27

늘려서 자신의 복제 분수를 맞추시는

play22:29

이런 방법을 취할 수 취하시는 것을

play22:32

좋습니다

play22:35

비용 관련해서도 질문을 주시는 되요

play22:37

정말 필요한 필드만 저장 되는지

play22:39

확인을 해주시고

play22:41

제 경우에는 키워드 로 저장하면 되는

play22:43

필드를 텍스트로 잘못 저장해서 저장

play22:45

공간과 cpu 리소스를 남겼던 경험이

play22:48

있습니다

play22:49

이런 부분도 잘 살펴 봐 주시면 좋을

play22:51

것 같습니다

play22:52

그다음 보시는 것처럼 인덱스 상태를

play22:55

활용하셔서 필요하신 기간에 데이터만

play22:58

효과적으로 관리 하시기를 추천해

play23:00

드립니다

play23:01

최근 저장되고 자주 커리 되는

play23:03

데이터는 하 스토리즈 에 그리고 7일

play23:06

프 아 눈 7화 같이 일정 기간이

play23:09

지난 데이터는 가격이 저렴한 웜

play23:11

스토리지로 이동을 하시고

play23:13

90일이 지난 문서를 삭제하는 이런

play23:15

정책을 정하셔서 적용을 하시면

play23:18

아마존 엘라스틱 설치가 알아서 이런

play23:21

데이터를 관리를 해주고 비용

play23:23

측면에서도 제한적으로 운영을 하실

play23:25

수가 있습니다

play23:27

방금 말씀드린 웜 스토리지를 위해서

play23:30

아마 전 ls 서치 서비스에서는

play23:32

울트라 웜 스토리지를 제공을 하고

play23:34

있습니다

play23:35

s3 데이터를 최적화 해서 한 개의

play23:37

세그먼트로 저장을 해 주고 어 내구성

play23:40

미 의 가용성을 확보 하면서도

play23:41

불필요한 리플리케이션 을 없애 주기

play23:44

때문에 기존의 예약 인스타 쓰 사용시

play23:46

보다 케이스에 따라서 약 75% 까지

play23:49

더 저렴하게 사용 하시면서도

play23:52

hdd 로 구성 하시는 것 보다 약

play23:54

2배 빠른 성능을 제공해 주고

play23:56

있습니다

play23:59

인덱스 상태 관리 돼서 그림으로 좀더

play24:02

표현해 보면 그림과 같이 최근

play24:04

데이터는 핫 스토리지에 저장을 하시고

play24:07

7일이 지난 데이터는 울트라 웜

play24:09

스토리지로 이동해서 비용을 절약하실

play24:11

고 90일이 지난 데이터는 자동으로

play24:14

삭제된다 고 보시면 됩니다

play24:16

각 데이터 에 따라서 이렇게 인덱스

play24:18

상태를 잘 관리해 주시면 좋습니다

play24:23

4 짧은 시간동안 저희는 검색 서비스

play24:25

데이터 분석 knn 추천 성능 및

play24:28

비용 최적화 를 살펴보면서

play24:30

저희가 어떻게 아마존 lite 터치

play24:32

서비스를 사용해서 우리 서비스를

play24:34

향상시킬 수 있는지 살펴봤습니다

play24:37

추가로 시간상 살펴보지 못한 눈 서

play24:40

필드 단위의 수준의 엑세스 제어 와

play24:42

같은 보안 그리고 어 랜덤 커

play24:45

포레스트 를 사용하는 뭐 언어 말리

play24:46

디텍션 등도 특별한 추가 비용 없이

play24:49

지원이 되니 한번 살펴보시면 좋을 것

play24:51

같습니다

play24:53

마지막으로 세션에 대해서 소중한

play24:54

피드백을 해주시면 감사하겠습니다

play24:57

제 3 션에 귀중한 시간을 내주셔서

play24:58

감사드립니다

Rate This

5.0 / 5 (0 votes)

Related Tags
Amazon Elastic SearchReal-Time SearchAnalyticsMachine LearningService OptimizationData ManagementPerformance TuningCost EfficiencySearch EngineAI Solutions