카테고리 없음

[Amplitude Foundations 5️⃣] Manage Feature Flags and Rollouts Using Amplitude

alwayshappydaysforever 2025. 3. 21. 19:45
반응형

 

 

[Amplitude Foundations 4️⃣] Getting Started with Amplitude Feature Experimentation

[Amplitude Foundations 3️⃣] Use Dashboards and Starter Templates to Monitor Important Metrics[Amplitude Foundations 1️⃣] Learn More about Your Data Taxonomy in Your Amplitude Instance[Amplitude Foundations 1️⃣] Getting started with Amplitude An

alwayshappydaysforever.tistory.com


  • What Feature Flags in Amplitude are
  • Where to find resources to support the SDK implementation process
  • How to create, manage, and monitor flags using Amplitude Experiment


Feature Flags and Rollouts

1. Feature Flag란 무엇인가?

    • Feature Flag는 제품의 기능을 코드 배포 없이 활성화하거나 비활성화할 수 있는 방법입니다.
    • 즉, 새로운 코드를 배포할 필요 없이 기존 코드의 특정 부분을 제어하여 기능의 활성화 여부를 결정할 수 있습니다.
  • 실시간 코드 실행:
    • Feature Flag는 코드가 실행되는 순간에 특정 코드 부분이 실행될지 말지를 결정합니다.
    • 예: 사용자가 앱을 실행할 때 특정 기능이 보이거나 숨겨질지 실시간으로 제어할 수 있습니다.

2. 주요 특징

    • 신규 기능 배포 관리:
      • 새로운 기능을 사용자에게 즉시 공개하지 않고도 배포할 수 있습니다.
    • 특정 사용자 그룹에만 노출 가능:
    • 특정 사용자에게만 새로운 기능을 제공할 수 있습니다.
      • 예:
      • 특정 지역 사용자
      • 베타 테스트 사용자 그룹

3. Feature Flag의 형태

    • 간단한 조건문:
      • 단순한 IF 문을 사용하여 기능을 활성화하거나 비활성화할 수 있습니다.
    • 복잡한 의사 결정 트리:
      • 더 복잡한 로직(예: 여러 변수를 기반으로 한 조건)도 처리할 수 있습니다.
      • 예: 사용자의 구독 상태, 위치, 또는 디바이스 유형에 따라 다른 결과 제공.

4. 구현 방식

    • 개발자의 역할:
      • Feature Flag는 코드에 구현되므로, 이를 설정하려면 개발자나 엔지니어의 협력이 필요합니다.
    • 광범위한 활용 가능성:
      • 한 번 구현되면 다양한 목적에 활용할 수 있습니다.
      • 실험(A/B 테스트)
      • 단계적 기능 롤아웃(Gradual Rollout)
      • 긴급 상황에서 기능 비활성화

5. Use cases

    • Gradual Rollouts (점진적 배포)
    • Try out new features in production
    • Release Anytime
    • Audience Targeting (특정 사용자 타겟팅 -> 그룹별 맞춤화된 경험 제공 )
    • Roll back features

SDK Implementation

1. SDK 구현의 필요성

    • 기능 플래그(Feature Flags) 관리실험(Experiments) 실행을 하려면, Amplitude Experiment에 적합한 SDK를 반드시 구현해야 합니다.
    • SDK를 통해 Amplitude Experiment와 앱/서비스를 연결하고 데이터를 주고받을 수 있습니다.

The Amplitude Feature Flag workflow

* variants는 unlimited하게 추가 가능하다

파란색: within amplitude / 하늘색: Outside amplitude

 


 

Amplitude Feature Experiment Implementation Essentials

  • Determine the implementation method best suited for your team's needs
  • Accurately track and analyze user progress through experiments by understanding assignment and exposure events
  • Decide how to assign users variants for experiments, using either remote or local evaluation


Assignment and Exposure Events

 
 
 

assign event는 최대한 빨리 배정하는게 좋다고 함 (단점: 서비스 로드 속도)

assign event는 fetch !

비유로 이해해보면,

* Assign event: 레스토랑 예약 시스템에서 손님이 테이블에 배정된 순간

= 사용자가 어떤 variant를 받을지 결정하는 초기 설정 단계

* exposure event: 손님이 테이블에 앉아 음식을 주문하거나 식사를 시작하는 순간

= 사용자가 그 variant를 실제로 경험했음을 기록하는 단계

Anyway,

두 이벤트는 실험의 정확한 분석을 위해 모두 필요하다

Exposure tracking 기능

