JK
프로젝트
JK
>로딩 중 // 로딩 중
뷰 초기화 중
제작 및 디자인:JK
JK
>로딩 중 // PROJECT DETAILS
PARSING ARCHITECTURE, DIAGRAMS & API ENDPOINTS
프로젝트 목록으로 돌아가기
GitHub에서 보기
그래프 데이터베이스 성능 벤치마크
완료goneo4jmemgraphtigergraphdocker

그래프 데이터베이스 성능 벤치마크

그래프 DB와 관계형 DB 간의 탐색 지연 시간, 메모리 사용량 및 쿼리 효율을 비교 분석한 성능 평가 도구.

문제 및 해결책

다단계 소셜 그래프 및 추천 시스템에서 최적의 데이터 저장소를 선정하기 위한 데이터 기반 분석 필요.

기능

  • 탐색 깊이별 자동화된 순회 벤치마크 테스트
  • 지연 시간 백분위수(p50, p95, p99) 정밀 비교
  • 메모리 사용량 및 CPU 점유율 실시간 추적
  • Docker 기반 완전 재현 가능한 테스트 환경

기술 스택

기술버전목적선택 이유
Go1.25.1Primary languageStrong concurrency primitives, fast compilation, good driver ecosystem
neo4j-go-driver/v6v6.2.0Bolt protocol client for CognoDB, Neo4j, MemgraphOfficial driver, supports Bolt 5.x, parameterized queries
go-echarts/v2v2.7.2HTML chart generationGo-native, generates standalone HTML
godotenvv1.5.1Environment configurationStandard .env loading
net/httpstdlibREST client for TigerGraphNo external dependency needed

아키텍처

Benchmark CLI

Go 1.25.1

Dataset Extractor

Data Loader

Summary Generator

Chart Generator

raw/

SNAP soc-Pokec .gz

processed/

nodes.csv, relationships.csv

results/

JSONL, CSV, HTML

CognoDB Cloud

Bolt 5.x, US-East-4

Neo4j AuraDB

Bolt, US-East-1

Memgraph Cloud

Bolt, US East

TigerGraph Savanna

REST/OpenCypher
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

Benchmark Engine

  • Adapter pattern with common GraphDatabase interface (16 methods)
  • 5 database adapters (4 active, FalkorDB disabled due to OOM)
  • Sequential workload executor with warm-up and measured iterations
  • Concurrent workload executor with N goroutines and sync.WaitGroup
  • Factory function for adapter creation from configuration

CLI Pipeline

  • 10 CLI entry points: benchmark, captest, charts, cleanup, dataset, load, runall, summary, verify, verify-load
  • JSONL append-only result output for crash resilience
  • CSV summary aggregation with percentile calculation
  • HTML chart generation via go-echarts
  • Pipeline automation via runall (verify → load → benchmark → report)

프로젝트 구조

cmd
benchmark
captest
charts
cleanup
dataset
load
runall
summary
verify
verify-load
internal
benchmark
concurrent.goConcurrent workload executor
measurement.goMeasurement struct + ResultWriter
runner.goSequential workload executor
safe.goPanic-recovery wrapper
database
cognodb
memgraph
neo4j
tigergraph
types
factory.goDatabase factory/registry
dataset
parser.goCSV node/relationship loader

API 엔드포인트

Query Workloads (포트 0)

메서드경로목적
CypherMATCH (n:Person {id: $id}) RETURN n.id AS idPoint lookup — single node by ID
CypherMATCH (n:Person {region: $val}) RETURN n.id AS id LIMIT 10Indexed lookup — nodes by region
CypherMATCH (n:Person {id: $id})-[:FRIEND]->(m:Person) RETURN collect(m.id)1-hop traversal — direct friends
CypherMATCH (n:Person {id: $id})-[:FRIEND]->()-[:FRIEND]->(m:Person) RETURN collect(DISTINCT m.id)2-hop traversal — friends of friends
CypherMATCH (n:Person {id: $id})-[:FRIEND]->()-[:FRIEND]->()-[:FRIEND]->(m:Person) RETURN collect(DISTINCT m.id)3-hop traversal — extended network
CypherMATCH (n:Person) RETURN n.region AS region, count(n) AS cnt ORDER BY cnt DESC LIMIT 10Aggregation — region distribution
CypherCREATE (n:Person {id: $id, region: $region, ...})Write — create new node

