|
← 포트폴리오 목록← Portfolio

Nepto

Web3 SocialFi Messenger & CommunityWeb3 SocialFi Messenger & Community


1. 프로젝트 개요1. Project Overview

블록체인 지갑 기반 인증, NFT 게이팅 커뮤니티, E2E 암호화 DM, 토큰 리워드 등 Web3 네이티브 기능을 결합한 메시징 플랫폼. 마이크로 서비스 아키텍처(MSA) 기반 시스템을 설계 및 구현A messaging platform combining Web3-native features — wallet-based auth, NFT-gated communities, E2E encrypted DMs, token rewards. Designed and implemented the MSA-based system

항목Item 내용Details
프로젝트명Project Nepto
분류Category Web3 SocialFi Messenger & Community
개발 기간Period 약 2년 8개월 (2023.01 ~ 2025.08)~2 years 8 months (Jan. 2023 – Aug. 2025)
팀 규모Team Size 10명 (백엔드 3명)10 members (3 backend)
역할Role Backend DeveloperBackend Developer
링크Link https://nepto.com/
Nepto 서비스 메인 Nepto DM & NFT 거래

2. 프로젝트 배경과 기술 스택2. Background and Tech Stack

Web3 메신저 특성상 실시간 메시징, 블록체인 온체인 데이터 동기화, E2E 암호화, 대규모 커뮤니티 알림 등 서로 다른 특성의 도메인이 공존해야 했다. 각 도메인을 독립적으로 스케일링하고 장애를 격리하기 위해 MSA 아키텍처를 채택했다.The nature of a Web3 messenger required coexistence of domains with different characteristics — real-time messaging, blockchain on-chain data sync, E2E encryption, and large-scale community notifications. MSA architecture was adopted to independently scale each domain and isolate failures.

분류Category 기술Technologies
LanguagePython (FastAPI) / Rust (Background Worker)
FrameworkFastAPI, Typer (CLI / Worker)
DatabaseMongoDB (Atlas), DynamoDB
Message QueueAWS SNS + SQS (FIFO / Standard, Pub / Sub Event Driven)
CloudAWS (EKS, S3, SNS, SQS, DynamoDB, API Gateway, ECR)
BlockchainSolidity, Web3.py, Alchemy API
InfraKubernetes (EKS), Terraform (IaC), Karpenter & HPA, Docker, GitHub Actions (CI / CD)
RealtimeWebSocket (AWS API Gateway)
ObservabilityPrometheus / Fluent Bit / Grafana / AWS OpenSearch & Kibana
PushFirebase Cloud Messaging (FCM)

기술 선택과 근거Technology Choices and Rationale

기술Technology선택 근거Rationale
SNS Pub/Sub + SQS이벤트가 많아 직접 Enqueue 시 관리포인트 폭증 + 일관성 문제. SNS로 느슨한 결합 확보, 순서 보장이 필요한 큐는 FIFO, 알림처럼 처리량이 중요한 큐는 Standard로 구분Direct enqueue causes management point explosion + consistency issues with many events. SNS for loose coupling, FIFO for order-critical queues, Standard for throughput-critical queues like notifications
MongoDB Atlas서비스별 독립 인스턴스로 데이터 격리(Service-per-Database). Document 모델이 다양한 도메인 스키마에 유연하게 대응Per-service independent instances for data isolation (Service-per-Database). Document model flexibly handles diverse domain schemas
DynamoDBWebSocket 커넥션 상태 추적에 서버리스 환경 + TTL 자동 관리가 적합. Redis 대비 프로비저닝 관리 불필요Serverless + automatic TTL management ideal for WebSocket connection tracking. No provisioning management needed vs Redis
Rust (Background Worker)Python 스크립트 언어 특성상 CPU-bound 집계 작업에 한계. 동일 로직 Rust 구현으로 67% 성능 개선Python scripting language has fundamental CPU-bound computation limits. Same logic in Rust achieved 67% performance improvement

3. 시스템 아키텍처3. System Architecture

