Designing Data-Intensive Applications - (1) Trade-offs in Data Systems Architecture

Designing Data-Intensive Applications, 2nd Edition
Data is at the center of many challenges in system design today. Difficult issues such as scalability, consistency, reliability, efficiency, and maintainability need to be resolved.... - Selection from Designing Data-Intensive Applications, 2nd Edition [Book]

Distributed Systems lecture series
Accompanying lecture notes: https://www.cl.cam.ac.uk/teaching/2122/ConcDisSys/dist-sys-notes.pdf These videos form an 8-lecture series on distributed systems...
Preface
You will develop a strong intuition for what your systems are doing under the hood so that you can reason about their behavior, make good design decisions, and track down any problems that may arise.
Chapter 1. Trade-offs in Data Systems Architecture
However, as the data volume or the rate of queries grows, it needs to be distributed across multiple machines, which introduces many challenges.
Operational Versus Analytical Systems
Characterizing Transaction Processing and Analytics
transaction: a group of reads and writes that form a logical unit.
Property | Operational systems (OLTP) | Analytical systems (OLAP) |
Main read pattern | Point queries (fetch individual records by key) | Aggregate over large number of records |
Main write pattern | Create, update, and delete individual records | Bulk import (ETL) or event stream |
Human user example | End user of web/mobile application | Internal analyst, for decision support |
Machine use example | Checking if an action is authorized | Detecting fraud/abuse patterns |
Type of queries | Fixed set of queries, predefined by application | Analyst can make arbitrary queries |
Data represents | Latest state of data (current point in time) | History of events that happened over time |
Dataset size | Gigabytes to terabytes | Terabytes to petabytes |
- custom sql 쿼리를 작성하여 실행함으로써 데이터를 변경하는 작업이 발생할 수도 있고, 쿼리를 실행하는 것은 비싸며, 다른 이들로 하여금 디비 사용에 성능 영향을 줄 수 있게 때문
Data Warehousing
- 다양한 실행 시스템에 데이터가 분산되어 있어, 하나의 쿼리로 여러 데이터세트를 묶는 것이 불가능해졌다 → 데이터 사일로 문제 발생
- OLTP에 적잡하게 구성된 스키마와 데이터 레이어는 분석용으로 적합하지 않다.
- 분석 쿼리는 꽤 비싸며, 이를 OLTP 디비에 실행시키는 것은 다른 사용자에게 성능 문제를 야기할 수 있다.
- 보안 문제나 규제 목적으로 직접 접근이 불가능하여 OLTP 시스템이 분산된 네트워크를 사용하고 있을 수 있다.
A data warehouse, by contrast, is a separate database that analysts can query to their hearts’ content, without affecting OLTP operations
- data warehouse는 회사 내 다양한 OLTP 디비로 부터 나온 read-only copy 를 포함하고 있다.
- 이는 기간이 나뉘어진 데이터 혹은 연속된 스트리밍 업데이트로 이뤄져 있다.

- operational의 경우, 서비스를 위한 자신만의 디비가 있거나, 분산된 구조를 가지고 있는 반면
- analytics의 경우, 하나의 쿼리로 여러 시스템의 데이터를 다뤄야 하기 때문에 하나의 data warehouse를 갖게 된다.
a data lake: a centralized data repository that holds a copy of any data that might be useful for analysis, obtained from operational systems via ETL processes.
- data warehouse와 달리, 파일 형식이나 데이터 모델 혹은 스키마 규제 없이 다양한 데이터를 포함하고 있다는 것.
- data lake는 데이터가 relational 형식으로 변환되기 전, raw 형식의 데이터를 가지고 있어, 그들이 원하는 목표를 가장 잘 수행할 수 있다.
- 애플리케이션, 시간 민감성에 따라서 스트리밍 처리 방식은 중요해진다.
Systems of Record and Derived Data
- source of truth
- 원본
- the result of taking some existing data from another system and transforming or processing it in some way
- recreate 할 수 있음
- redundant하다고 할 수 있지만, 읽기 성능을 높이기 위해서 필요하다.
Cloud versus Self-Hosting