데이터베이스 설계

PERSON

5 cols
idPK
string
region
string
gender
string
age
string
completion_percentage
string

FRIEND_EDGE

2 cols
from_id
string
to_id
string
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

Person (node label)

컬럼유형비고
idPKSTRINGUnique constraint, indexed
regionSTRINGIndexed
genderSTRINGNot indexed
ageSTRINGIndexed (CognoDB, Neo4j, Memgraph only)
completion_percentageSTRINGNot indexed

49,683 nodes extracted from SNAP soc-Pokec dataset. All properties are strings.

FRIEND (relationship type)

컬럼유형비고
source_idSTRINGPerson.id (from)
target_idSTRINGPerson.id (to)

100,000 directed relationships. No properties on edges. Many-to-many cardinality.

Directed graph: Person --[FRIEND]--> Person. Many-to-many via graph relationships (no junction table). Relationships are first-class citizens in the graph model.

주요 설계 결정

Single Bolt Driver for 3 Databases

결정: Use neo4j-go-driver/v6 for CognoDB, Neo4j, and Memgraph

이유: All three support Bolt protocol; Cypher is logically equivalent

이점: Code reuse, consistent behavior across databases, adapter pattern isolates DB-specific behavior

트레이드오프: Cannot test database-specific optimizations; Memgraph has its own Go driver

MaxPoolSize = 1

결정: Single connection per benchmark run despite constant defining 10

이유: Measure single-connection latency; avoid connection pool effects

이점: Clean latency measurement without pool contention

트레이드오프: Doesn't test connection pooling behavior

JSONL for Raw Results

결정: One JSON object per line, append-only output

이유: Stream results without loading all into memory; easy to append across runs

이점: Resilient to crashes (partial results preserved)

트레이드오프: Requires full file scan for aggregation

No Retries on Measured Queries

결정: Zero retries for benchmark queries to capture true latency

이유: Network blips and failures are part of real-world performance

이점: Honest performance measurement including failure modes

트레이드오프: Network blips cause false negatives

Goroutine-Per-Client Concurrency

결정: Each concurrent client creates its own database connection

이유: Simulates real-world multi-client scenarios; avoids shared connection contention

이점: Realistic concurrency testing with independent connections

트레이드오프: Higher resource usage; connection limits become the bottleneck

MERGE for Idempotent Node Loading

결정: Use MERGE (upsert) instead of CREATE for node loading

이유: Makes loading idempotent — running multiple times doesn't create duplicates

이점: Safe re-runs, consistent dataset state

트레이드오프: MERGE is slightly slower than CREATE due to existence checks

테스트

None (no _test.go files)•단위 테스트 0개

테스트 항목

  • Capability test matrix (cmd/captest/) — tests all 8 workload types against all databases with small 10-node graph
  • Connection verification (cmd/verify/) — tests basic connectivity and parameterized queries
  • Data integrity verification (cmd/verify-load/) — verifies node/relationship counts (49,683 nodes, 100,000 relationships)

부족한 커버리지

  • No unit tests for individual functions (_test.go files do not exist)
  • No tests for statistical functions (percentile, mean, stddev calculation)
  • No tests for CSV parsing edge cases (empty datasets, malformed CSVs)
  • No tests for concurrent behavior
  • No tests for chart generation correctness
  • No test framework installed (no testify, gomock)

주요 과제

  • 서로 다른 데이터 모델에 공정하고 동일한 부하 조건 재현
  • 깊은 순회 시 메모리 오버헤드 통제

주요 학습

  • 네이티브 그래프 엔진과 RDBMS 간의 실제 트레이드오프 분석
  • 고부하 환경에서의 정밀한 성능 벤치마킹 방법론