11개 API Server + 8개 Queue Worker + 1개 Background Worker(크론잡 15개+)로 구성된 MSA 시스템을 설계 및 구현했다. API Server는 도메인 바운디드 컨텍스트(인증, 메시징, 커뮤니티, 자산, 알림 등) 기준으로, Queue Worker는 SQS 큐 단위 1:1 매핑으로 분리하여 장애 격리와 독립 스케일링을 확보했다.Designed and implemented the entire MSA system consisting of 11 API Servers + 8 Queue Workers + 1 Background Worker (15+ cron jobs). API Servers were separated by domain bounded context (auth, messaging, community, assets, notifications, etc.), and Queue Workers were mapped 1:1 per SQS queue for fault isolation and independent scaling.

Nepto System Architecture

배포 전략 (CI / CD)Deployment Strategy (CI / CD)

AWS EKS(us-east-1)에 배포하며, GitHub Actions 기반 CI / CD 파이프라인을 자동화했다.Deployed on AWS EKS (us-east-1), with GitHub Actions-based CI / CD pipeline automation.

CI / CD 파이프라인

4. 핵심 기술 구현4. Core Technical Implementation

4-1. E2E 암호화 DM & 실시간 메시지 전달 시스템4-1. E2E Encrypted DM & Real-time Message Delivery System

서비스 내 토큰 트랜잭션 및 지갑 서명 등 민감 정보 교환을 고려하여, 종단간 암호화 메시징(E2E Encrypted Messaging)과 실시간 WebSocket 기반 메시지 전달 시스템을 설계 및 개발했다.Considering sensitive information exchange such as token transactions and wallet signatures, an E2E Encrypted Messaging and real-time WebSocket-based message delivery system was designed and developed.

E2E DM 채팅 화면 E2E DM Sequence Diagram

E2E 키 교환:E2E Key Exchange:

WebSocket 연결 관리:WebSocket Connection Management:

암호화 메시지 전송:Encrypted Message Transmission:

수신 (온라인 / 오프라인 분기):Delivery (Online / Offline Branching):

피크 1,000명 동시 접속 기준 지연 < 50ms를 달성했으며, 서버리스 WebSocket으로 인프라 관리 부담을 최소화했다.Achieved < 50ms latency at peak 1,000 concurrent connections, with minimized infrastructure management overhead via serverless WebSocket.

→ 서버가 메시지 내용을 열람할 수 없는 구조로 사용자 프라이버시 보장. 암호화된 메시지는 서버에 최대 90일 TTL로 보관 후 자동 삭제→ Server cannot access message content, ensuring user privacy. Encrypted messages are stored on the server with a 90-day TTL and automatically deleted

4-2. Push Notification 시스템 (3단계 아키텍처 진화)4-2. Push Notification (3-Phase Architecture Evolution)

DM, 커뮤니티 채널, ADDM, 시스템 알림 등 다양한 알림 유형을 처리하는 Push Notification 시스템을 세 차례에 걸쳐 개선하며, 장애율을 0.1% 미만으로 낮췄다.The Push Notification system handling DM, community channels, ADDM, and system alerts was improved through three phases, reducing failure rate to under 0.1%.

Phase 1: API 직발송Direct API Dispatch

Phase 2: SQS 기반 비동기 처리SQS-based Async Processing

Phase 3: SNS Pub / Sub 이벤트 드리븐SNS Pub / Sub Event-Driven

Phase 2의 한계를 해결하기 위해, 각 서비스가 SQS에 직접 Enqueue하는 방식에서 SNS 기반 이벤트 드리븐 아키텍처로 전환했다.To address Phase 2's limitations, transitioned from direct SQS enqueue per service to an SNS-based event-driven architecture.

  1. 디바이스 맵 구축: MongoDB에서 수신 대상의 디바이스 목록 조회 (FCM 토큰, 푸시 설정)Device map construction: Query target device lists from MongoDB (FCM tokens, push settings)
  2. 온라인 / 오프라인 분류: DynamoDB 소켓 연결 테이블에서 100건씩 배치 조회 (DynamoDB BatchGetItem 최대 100건 제한, 조회 지연 ~50ms 수준으로 실시간 라우팅에 영향 최소화)Online / offline classification: Batch query 100 at a time from DynamoDB socket table (BatchGetItem max 100 items, ~50ms latency minimizing impact on real-time routing)
  3. 온라인 → WebSocket postToConnection 실시간 전달 / 오프라인 → FCM App PushOnline → WebSocket postToConnection real-time / Offline → FCM App Push
  4. 실패 처리: WebSocket GoneException(410) → FCM 폴백 + DynamoDB 정리, LimitExceededException(429) → 재시도Failure handling: WebSocket GoneException(410) → FCM fallback + DynamoDB cleanup, LimitExceededException(429) → retry