Pros and Cons of Cloud Services
- 관리적인 측면에서 자유로움(역할 분기)
- 그리고 어떨 때에는 더 싸기도 함
- 자유는 없음
- 원하는 기능이 없을 경우 스스로 보충하기보다 벤더가 기능을 추가하기를 기다려야 함
- If the service goes down, all you can do is to wait for it to recover.
- 버그나 성능에 문제가 있을 때, 명확하게 이슈를 분석하기가 어려울 수 있음. 내부 서비스에 대한 접근이 제한되어 있기 때문에 단순히 로그를 보는 선에서 끝나게 된다.
- 서비스가 종료되거나 말도 안되게 비싸질 경우, 이전 버전의 소프트웨어를 지속하는 건 선택지에 없고 다른 대안 서비스로 migrate 하는 것이 강요된다. 물론, 마이그레이션을 위한 api를 제공하기는 하지만 standard는 없으며, 분명하게 비용은 발생된다.
- 데이터가 안전하게 지켜진다는 것을 믿어야 한다.
- 클라우드 서비스가 모든 사내 데이터 시스템을 모두 대체하지는 못하는데
- old systems : legacy → 클라우드가 나오기 훨씬 전부터 쓰던 오래된 시스템들이 너무 많아서 옮기기가 쉽지 않을 뿐더러
- specialist requirements: 클라우드 서비스가 제공하는 일반적인 기능으로는 충족시킬 수 없는 특수한 요구사항이 있는 경우
Cloud-Native System Architecture
Category | Self-hosted systems | Cloud-native systems |
Operational/OLTP | MySQL, PostgreSQL, MongoDB | AWS Aurora, Azure SQL DB Hyperscale, Google Cloud Spanner |
Analytical/OLAP | Teradata, ClickHouse, Spark | Snowflake, Google BigQuery, Azure Synapse Analytics |
- cloud-native system: storage (disk) and computation (CPU and RAM) are separated or disaggregated
Distributed versus Single-Node Systems
- Distributed system을 사용해야 하는 이유는 많음
- services that you write yourself (application code)
- services consisting of off-the-shelf software (such as databases)
- 네트워크를 타야하기 때문에 모든 노드가 빠른 것은 아니다.
- Microservice
- allowing different teams to make progress independently without having to coordinate with each other
- Serverless
- each serverless function execution still runs on a server, but subsequent executions might run on a different on
Data Systems, Law, and Society
- GDPR(General Data Protection Regulation), CCPA(California Consumer Privacy Act) → AI 관련 법규가 늘어나면서 개인 정보 처리에 대해 제한 사항이 많이 생겼다
- 단순히 저장하는 것만이 능사가 아니다.
- 데이터가 누출되거나 손상되었을 경우, 법적 비용과 벌칙금은 데이터를 효과적으로 저장하는 것보다 위험한 경우의 수 일 수 있다.
- 미래에 유용할 수 있는 개인 데이터를 저장하는 것은 data minimization에 위배되는 원칙 > GDPR에 따르게 된다면 특정할 수 있을 것으로 보이는 개인 데이터를 나중의 목적으로 저장하지 못한다.
but it’s advisable not to rush into making a system distributed if it’s possible to keep it on a single machine
- 1.Designing Data-Intensive Applications - (1) Trade-offs in Data Systems Architecture
- 2.Designing Data-Intensive Applications - (2) Defining NonFunctional Requirements
Designing Data-Intensive Applications - (2) Defining NonFunctional Requirements
이 챕터는 데이터 중심 애플리케이션의 핵심인 세 가지 비기능적 요구사항(신뢰성, 확장성, 유지보수성)을 정의합니다. 트위터의 타임라인 구축 사례를 통해 읽기/쓰기 시점의 부하 분산 전략(Fan-out)과 트레이드오프를 살펴보고, p99.9와 같은 꼬리 지연 시간(Tail Latency) 관리의 중요성을 강조합니다. 최종적으로는 복잡성을 제어하는 추상화와 변화에 유연한 설계가 장기적인 시스템 운영에 어떤 영향을 미치는지 다룹니다. This chapter defines the three pillars of data-intensive applications: Reliability, Scalability, and Maintainability. Through the case study of X (Twitter) home timelines, it explores the trade-offs of fan-out strategies between write and read paths. It also emphasizes the importance of managing tail latencies (p99.9) and explains how abstraction and evolvability are crucial for long-term system health and managing accidental complexity.

Claude Code 완전 정복: 에이전틱 개발자를 위한 필수 워크플로우와 컨텍스트 최적화
시스템 프롬프트를 절반으로 줄이고 성능은 높이는 Claude Code 해킹 비법! AI가 지시를 잊어버리는 '컨텍스트 드리프트' 현상을 막고, 크고 복잡한 개발 문제를 단계별로 격파하는 노하우를 공개합니다. Discover the ultimate Claude Code hacking secrets to cut your system prompts in half while boosting performance! Learn how to prevent "context drift" where AI forgets instructions, and master the art of breaking down complex development problems step-by-step.

NEWPySpark: 대용량 분산 처리 DataFrame 기초
PySpark는 Apache Spark를 Python 환경에서 사용할 수 있게 해주는 API로, 대량의 데이터를 분산 처리할 수 있다. 핵심 구조로는 Driver Node, Worker Node, Cluster Manager가 있으며, RDD와 DataFrame이 주요 데이터 구조이다. 학습 로드맵은 DataFrame 기초 조작, 스파크 최적화 및 고급 기능, 확장 모듈 다루기로 구성된다. Lazy Evaluation, SparkSession 생성, 데이터 불러오기 및 변환, 집계, 조인 등의 기법을 통해 성능을 최적화할 수 있다. 또한, Spark SQL, Structured Streaming, MLlib 등의 확장 모듈을 활용하여 데이터 엔지니어링을 강화할 수 있다.

Google Antigravity 시작하기 및 실제 프로젝트 구현해보기
구글 안티그래비티를 실제 프로젝트에 적용하며 얻은 기술적 통찰을 정리한다. 단순한 코드 추천을 넘어 스스로 계획을 수립하고 실행하는 '에이전트'로서의 특징과, 실제 배포 과정에서의 생산성 및 쿼터 관리 효율성을 분석한다. 개발자의 역할이 단순 코더에서 전체 프로세스를 관리하는 디렉터로 변화하는 지점을 가식 없이 기술한다. This post provides a technical review of Google Antigravity based on real-world project application. It explores its capabilities as an autonomous "Agent" that goes beyond code suggestions to planning and execution. The review analyzes productivity gains and the realities of quota management, highlighting the industry's shift where developers evolve from manual coders into strategic directors of AI agents.