본문 바로가기
개발/ALGOLIA

알고리아 Managing Results(3-23)

by dev_caleb 2022. 3. 4.
728x90

Understanding Replicas

https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/

 

Understanding replicas | Algolia

What are replicas and how do you handle them.

www.algolia.com

By design, Algolia provides one ranking formula per index. Every index has a unique sorting strategy, which is statically defined at the index level, and can’t be changed at query time. Pre-sorting at indexing time instead of at query time leads to a considerable performance boost.

설계상 알골리아는 index당 하나의 순위 공식을 제공한다. 모든 인덱스에는 인덱스 수준에서 정적으로 정의되는 고유한 정렬 전략이 있으며 쿼리 시 변경할 수 없습니다. 쿼리 시간이 아닌 인덱싱 시간에 사전 정렬하면 성능이 크게 향상됩니다.

When you want to provide different rankings for the same data, you need to use replica indices.

Algolia provides primary/replica relationships to let you automatically replicate the content of one index (the primary) onto other indices (the replicas) and synchronize content changes.

Algolia offers two flavors of replicas, standard and virtual replicas. You can choose either one or the other depending on your needs.

동일한 데이터에 대해 다른 순위를 제공하려면 복제본 색인을 사용해야 합니다.
Algolia는 하나의 색인(기본)의 내용을 다른 색인(복제본)에 자동으로 복제하고 내용 변경사항을 동기화할 수 있도록 기본/복제 관계를 제공합니다.
알골리아는 표준 복제본과 가상 복제본의 두 가지 맛을 제공합니다. 필요에 따라 둘 중 하나를 선택할 수 있습니다.

What are standard replicas?

Standard replicas are linked to their primary index: a standard replica copies its primary index’s content, but can have different settings. Though linked to its primary, a standard replica is a separate index. This means standard replicas increase the number of records on your application.

표준 복제본은 기본 색인에 연결되며, 표준 복제본은 기본 색인의 내용을 복사하지만 다른 설정을 가질 수 있습니다. 표준 복제본은 Primary에 연결되어 있지만 별도의 인덱스입니다. 이것은 표준 복제본이 응용프로그램의 레코드 수를 증가시킨다는 의미입니다.

 

 

Standard replicas have the exact same data as their primary index, and Algolia handles the data synchronization for you. Every time you add, update, or delete records in your primary index, your replica is automatically modified. You can’t alter this automatic data synchronization.

For example, you can’t directly add, update, or delete records in your replica indices. Standard replicas start with the exact same settings as their primary index. However, you can change a replica’s settings.

The most common modifications to a replica’s settings are to its exhaustive sorting strategy.

 

표준 복제본은 기본 인덱스와 동일한 데이터를 가지고 있으며, 알고리아는 사용자를 위해 데이터 동기화를 처리합니다. 기본 색인의 레코드를 추가, 업데이트 또는 삭제할 때마다 복제본이 자동으로 수정됩니다. 이 자동 데이터 동기화는 변경할 수 없습니다.
예를 들어, 복제본 색인의 레코드를 직접 추가, 업데이트 또는 삭제할 수 없습니다. 표준 복제본은 기본 색인과 동일한 설정으로 시작합니다. 그러나 복제본의 설정을 변경할 수 있습니다.
복제본 설정에 대한 가장 일반적인 수정사항은 전체 정렬 전략입니다.

 

 

What are virtual replicas?

Unlike standard replicas, virtual replicas don’t copy their primary index’s content. While they slightly increase the primary index’s size (less than 10 MB per millions records), they don’t affect the number of records on your application.

Virtual replicas are optimized for the Relevant sort feature.

표준 복제본과 달리 가상 복제본은 기본 색인의 내용을 복사하지 않습니다. 기본 인덱스의 크기(백만 개의 레코드당 10MB 미만)는 약간 증가하지만 응용 프로그램의 레코드 수에는 영향을 미치지 않습니다.
가상 복제본은 관련 정렬 기능에 최적화되어 있습니다.

You can create 10 virtual replicas per index. If you need to create more, you can contact support to increase this limit.인덱스당 10개의 가상 복제본을 만들 수 있습니다. 더 만들어야 하는 경우 지원팀에 문의하여 이 제한을 늘릴 수 있습니다.

Data synchronization and settings in virtual replicas

Virtual replicas can be seen as a view of their primary index, meaning that virtual replicas directly access their primary index’s records. Since a virtual replica uses the same data as its primary, every time you add, update, or delete records in your primary index, the modifications are found in your replica. You can’t alter this automatic data synchronization.

For example, you can’t directly add, update, or delete records in your replica indices.

The most common modifications to a virtual replica’s settings are to its relevant sorting strategy.

가상 복제본은 기본 색인의 보기로 볼 수 있으므로, 가상 복제본은 기본 색인의 레코드에 직접 액세스합니다. 가상 복제본은 주 복제본과 동일한 데이터를 사용하므로, 주 색인의 레코드를 추가, 업데이트 또는 삭제할 때마다 복제본에서 수정 사항이 발견됩니다. 이 자동 데이터 동기화는 변경할 수 없습니다.
예를 들어, 복제본 색인의 레코드를 직접 추가, 업데이트 또는 삭제할 수 없습니다.
가상 복제본의 설정에 대한 가장 일반적인 수정은 관련 정렬 전략입니다.

 

 

How do standard and virtual replicas compare?

If it’s not obvious for you to choose between standard and virtual replicas, you can refer to the comparison table below.

One rule of thumb to decide between virtual or standard replicas is your desired sorting strategy. If you need an exhaustive sort, you should pick standard replicas. If you need to use Relevant sort you should pick virtual replicas.

