inblog logo
|
jaeminlog
    SILD 개발 가이드

    Kinesis 활용

    유재민's avatar
    유재민
    Apr 08, 2024
    Kinesis 활용
    Contents
    Google Analytic를 사용하지 않은 이유프로젝트 빌드Overview기록된 데이터 확인

    유저 행동 데이터 수집 및 분석을 위해 Kinesis(링크)를 활용했다.

    Google Analytic를 사용하지 않은 이유

    • 대부분의 솔루션을 AWS 기반으로 구축하여 S3, OpenSearch 등 다른 기능과 연동이 편리하고, API로 사용이 용이하여 채택했다.

    대신 기본기능은 연동하여 기본적인 앱의 MAU, 설치율 등등 특화된 기능만 활용했다.

    프로젝트 빌드

    • Typescript기반 AWS Lambda로 구현된 프로젝트로 배포는 간편하게 Serverless framework를 사용한다.

    • docker와 비슷한 방식으로 설정파일 작성 후 console에서 미리 설정한 aws 계정 정보로 lambda, kinesis datastream을 deploy 할 수 있다.

      service: sild-kinesis
      
      plugins:
        - serverless-webpack
      
      provider:
        name: aws
        region: 'ap-northeast-2'
        iam:
          role:
            statements:
              - Effect: Allow
                Action:
                  - kinesis:PutRecord
                  - kinesis:PutRecords
                Resource:
                  - Fn::GetAtt: [kinesisStream, Arn]
      
      functions:
        producer:
          handler: handler.producer
          events:
            - http:
                method: post
                path: producer
      
        consumer:
          handler: handler.consumer
          events:
            - stream:
                type: kinesis
                arn:
                  Fn::GetAtt:
                    - kinesisStream
                    - Arn
      resources:
        Resources:
          kinesisStream:
            Type: AWS::Kinesis::Stream
            Properties:
              Name: sildEventStream
              RetentionPeriodHours: 24
              ShardCount: 1
    • 배포 후 lambda 함수에서 확인 가능한 서버리스 구성 및 endpoint 주소

    Overview

    기록된 데이터 확인

    • 필요한 데이터 생성(링크)

    • 특정 유저의 방문/검색/특정기능 호출 비율

    • 특정 기간의 룩북 조회 랭킹

    • 준실시간 특정 행위 기록

    Share article
    Contents
    Google Analytic를 사용하지 않은 이유프로젝트 빌드Overview기록된 데이터 확인

    jaeminlog

    RSS·Powered by Inblog