0.1% 미만 장애율 달성 메커니즘: SNS 자체 재시도 정책 + notification-queue-worker의 FCM 응답 코드별 재시도(Retryable 에러만 최대 3회) + WebSocket 실패 시 FCM 자동 폴백의 다층 안전망으로 메시지 누락을 최소화0.1% failure rate mechanism: SNS built-in retry policy + notification-queue-worker FCM response code-based retry (max 3 for retryable errors) + automatic FCM fallback on WebSocket failure — multi-layer safety net minimizing message loss

부하 테스트 (Locust): 3,000명 동시 사용자 기준 100RPS, CPU 60%, 메모리 45%, 평균 응답시간 220msLoad Test (Locust): 3,000 concurrent users — 100RPS, CPU 60%, Memory 45%, avg response 220ms

→ 필수 알림(DM, 트랜잭션 등) 누락을 사실상 제거하여 사용자 신뢰성 확보→ Virtually eliminated critical notification (DM, transactions) loss, securing user trust

4-3. 데이터 정합성 설계 — 동시성 제어 + 출금 파이프라인4-3. Data Integrity Design — Concurrency Control + Withdrawal Pipeline

리워드 시스템에서 사용자 자산을 다루는 두 가지 핵심 문제가 있었다: (1) 동시 요청에 의한 리워드 중복 지급, (2) 출금 시 여러 컬렉션에 걸친 원자적 처리. 두 문제 모두 사용자 자산의 정확성이라는 동일한 비즈니스 요구에서 출발했다.Two critical problems arose in handling user assets within the reward system: (1) duplicate reward distribution from concurrent requests, and (2) atomic processing across multiple collections during withdrawal. Both stemmed from the same business requirement: user asset accuracy.

동시성 제어:Concurrency Control:

사용자별 요청 Limit 기능(예: 커뮤니티당 하루 20회 제한)에서 동시 요청 시 Limit을 초과하여 리워드가 지급되는 문제가 발생했다. 개별 사용자와 커뮤니티 단위의 동시성 특성이 달라, 레벨별로 전략을 분리했다.Per-user request limits (e.g., 20/day per community) were being exceeded under concurrent requests, causing over-distribution of rewards. Since per-user and per-community concurrency characteristics differ, strategies were separated by level.

출금 파이프라인:Withdrawal Pipeline:

지갑 / 자산 관리

출금 시 잔액 차감 + 트랜잭션 생성 + 로그 기록이 원자적이어야 했다. 리워드가 여러 소스(일일 보상, 이벤트, 레퍼럴 등)에서 개별 레코드로 쌓이므로, 단순 잔액 필드 차감이 아니라 오래된 리워드부터 FIFO로 소진하는 구조가 필요했다.Withdrawal required atomicity across balance deduction, transaction creation, and log recording. Since rewards accumulate as individual records from multiple sources (daily, events, referrals), a FIFO consumption structure — spending oldest rewards first — was needed instead of simple balance field deduction.

→ 리워드 중복 지급 및 출금 정합성 이슈 0건, 별도 인프라(Redis 등) 없이 기존 스택만으로 자산 안전성 확보Zero duplicate reward distribution and withdrawal integrity issues, achieving asset safety with existing stack without additional infrastructure (Redis, etc.)

4-4. 온체인 자산 소유권 추적 시스템4-4. On-Chain Asset Ownership Tracking

온체인 트랜잭션 추적

블록체인의 모든 토큰 트랜잭션 및 이벤트를 실시간 추적하여, 사용자의 자산 변화를 감지하고 시스템 권한(NFT 게이팅, 역할 부여)에 자동 반영하는 Tokengate 시스템을 구축했다.Built a Tokengate system that tracks all blockchain token transactions and events in real-time, detects user asset changes, and automatically reflects them in system permissions (NFT gating, role assignment).

스테이킹 이벤트 추적 (이중 수집 체계):Staking Event Tracking (Dual Collection System):