Standard ReplicasVirtual Replicas

표준 복제본과 가상 복제본 중에서 선택해야 하는 항목이 명확하지 않은 경우, 아래의 비교 표를 참조할 수 있습니다.
가상 복제본과 표준 복제본 중 하나를 결정하는 경험적 규칙은 원하는 정렬 전략입니다. 완전한 정렬이 필요한 경우, 표준 복제본을 선택해야 합니다. 관련 정렬을 사용하려면 가상 복제본을 선택해야 합니다.
                                              표준 복제본                                                   가상 복제본

Usage Optimized for exhaustive sorting strategy Optimized for the Relevant sorting feature
Data Automatically synchronized as a copy of the primary Automatically synchronized, as they use the same data as their primary
Impact on number of records Increase the number of records Don't increase the number of records
Supported settings Support all index settings Support a subset of index settings
Rules Support different Rules Support different Rules
Synonyms Support different Synonyms Support different Synonyms, except placeholders.

Managing replicas

Creating replicas

Multiple ranking formulas are useful to implement different sorting strategies (for example, sort by price, ascending, or descending, sort by most viewed, etc.)

You can create replicas with the dashboard, or you can use the replicas setting when using the API. Whichever method you choose, these actions replicate all data and settings. You then need to change the sorting strategy of the replica.

여러 순위 수식은 서로 다른 정렬 전략(예: 가격, 오름차순, 내림차순 정렬, 가장 많이 본 항목 순으로 정렬)을 구현하는 데 유용합니다.
대시보드로 복제본을 만들거나 API를 사용할 때 복제본 설정을 사용할 수 있습니다. 어떤 방법을 선택하든 이러한 작업은 모든 데이터와 설정을 복제합니다. 그런 다음 복제본의 정렬 전략을 변경해야 합니다.

Querying replicas#

When you want to search a replica index, you need to target the replica index as you would with any primary index.

복제본 인덱스를 검색하려면 주 인덱스와 마찬가지로 복제본 인덱스를 대상으로 지정해야 합니다.

Changing a replica’s settings

Regarding settings, a standard replica is like any other index: you can change any of its settings.

Virtual replicas supports a subset of the primary’s settings.

For more information on which settings you can change in virtual replicas, refer to the guide on virtual replicas supported settings.

For both standard and virtual replicas you typically want to keep most settings in sync with your primary index. You can ensure setting synchronization by forwarding settings changes made to your primary index to its replicas: to achieve this, set the forwardToReplica parameter to true when using the setSettings method.

설정과 관련하여 표준 복제본은 다른 색인처럼 설정을 변경할 수 있습니다.
가상 복제본은 기본 설정의 일부를 지원합니다.
가상 복제본에서 변경할 수 있는 설정에 대한 자세한 내용은 가상 복제본 지원 설정에 대한 안내서를 참조하십시오.
표준 복제본과 가상 복제본 모두에 대해 일반적으로 대부분의 설정을 기본 index와 동기화하려고 합니다. 기본 색인의 설정 변경사항을 복제본에 전달하여 동기화를 설정할 수 있습니다. 이렇게 하려면 setSettings 방법을 사용할 때 ForwardToReplica 매개변수를 true로 설정하십시오.

 

Deleting or detaching a replica

You can’t edit the contents of a replica index. If you want to edit or delete the replica, you first have to unlink it from its primary index, which turns it into a regular index. Once unlinked, changes to the primary index no longer propagate to the replica index.

Please note that detaching a virtual replicas turns it into an empty index.

 

복제본 색인의 컨텐츠는 편집할 수 없습니다. 복제본을 편집하거나 삭제하려면 먼저 복제본을 기본 색인에서 연결을 해제해야 합니다. 그러면 일반 색인으로 바뀝니다. 연결이 해제되면 기본 색인에 대한 변경 내용은 더 이상 복제본 색인에 전파되지 않습니다.
가상 복제본을 분리하면 빈 색인으로 바뀝니다.

Virtual replicas supported parameters subset(가상 복제본 지원 매개 변수 하위 집합)

Because virtual replicas can be seen as a view of the primary’s index, they support a subset of the available index settings. You can find the supported and unsupported parameters in the list below.

가상 복제본은 기본 색인의 보기로 볼 수 있으므로 사용 가능한 색인 설정의 하위 집합을 지원합니다. 지원되는 매개 변수와 지원되지 않는 매개 변수는 아래 목록에서 찾을 수 있습니다.

Supported parameters#

Supported parameters are editable on virtual replicas. 지원되는 매개 변수는 가상 복제본에서 편집할 수 있습니다.

 

Unsupported parameters#

Unsupported parameters are reusing the value of the primary index. They can not be changed on a virtual replica. In the case you want to change them, you must change them on the primary index or create a standard replica.

지원되지 않는 매개 변수가 주 인덱스의 값을 재사용하고 있습니다. 가상 복제본에서는 변경할 수 없습니다. 문서를 변경하려면 기본 색인에서 변경하거나 표준 복제본을 만들어야 합니다.

 

 

 

 

 

 

 

 

 

 

728x90

'개발 > ALGOLIA' 카테고리의 다른 글

알고리아 Managing Results(3-25)  (0) 2022.03.05
알고리아 Managing Results(3-24)  (0) 2022.03.04
알고리아 Managing Results(3-22)  (0) 2022.03.04
알고리아 Managing Results(3-21)  (0) 2022.03.04
알고리아 Managing Results(3-20)  (0) 2022.03.04