= 실험의 신뢰성을 높이고, 대규모 실험 환경에서도 명확한 분석을 가능하게 만드는 핵심 기능

  • 실험을 진행할 때 노출 추적을 통해 누가 어떤 실험에 참여했는지를 정확히 기록할 수 있습니다.
  • 특히, 다수의 실험이 동시에 실행될 경우, 실험 간 혼동을 방지하고 결과를 명확히 분석할 수 있습니다.
  • 노출 이벤트는 Amplitude에서 사용자 속성, 실험 데이터, 이벤트 구조를 일관되게 관리하며, 데이터 신뢰성을 극대화합니다.

Remote evaluation vs Local evaluation

  • Remote Evaluation은 고급 기능을 활용하려고 클라우드 서버에서 데이터를 가져와 처리하는 방식이에요. 더 많은 정보를 분석할 수 있지만, 시간이 더 걸립니다.
    • 예: 요리사가 모든 재료를 시장에서 사와야 하는 경우. 준비가 오래 걸리지만, 정교한 요리가 가능.
  • Local Evaluation은 이미 손쉽게 사용할 수 있는 데이터를 활용해서 빠르게 처리하는 방식입니다. 하지만, 분석의 깊이는 다소 제한적이에요.
    • 예: 냉장고에 있는 재료로 바로 요리하는 경우. 빠르게 요리가 가능하지만, 재료가 한정적.

 

Implementation Options

Client-side Implementation (클라이언트 측 구현) = Integrated Implementation

  1. initializeWithAmplitudeAnalytics()
    • 목적: Analytics에서 사용자 객체를 Experiment로 전달합니다.
    • 역할:
      • 현재 사용자의 속성을 Experiment와 동기화.
      • 사용자의 속성에 따라 타겟팅 평가를 수행.
    • 조건: Analytics를 초기화한 후 Experiment를 초기화할 때 사용됩니다.
  2. Automatic Exposure Tracking (자동 노출 추적)
    • 기능:
      • 사용자가 .variant()를 처음 호출할 때 노출 이벤트가 자동으로 기록됩니다.
      • 세션 중 사용자의 variant(변형)가 변경되면 다시 실행됩니다.
  3. Explicit Exposure Tracking (명시적 노출 추적, 선택 사항)
    • 설명: 필요에 따라 노출 추적을 명시적으로 설정할 수 있습니다.
  4. Variants are Cached on the SDK (변형 캐싱)
    • 기능:
    • 사용자에 대해 변형(variant)을 가져온 후 해당 값이 SDK에 캐싱됩니다.
      • .variant()를 호출하면 언제든지 캐싱된 값을 가져올 수 있습니다.
  5. Remote or Local Evaluation (원격 또는 로컬 평가)
    • 클라이언트 측에서도 원격 평가 또는 로컬 평가를 수행할 수 있습니다.
  • 장점
    • An integrated implementation (which must be done client-side) involves the least amount of engineering effort, passes user context from the Analytics SDK to Experiment automatically, and allows you to disable automatic exposure tracking to track exposures explicitly if desired.

Server-side Implementation (서버 측 구현)

  1. Server-side Rendering (SSR)
    • 목적: 서버 측에서 특정 플래그 또는 실험을 가져와 클라이언트에서 렌더링할 수 있도록 지원.
    • 사용: 서버 측 Experiment SDK를 사용하여 플래그와 실험 데이터를 처리.
  2. Remote or Local Evaluation (원격 또는 로컬 평가)
    • 서버 측에서도 원격 평가(사용자 데이터를 기반으로 상세 분석) 또는 로컬 평가(빠른 평가)를 선택할 수 있습니다.

  • 클라이언트 측 구현:
    • 지연 시간이 문제되지 않으면 Remote Evaluation을 추천.
    • Analytics SDK를 사용 여부에 따라 SDK 통합 방식이 달라짐.
      • If there is no SDK available that meets your requirements, you can use the Experiment REST API until we build support for your framework. In the meantime, please submit a request for a new SDK to your Amplitude representative.
    • 지연 시간이 문제라면 Local Evaluation 선택.
  • 서버 측 구현:
    • 유사한 기준으로 Remote 또는 Local Evaluation을 선택하되, 할당 이벤트와 노출 이벤트 처리를 고려.

 

Getting Started with Amplitude Web Experimentation

  • Understand how Amplitude Web Experimentation fits into Amplitude’s Digital Analytics Platform
  • Understand what web experimentation is, who it is for, and when to use it.
  • Implement a high-level Amplitude Web Experimentation workflow
  • Implement the web experiment script
  • Build and run web experiments using visual overlays and URL redirects
  • Analyze results and complete a web experiment

 


Web Experimentation vs Feature Experimentation


The web Experimentation Workflow

하늘색이 outside / 파란색이 within

 

반응형