초기에는 Alchemy WebHook 단독으로 운영했으나, Provider 측 장애 및 네트워크 지연으로 실제 이벤트 누락이 발생했다. 또한 단일 파이프라인에서 모든 이벤트 타입을 처리하다 보니, 특정 이벤트 타입의 장애가 전체 수집에 영향을 미쳤다. 이를 해결하기 위해 이중 수집 체계 + 독립 파이프라인으로 리팩토링했다.Initially operated with Alchemy WebHook alone, but actual event loss occurred due to provider-side failures and network delays. Additionally, processing all event types in a single pipeline meant one event type's failure affected the entire collection. This was resolved by refactoring into a dual collection system with independent pipelines.

→ 이중 수집 체계로 블록체인 이벤트 손실율 0% 확보, NFT 게이팅 및 자산 권한의 실시간 정합성 보장→ Dual collection system achieves 0% blockchain event loss rate, ensuring real-time consistency of NFT gating and asset permissions

4-5. ADDM (Ad DM) — 온체인 광고 메시징4-5. ADDM (Ad DM) — On-Chain Ad Messaging

블록체인 토큰 전송을 활용한 광고 DM 시스템. 특정 커뮤니티의 사용자 지갑으로 소량의 Nepto Token과 메시지를 일괄 전송하여, 앱 사용자에게는 Push 알림으로, 비사용자에게는 지갑 토큰 수신 자체로 메시지를 전달하는 구조이다.An ad DM system leveraging blockchain token transfers. Sends small amounts of Nepto Token with messages to community members' wallets in bulk — delivering messages via Push notifications for app users and wallet token receipt itself for non-users.

  1. Multi-Sender Contract를 통해 커뮤니티 사용자 지갑에 Nepto Token + 메시지를 일괄 전송 (ADDM 수신 거부 옵트아웃 사용자 제외)Bulk send Nepto Token + message to community members' wallets via Multi-Sender Contract (excluding users who opted out of ADDM)
  2. Background에서 Multi-Sender Contract 이벤트를 24시간 추적 (기존 이중 수집 체계 활용)24-hour tracking of Multi-Sender Contract events in background (leveraging existing dual collection system)
  3. 이벤트 감지 시 수신자(앱 사용자)에게 Push 알림 + 노티센터 노출On event detection, expose Push notification + notification center to recipients (app users)
  4. 수신자가 ADDM을 확인하면 소량의 리워드 토큰 지급Small reward token granted when recipient confirms the ADDM

4-6. Background Worker Rust 마이그레이션4-6. Background Worker Rust Migration

5. 성과 요약5. Achievement Summary

영역Area 성과Achievement
MSA MSA 시스템 전체 설계 및 구현, SNS Pub / Sub 이벤트 드리븐 아키텍처로 서비스 간 느슨한 결합 확보Full MSA system design & implementation, loose coupling via SNS Pub / Sub event-driven architecture
장애 내성Fault Tolerance Push Notification 장애율 0.1% 미만 달성, 3단계 아키텍처 진화Push Notification failure rate under 0.1%, 3-phase architecture evolution
실시간Real-Time MessageRouter 기반 온라인 / 오프라인 자동 라우팅, 피크 1,000명 동시 지연 < 50msMessageRouter-based online / offline auto-routing, peak 1,000 concurrent latency < 50ms
부하 테스트Load Test 3,000명 동시 사용자 기준 100RPS, 평균 응답시간 220ms3,000 concurrent users — 100RPS, avg response 220ms
성능 최적화Performance CPU-bound 집계 Rust 마이그레이션으로 100만 건 기준 약 67% 단축Rust migration for CPU-bound aggregation — ~67% reduction for 1M records
보안Security Diffie-Hellman + AES 기반 E2E 암호화 DM, 서버 복호화 불가 구조Diffie-Hellman + AES E2E encrypted DM, server cannot decrypt
Blockchain 이중 수집 체계(WebHook + Watcher) 기반 실시간 자산 추적, 5개 이벤트별 독립 파이프라인으로 장애 격리Real-time asset tracking via dual collection (WebHook + Watcher), fault isolation with 5 independent pipelines per event type
데이터 정합성Data Integrity 레벨별 동시성 제어(MongoDB Mutex Lock + SQS FIFO) + ACID 트랜잭션 출금 파이프라인으로 리워드 중복 지급 및 출금 정합성 이슈 0건Level-separated concurrency control (MongoDB Mutex Lock + SQS FIFO) + ACID transaction withdrawal pipeline — zero duplicate reward and withdrawal integrity issues

← 포트폴리오 목록← Portfolio