• Mindscape ๐Ÿ”ฅ
    • Playlist ๐ŸŽง
  • ๐Ÿค– Artifical Intelligence

    • 1. Basics; Linear Algebra
    • 2. Basics; Linear Algebra (2), Search (1)
    • 3. Search (2)
    • 4. Knowledge and Logic (1)
    • 5. Knowledge and Logic (2)
    • 6. Probability
    • 7. Information Theory
    • 8. Probabilitc Reasoning (2)
    • 9. Probabilitc Reasoning (3)
    • 10. Machine Learning (1)
    • 11. Machine Learning (2)
    • 12. Machine Learning (3)
    • 13. Linear Models
    • 14. Other Classic ML Models (1)
    • 15. Other Classic ML Models (2)
  • ๐Ÿ”’ Computer Security

    • 01. Overview
    • 02. ์ •๋ณด๋ณด์•ˆ์ •์ฑ… ๋ฐ ๋ฒ•๊ทœ
    • 03. Cryptographic Tools
    • 04. User Authentication
    • 05. Access Control
    • 06. Database Security
    • 07. Malicious Software
    • 08. Firmware Analysis
  • ๐Ÿ—„๏ธ Database System

    • 1. Introduction
    • 2. Relational Model
    • 3. SQL
    • 6. E-R Model
    • 7. Relational Database Design (1)
    • 7. Relational Database Design (2)
    • 13. Data Storage Structures
    • 14. Indexing
    • 15. Query Processing
  • ๐Ÿ“ Software Engineering

    • 2. Introduction to Software Engineering
    • 3. Process
    • 4. Process Models
    • 5. Agile
    • 6. Requirements
    • 7. Requirements Elicitation and Documentation
    • 8. Architecture
    • 9. Unified Modelling Language
    • 10. Object-Oriented Analysis
    • Object-Oriented Design
  • ๐Ÿง  Algorithm

    • Python ์‹œ๊ฐ„ ์ดˆ๊ณผ ๋ฐฉ์ง€๋ฅผ ์œ„ํ•œ ํŒ
    • C++ std::vector ์‚ฌ์šฉ๋ฒ• ์ •๋ฆฌ
    • Vim ์‚ฌ์šฉ ๋งค๋‰ด์–ผ
    • 1018๋ฒˆ: ์ฒด์ŠคํŒ ๋‹ค์‹œ ์น ํ•˜๊ธฐ
    • 1966๋ฒˆ: ํ”„๋ฆฐํ„ฐ ํ

8. Architecture

Learning Goals

  • architectural reasoning(์•„ํ‚คํ…์ฒ˜ ์ถ”๋ก )์˜ abstraction level(์ถ”์ƒํ™” ์ˆ˜์ค€) ์ดํ•ด
  • quality attributes(ํ’ˆ์งˆ ์†์„ฑ)๋ฅผ ์—ผ๋‘์— ๋‘๊ณ  software architecture(์†Œํ”„ํŠธ์›จ์–ด ์•„ํ‚คํ…์ฒ˜)์— ์ ‘๊ทผ
  • software architecture์™€(object-oriented) software design(๊ฐ์ฒด ์ง€ํ–ฅ ์†Œํ”„ํŠธ์›จ์–ด ์„ค๊ณ„) ๊ตฌ๋ณ„
  • ๋ชฉ์ ์— ์ ํ•ฉํ•œ ์•„ํ‚คํ…์ฒ˜๋ฅผ ๊ธฐ์ˆ ํ•˜๊ธฐ ์œ„ํ•ด notation(ํ‘œ๊ธฐ๋ฒ•)๊ณผ views(๋ทฐ) ์‚ฌ์šฉ
  • ๋ชจํ˜ธํ•จ ์—†์ด ๋ช…ํ™•ํ•˜๊ฒŒ ์•„ํ‚คํ…์ฒ˜ ๋ฌธ์„œํ™”

Where We Are

Quality Requirements, Now What?

  • "highly available(๊ณ ๊ฐ€์šฉ์„ฑ)์ด์–ด์•ผ ํ•จ".
  • "์‹ ์†ํ•˜๊ฒŒ ์‘๋‹ตํ•ด์•ผ ํ•จ, accuracy(์ •ํ™•์„ฑ)์€ ๋œ ๊ด€๋ จ๋จ".
  • "extensible(ํ™•์žฅ ๊ฐ€๋Šฅ)ํ•ด์•ผ ํ•จ".
  • "hardware resources(ํ•˜๋“œ์›จ์–ด ์ž์›)๋ฅผ ํšจ์œจ์ ์œผ๋กœ ์‚ฌ์šฉํ•ด์•ผ ํ•จ".

Software Architecture

Software Architecture

  • ํ”„๋กœ๊ทธ๋žจ ๋˜๋Š” ์ปดํ“จํŒ… ์‹œ์Šคํ…œ์˜ software architecture๋Š” ์‹œ์Šคํ…œ์˜ ๊ตฌ์กฐ ๋˜๋Š” ๊ตฌ์กฐ๋“ค๋กœ์„œ, software elements(์†Œํ”„ํŠธ์›จ์–ด ์š”์†Œ), ํ•ด๋‹น ์š”์†Œ๋“ค์˜ externally visible properties(์™ธ๋ถ€์— ๋ณด์ด๋Š” ์†์„ฑ), ๊ทธ๋ฆฌ๊ณ  ๊ทธ๋“ค ๊ฐ„์˜ relationships(๊ด€๊ณ„)๋ฅผ ํฌํ•จํ•จ.
  • [Bass et al., Software Architecture in Practice 2nd ed., 2003]

Software Architecture Example

  • ์ข‹์Œ?

Why Architecture? [Bass et al., 2003]

  • ๊ฐ€์žฅ ์ด๋ฅธ design decisions(์„ค๊ณ„ ๊ฒฐ์ •) ํ‘œํ˜„.
  • Aids in communication with stakeholders(์ดํ•ด๊ด€๊ณ„์ž์™€์˜ ์˜์‚ฌ์†Œํ†ต)
    • ๊ทธ๋“ค์ด ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋Š” ์ˆ˜์ค€์—์„œ "how(๋ฐฉ๋ฒ•)"๋ฅผ ๋ณด์—ฌ์ฃผ์–ด, ๊ทธ๊ฒƒ์ด ๊ทธ๋“ค์˜ ์š”๊ตฌ๋ฅผ ์ถฉ์กฑํ•˜๋Š”์ง€์— ๋Œ€ํ•œ ์งˆ๋ฌธ ์ œ๊ธฐ
  • Defines constraints on implementation(๊ตฌํ˜„์— ๋Œ€ํ•œ ์ œ์•ฝ)
    • ์„ค๊ณ„ ๊ฒฐ์ •์ด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ "load-bearing walls(๋‚ด๋ ฅ๋ฒฝ)" ํ˜•์„ฑ
  • Dictates organizational structure(์กฐ์ง ๊ตฌ์กฐ)
    • ํŒ€์ด ์„œ๋กœ ๋‹ค๋ฅธ components(๊ตฌ์„ฑ์š”์†Œ) ์ž‘์—…
  • Inhibits or enables quality attributes
    • design patterns(์„ค๊ณ„ ํŒจํ„ด)๊ณผ ์œ ์‚ฌ
  • Supports predicting cost, quality, and schedule(๋น„์šฉ, ํ’ˆ์งˆ, ์ผ์ • ์˜ˆ์ธก ์ง€์›)
    • ์ผ๋ฐ˜์ ์œผ๋กœ ๊ฐ ๊ตฌ์„ฑ์š”์†Œ์˜ ์ •๋ณด๋ฅผ ์˜ˆ์ธกํ•จ์œผ๋กœ์จ
  • Aids in software evolution(์†Œํ”„ํŠธ์›จ์–ด ์ง„ํ™” ์ง€์›)
    • ๋ณ€๊ฒฝ์˜ ๋น„์šฉ, ์„ค๊ณ„, ์˜ํ–ฅ์— ๋Œ€ํ•ด ์ถ”๋ก 
  • Aids in prototyping(ํ”„๋กœํ† ํƒ€์ดํ•‘ ์ง€์›)
    • architectural skeleton(์•„ํ‚คํ…์ฒ˜ ์Šค์ผˆ๋ ˆํ†ค)์„ ์กฐ๊ธฐ์— ๊ตฌํ˜„ ๊ฐ€๋Šฅ

Beyond Functional Correctness

  • ํ’ˆ์งˆ์ด ์ค‘์š”ํ•จ. ์˜ˆ:
    • Performance(์„ฑ๋Šฅ)
    • Availability(๊ฐ€์šฉ์„ฑ)
    • Modifiability(์ˆ˜์ • ์šฉ์ด์„ฑ), portability(์ด์‹์„ฑ)
    • Scalability(ํ™•์žฅ์„ฑ)
    • Security(๋ณด์•ˆ)
    • Testability(ํ…Œ์ŠคํŠธ ์šฉ์ด์„ฑ)
    • Usability(์‚ฌ์šฉ์„ฑ)
    • ๊ตฌ์ถ• ๋น„์šฉ, ์šด์˜ ๋น„์šฉ

Case Study: Architecture and Quality at Twitter(Now Xโ€ฆ)

Twitter Suffered From Over Capacity

โ€ฆdue to the Big Event

Inspecting the State of Engineering

  • ์„ธ๊ณ„ ์ตœ๋Œ€ ๊ทœ๋ชจ์˜ Ruby on Rails ์„ค์น˜ ์ค‘ ํ•˜๋‚˜ ์šด์˜
    • 200๋ช…์˜ ์—”์ง€๋‹ˆ์–ด
  • Monolithic(๋ชจ๋†€๋ฆฌ์‹): ์›์‹œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค, memcache ๊ด€๋ฆฌ, ์‚ฌ์ดํŠธ ๋ Œ๋”๋ง, ๊ณต์šฉ API ์ œ๊ณต์„ ํ•˜๋‚˜์˜ ์ฝ”๋“œ๋ฒ ์ด์Šค์—์„œ ์ˆ˜ํ–‰
  • ์‹œ์Šคํ…œ ์ดํ•ด๊ฐ€ ์ ์  ์–ด๋ ค์›Œ์ง; ์—”์ง€๋‹ˆ์–ด๋ง ํŒ€ ๊ด€๋ฆฌ ๋ฐ ๋ณ‘๋ ฌํ™”๊ฐ€ ์กฐ์ง์ ์œผ๋กœ ์–ด๋ ค์›€
  • ์Šคํ† ๋ฆฌ์ง€ ์‹œ์Šคํ…œ(MySQL)์˜ throughput(์ฒ˜๋ฆฌ๋Ÿ‰) ํ•œ๊ณ„ ๋„๋‹ฌ; ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ „๋ฐ˜์˜ ์ฝ๊ธฐ ๋ฐ ์“ฐ๊ธฐ hot spots(ํ•ซ์ŠคํŒŸ)
  • ๋ฌธ์ œ ํ•ด๊ฒฐ์„ ์œ„ํ•ด ๊ธฐ๊ณ„ ํˆฌ์ž…; ๊ธฐ๊ณ„๋‹น ๋‚ฎ์€ ์ฒ˜๋ฆฌ๋Ÿ‰(CPU + RAM ํ•œ๊ณ„, ๋„คํŠธ์›Œํฌ๋Š” ํฌํ™”๋˜์ง€ ์•Š์Œ)
  • ์ตœ์ ํ™”์˜ ๋”œ๋ ˆ๋งˆ: ์ฝ”๋“œ ๊ฐ€๋…์„ฑ vs ์„ฑ๋Šฅ ํŠธ๋ ˆ์ด๋“œ์˜คํ”„
  • https://blog.x.com/engineering/en_us/a/2013/new-tweets-per-second-record-and-how

Twitter's Quality Requirements / Redesign goals??

  • Improve median latency(์ค‘์•™๊ฐ’ ์ง€์—ฐ ์‹œ๊ฐ„ ๊ฐœ์„ ); lower outliers(์ด์ƒ์น˜ ๊ฐ์†Œ)
  • Reduce number of machines 10x(๊ธฐ๊ณ„ ์ˆ˜ 10๋ฐฐ ๊ฐ์†Œ)
  • Isolate failures(์žฅ์•  ๊ฒฉ๋ฆฌ)
  • "์šฐ๋ฆฌ๋Š” '๊ด€๋ จ๋œ' ๋กœ์ง์ด ํ•œ๊ณณ์— ์žˆ๋Š” ๋” ๊นจ๋—ํ•œ ๊ฒฝ๊ณ„๋ฅผ ์›ํ–ˆ์Œ" -(ํด๋ž˜์Šค, ๋ชจ๋“ˆ, ํŒจํ‚ค์ง€ ์ˆ˜์ค€์ด ์•„๋‹Œ) ์‹œ์Šคํ…œ ์ˆ˜์ค€์—์„œ์˜ encapsulation(์บก์Аํ™”) ๋ฐ modularity(๋ชจ๋“ˆ์„ฑ)
  • Quicker release of new features(์‹ ๊ทœ ๊ธฐ๋Šฅ์˜ ๋” ๋น ๋ฅธ ์ถœ์‹œ)
    • "๋‹ค๋ฅธ ํŒ€๊ณผ ๋…๋ฆฝ์ ์œผ๋กœ ๋กœ์ปฌ ๊ฒฐ์ •์„ ๋‚ด๋ฆฌ๊ณ  ์‚ฌ์šฉ์ž ๋Œ€์ƒ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ๋Š”, ์ž‘๊ณ  ๊ถŒํ•œ์ด ๋ถ€์—ฌ๋œ ์—”์ง€๋‹ˆ์–ด๋ง ํŒ€ ์šด์˜"

Caching

JVM vs RubyVM

  • Rails ์„œ๋ฒ„๋Š” ํ˜ธ์ŠคํŠธ๋‹น 200-300 requests / sec ๊ฐ€๋Šฅ
  • JVM์—์„œ์˜ Scala ๊ฒฝํ—˜; ์‹ ๋ขฐ ์ˆ˜์ค€
  • JVM์œผ๋กœ ์žฌ์ž‘์„ฑํ•˜์—ฌ ํ˜ธ์ŠคํŠธ๋‹น 10-20k requests / sec ํ—ˆ์šฉ

Programming Model

  • Ruby model: Concurrency(๋™์‹œ์„ฑ) at process level(ํ”„๋กœ์„ธ์Šค ์ˆ˜์ค€); ์š”์ฒญ์ด ํ์— ์Œ“์—ฌ ํ•˜๋‚˜์˜ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ฒ˜๋ฆฌ
  • Twitter ์‘๋‹ต์€ ์—ฌ๋Ÿฌ ์„œ๋น„์Šค์—์„œ ์ง‘๊ณ„๋จ โ€“ ์‘๋‹ต ์‹œ๊ฐ„ ํ•ฉ์‚ฐ
  • "์‹œ์Šคํ…œ์„ ์„œ๋น„์Šค๋กœ ๋ถ„ํ•ดํ•˜๊ธฐ ์‹œ์ž‘ํ•˜๋ฉด์„œ ๊ฐ ํŒ€์€ ์•ฝ๊ฐ„์”ฉ ๋‹ค๋ฅธ ์ ‘๊ทผ ๋ฐฉ์‹์„ ์ทจํ–ˆ์Œ. ์˜ˆ๋ฅผ ๋“ค์–ด, ํด๋ผ์ด์–ธํŠธ์—์„œ ์„œ๋น„์Šค๋กœ์˜ ์žฅ์•  ์˜๋ฏธ๋ก ์ด ์ž˜ ์ƒํ˜ธ์ž‘์šฉํ•˜์ง€ ์•Š์•˜์Œ: ์„œ๋ฒ„๊ฐ€ ํด๋ผ์ด์–ธํŠธ์— ๋‹ค์‹œ ์‹ ํ˜ธ๋ฅผ ๋ณด๋‚ผ ์ผ๊ด€๋œ back-pressure(์—ญ์••๋ ฅ) ๋ฉ”์ปค๋‹ˆ์ฆ˜์ด ์—†์—ˆ๊ณ , ์ง€์—ฐ ์‹œ๊ฐ„์ด ๊ธด ์„œ๋น„์Šค๋ฅผ ๊ณต๊ฒฉ์ ์œผ๋กœ ์žฌ์‹œ๋„ํ•˜๋Š” ํด๋ผ์ด์–ธํŠธ๋กœ ์ธํ•œ 'thundering herds(๋ชฐ๋ ค๋“œ๋Š” ๋ฌด๋ฆฌ)' ํ˜„์ƒ ๊ฒฝํ—˜."
  • ๋ชฉํ‘œ: ๋™์‹œ์„ฑ์— ๋Œ€ํ•ด ์ƒ๊ฐํ•˜๋Š” ๋‹จ์ผํ•˜๊ณ  ํ†ต์ผ๋œ ๋ฐฉ์‹
    • RPC(Finagle), connection pooling(์ปค๋„ฅ์…˜ ํ’€๋ง), failover strategies(์žฅ์•  ๊ทน๋ณต ์ „๋žต), load balancing(๋กœ๋“œ ๋ฐธ๋Ÿฐ์‹ฑ)์„ ์œ„ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ ๊ตฌํ˜„

Independent Systems

  • "๋ชจ๋†€๋ฆฌ์‹ ํ™˜๊ฒฝ์—์„œ๋Š” ์ „์ฒด ์ฝ”๋“œ๋ฒ ์ด์Šค๋ฅผ ์ดํ•ดํ•˜๋Š” ์ „๋ฌธ๊ฐ€ ๋˜๋Š” ๋ชจ๋“ˆ/ํด๋ž˜์Šค ์ˆ˜์ค€์˜ ๋ช…ํ™•ํ•œ ์†Œ์œ ์ž๊ฐ€ ํ•„์š”ํ–ˆ์Œ. ์•ˆํƒ€๊น๊ฒŒ๋„ ์ฝ”๋“œ๋ฒ ์ด์Šค๊ฐ€ ๋„ˆ๋ฌด ์ปค์ ธ์„œ ๊ธ€๋กœ๋ฒŒ ์ „๋ฌธ๊ฐ€๋ฅผ ๋‘๊ธฐ ์–ด๋ ค์› ๊ณ , ์‹ค์ œ๋กœ๋Š” ๋ชจ๋“ˆ/ํด๋ž˜์Šค ์ˆ˜์ค€์˜ ๋ช…ํ™•ํ•œ ์†Œ์œ ์ž ๋ฐฉ์‹์ด ์ž‘๋™ํ•˜์ง€ ์•Š์•˜์Œ. ์ฝ”๋“œ๋ฒ ์ด์Šค ์œ ์ง€๊ฐ€ ์ ์  ๋” ์–ด๋ ค์›Œ์กŒ๊ณ , ํŒ€๋“ค์€ ํŠน์ • ๊ธฐ๋Šฅ์„ ์ดํ•ดํ•˜๊ธฐ ์œ„ํ•ด '๊ณ ๊ณ ํ•™ ๋ฐœ๊ตด'์„ ํ•˜๊ฑฐ๋‚˜, ๋ฐœ์ƒํ•˜๋Š” ๋Œ€๊ทœ๋ชจ ์žฅ์• ๋ฅผ ์ดํ•ดํ•˜๊ธฐ ์œ„ํ•ด '๊ณ ๋ž˜ ์‚ฌ๋ƒฅ ์›์ •๋Œ€'๋ฅผ ์กฐ์งํ•˜๋Š” ๋ฐ ๋Š์ž„์—†์ด ์‹œ๊ฐ„์„ ๋ณด๋ƒˆ์Œ."
  • ๋ชจ๋†€๋ฆฌ์‹ ์‹œ์Šคํ…œ์—์„œ ๋‹ค์ค‘ ์„œ๋น„์Šค๋กœ
    • RPC interfaces(RPC ์ธํ„ฐํŽ˜์ด์Šค) ํ•ฉ์˜, ์‹œ์Šคํ…œ ๋‚ด๋ถ€ ๋…๋ฆฝ์  ๊ฐœ๋ฐœ
    • Self-contained teams(์ž์ฒด ์™„๊ฒฐํ˜• ํŒ€)

Storage

  • Single-master MySQL database bottleneck(๋‹จ์ผ ๋งˆ์Šคํ„ฐ MySQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ณ‘๋ชฉ ํ˜„์ƒ)
  • Temporal clustering(์‹œ๊ฐ„์  ํด๋Ÿฌ์Šคํ„ฐ๋ง)
    • ๋‹จ๊ธฐ ํ•ด๊ฒฐ์ฑ…
    • ํŽธ์ค‘๋œ ๋กœ๋“œ ๋ฐธ๋Ÿฐ์Šค
    • 3์ฃผ๋งˆ๋‹ค ๊ธฐ๊ณ„ 1๋Œ€ + replications(๋ณต์ œ)
  • "๋Œ€๋žต ์ •๋ ฌ ๊ฐ€๋Šฅํ•œ" ID๋ฅผ ๊ฐ€์ง„ distributed database(๋ถ„์‚ฐ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค)(Gizzard on MySQL)๋กœ ์ด๋™

Data-Driven Decisions

  • ์ž‘๊ณ  ๋…๋ฆฝ์ ์ธ ์„œ๋น„์Šค ๋‹ค์ˆ˜, ๊ฐœ์ˆ˜ ์ฆ๊ฐ€
  • RPC framework(RPC ํ”„๋ ˆ์ž„์›Œํฌ) ์œ„์— ์ž์ฒด dynamic analysis tool(๋™์  ๋ถ„์„ ๋„๊ตฌ) ๊ตฌ์ถ•
  • ๋งŽ์€ ์ˆ˜์˜ ๊ธฐ๊ณ„๋ฅผ ๊ตฌ์„ฑํ•˜๊ธฐ ์œ„ํ•œ ํ”„๋ ˆ์ž„์›Œํฌ
    • ์‚ฌ์šฉ์ž ์ผ๋ถ€์—๊ฒŒ๋งŒ ๊ธฐ๋Šฅ์„ ๋…ธ์ถœํ•˜๋Š” ๊ธฐ๋Šฅ ํฌํ•จ

Success Story: ๅคฉ็ฉบใฎๅŸŽใƒฉใƒ”ใƒฅใ‚ฟ(Castle in the sky)

Data-Driven Decisions

  • ์ผ๋ณธ์—์„œ 8์›” 3์ผ ํ† ์š”์ผ, ์‚ฌ๋žŒ๋“ค์ด <์ฒœ๊ณต์˜ ์„ฑ ๋ผํ“จํƒ€> ๋ฐฉ์˜์„ ์‹œ์ฒญํ•˜๋ฉฐ ํŠธ์œ„ํ„ฐ์— ๋ชฐ๋ ค๋“ค์–ด, ์ดˆ๋‹น 143,199 ํŠธ์œ—์ด๋ผ๋Š” ์ •์ ์„ ๊ธฐ๋กํ•จ.
  • New Tweets per second(TPS) record(์ดˆ๋‹น ์‹ ๊ทœ ํŠธ์œ— ์ˆ˜ ๊ธฐ๋ก): 143,199 TPS.
  • Typical day(ํ‰์ƒ์‹œ): 5์–ต ๊ฐœ ์ด์ƒ์˜ ํŠธ์œ— ์ „์†ก; ํ‰๊ท  5,700 TPS

Key Insights: Twitter Case Study

  • Architectural decisions(์•„ํ‚คํ…์ฒ˜ ๊ฒฐ์ •)์€ ๊ฐœ๋ณ„ ๋ชจ๋“ˆ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ์ „์ฒด ์‹œ์Šคํ…œ์— ์˜ํ–ฅ
  • Abstract(์ถ”์ƒ์ ), ๋‹ค์–‘ํ•œ ์‹œ๋‚˜๋ฆฌ์˜ค์— ๋Œ€ํ•œ ๋‹ค์–‘ํ•œ ์ถ”์ƒํ™”
  • quality attributes์— ๋Œ€ํ•ด ์กฐ๊ธฐ์— ์ถ”๋ก 
  • ์•„ํ‚คํ…์ฒ˜ ๊ฒฐ์ •์„ explicit(๋ช…์‹œ์ )ํ•˜๊ฒŒ ๋งŒ๋“ฆ
  • ์งˆ๋ฌธ: ์›๋ž˜ ์•„ํ‚คํ…ํŠธ๊ฐ€ ์ž˜๋ชป๋œ ๊ฒฐ์ •์„ ๋‚ด๋ ธ๋Š”๊ฐ€?

Architecture is Evolving

Architecture vs(Object-level) Design

Levels of Abstraction

  • Requirements(์š”๊ตฌ์‚ฌํ•ญ)
    • high-level โ€œwhatโ€(์ƒ์œ„ ์ˆ˜์ค€ "๋ฌด์—‡์„")
  • Architecture(High-level design)(์•„ํ‚คํ…์ฒ˜(์ƒ์œ„ ์ˆ˜์ค€ ์„ค๊ณ„))
    • high-level โ€œhowโ€, mid-level โ€œwhatโ€
  • OO-Design(Low-level design, e.g., design patterns)(OO ์„ค๊ณ„(ํ•˜์œ„ ์ˆ˜์ค€ ์„ค๊ณ„, ์˜ˆ: ์„ค๊ณ„ ํŒจํ„ด))
    • mid-level โ€œhowโ€, low-level โ€œwhatโ€
  • Code(์ฝ”๋“œ)
    • low-level โ€œhowโ€

Architecture vs Design

Architectural Questions

  • Eclipse๋ฅผ plugin(ํ”Œ๋Ÿฌ๊ทธ์ธ)์œผ๋กœ ์–ด๋–ป๊ฒŒ ํ™•์žฅํ•˜๋Š”๊ฐ€?
  • ์–ด๋–ค threads(์Šค๋ ˆ๋“œ)๊ฐ€ ์กด์žฌํ•˜๋ฉฐ ์–ด๋–ป๊ฒŒ coordinate(์กฐ์ •)๋˜๋Š”๊ฐ€?
  • Google์€ ํ•˜๋ฃจ ์ˆ˜์‹ญ์–ต ๊ฑด์˜ ํžˆํŠธ๋ฅผ ์–ด๋–ป๊ฒŒ scale(ํ™•์žฅ)ํ•˜๋Š”๊ฐ€?
  • firewalls(๋ฐฉํ™”๋ฒฝ)์„ ์–ด๋””์— ๋‘์–ด์•ผ ํ•˜๋Š”๊ฐ€?
  • subsystems(ํ•˜์œ„ ์‹œ์Šคํ…œ) ๊ฐ„์˜ interface(์ธํ„ฐํŽ˜์ด์Šค)๋Š” ๋ฌด์—‡์ธ๊ฐ€?

Design Questions

  • Eclipse์— ๋ฉ”๋‰ด ํ•ญ๋ชฉ์„ ์–ด๋–ป๊ฒŒ ์ถ”๊ฐ€ํ•˜๋Š”๊ฐ€?
  • Eclipse์— ๋ฉ”๋‰ด ํ•ญ๋ชฉ์„ ์‰ฝ๊ฒŒ ์ถ”๊ฐ€ํ•˜๋ ค๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ•˜๋Š”๊ฐ€?
  • ์–ด๋–ค lock(์ž ๊ธˆ)์ด ์ด ๋ฐ์ดํ„ฐ๋ฅผ ๋ณดํ˜ธํ•˜๋Š”๊ฐ€?
  • Google์€ ํŽ˜์ด์ง€ ์ˆœ์œ„๋ฅผ ์–ด๋–ป๊ฒŒ ๋งค๊ธฐ๋Š”๊ฐ€?
  • ๋ณด์•ˆ ํ†ต์‹ ์„ ์œ„ํ•ด ์–ด๋–ค encoder(์ธ์ฝ”๋”)๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋Š”๊ฐ€?
  • objects(๊ฐ์ฒด) ๊ฐ„์˜ ์ธํ„ฐํŽ˜์ด์Šค๋Š” ๋ฌด์—‡์ธ๊ฐ€? Objects

Architecture Disentangled

  • Architecture as structures and relations(๊ตฌ์กฐ์™€ ๊ด€๊ณ„๋กœ์„œ์˜ ์•„ํ‚คํ…์ฒ˜)(the actual system - ์‹ค์ œ ์‹œ์Šคํ…œ)
  • Architecture as documentation(๋ฌธ์„œํ™”๋กœ์„œ์˜ ์•„ํ‚คํ…์ฒ˜)(representations of the system - ์‹œ์Šคํ…œ์˜ ํ‘œํ˜„)
  • Architecture as(design) process((์„ค๊ณ„) ํ”„๋กœ์„ธ์Šค๋กœ์„œ์˜ ์•„ํ‚คํ…์ฒ˜)(activities around the other two - ๋‹ค๋ฅธ ๋‘ ๊ฐ€์ง€๋ฅผ ๋‘˜๋Ÿฌ์‹ผ ํ™œ๋™)

Why Document Architecture?

  • ์‹œ์Šคํ…œ์„ ์œ„ํ•œ Blueprint(์ฒญ์‚ฌ์ง„)
    • ์กฐ๊ธฐ ๋ถ„์„์„ ์œ„ํ•œ ์‚ฐ์ถœ๋ฌผ
    • quality attributes์˜ ์ฃผ์š” ์ „๋‹ฌ์ž
    • ๋ฐฐํฌ ํ›„ ์œ ์ง€๋ณด์ˆ˜ ๋ฐ ํ–ฅ์ƒ์˜ ํ•ต์‹ฌ
  • ๋ฌธ์„œํ™”๋Š” ํ˜„์žฌ์™€ 20๋…„ ํ›„์˜ ์•„ํ‚คํ…ํŠธ๋ฅผ ๋Œ€๋ณ€ํ•จ
    • ์‹œ์Šคํ…œ์ด ๋ฌธ์„œํ™”๋œ ์•„ํ‚คํ…์ฒ˜์— ๋”ฐ๋ผ ๊ตฌ์ถ•, ์œ ์ง€๋ณด์ˆ˜, ์ง„ํ™”ํ•˜๋Š” ๋™์•ˆ
  • Support traceability(์ถ”์ ์„ฑ ์ง€์›).

Different Views

Common Views in Documenting Software Architecture

  • Static View(์ •์  ๋ทฐ)
    • Modules(๋ชจ๋“ˆ)(subsystems, structures) ๋ฐ ๊ทธ๋“ค์˜ relations(๊ด€๊ณ„)(dependencies(์˜์กด์„ฑ), โ€ฆ)
  • Dynamic View(๋™์  ๋ทฐ)
    • Components(processes(ํ”„๋กœ์„ธ์Šค), runnable entities) ๋ฐ connectors(์ปค๋„ฅํ„ฐ)(messages(๋ฉ”์‹œ์ง€), data flow(๋ฐ์ดํ„ฐ ํ๋ฆ„), โ€ฆ)
  • Physical View(Deployment)(๋ฌผ๋ฆฌ์  ๋ทฐ(๋ฐฐํฌ))
    • Hardware structures(ํ•˜๋“œ์›จ์–ด ๊ตฌ์กฐ) ๋ฐ ๊ทธ๋“ค์˜ connections(์—ฐ๊ฒฐ)

Views and Purposes

  • ๋ชจ๋“  ๋ทฐ๋Š” ๋ชฉ์ ๊ณผ ์ผ์น˜ํ•ด์•ผ ํ•จ.
  • ์„œ๋กœ ๋‹ค๋ฅธ ๋ทฐ๋Š” ์„œ๋กœ ๋‹ค๋ฅธ ์ถ”๋ก  ์ธก๋ฉด(๋‹ค๋ฅธ ํ’ˆ์งˆ ๋ชฉํ‘œ)์— ์ ํ•ฉํ•จ. ์˜ˆ:
    • Performance
    • Extensibility
    • Security
    • Scalability
    • โ€ฆ

Online Shopping Architecture

Selecting a Notation

  • ๋ชฉ์ ์— ์ ํ•ฉ
  • ๊ฐ„๊ฒฐํ•œ ํ‘œํ˜„์„ ์œ„ํ•ด ์ข…์ข… ์‹œ๊ฐ์ 
  • ์ผ๋ฐ˜์ ์œผ๋กœ ์ƒ์ž์™€ ํ™”์‚ดํ‘œ
  • UML ๊ฐ€๋Šฅ(semi-formal(์ค€์ •ํ˜•)), ํ•˜์ง€๋งŒ ์ œ์•ฝ์ด ์žˆ์„ ์ˆ˜ ์žˆ์Œ
    • ๋‹ค๋ฅธ ์ถ”์ƒํ™” ์ˆ˜์ค€์— ์œ ์˜ โ€“ ํด๋ž˜์Šค๋‚˜ ๊ฐ์ฒด๊ฐ€ ์•„๋‹Œ ํ•˜์œ„ ์‹œ์Šคํ…œ ๋˜๋Š” ํ”„๋กœ์„ธ์Šค
  • Formal notations(์ •ํ˜• ํ‘œ๊ธฐ๋ฒ•) ์‚ฌ์šฉ ๊ฐ€๋Šฅ
  • ๋‹ค์ด์–ด๊ทธ๋žจ์„ ๊ณ„์ธต์ ์œผ๋กœ ๊ทธ๋ฆฌ๊ณ  ๋ทฐ ๋‹จ์œ„๋กœ ๋ถ„ํ•ด

What is Wrong Today?

  • ํ˜„์—…์˜ ์‹ค์ œ ๋ฌธ์„œํ™”๋Š” ๋‹ค์Œ์œผ๋กœ ๊ตฌ์„ฑ๋จ
    • Ambiguous(๋ชจํ˜ธํ•œ) ์ƒ์ž-์„  ๋‹ค์ด์–ด๊ทธ๋žจ
    • ์ผ๊ด€์„ฑ ์—†๋Š” ํ‘œ๊ธฐ๋ฒ• ์‚ฌ์šฉ
    • ํ˜ผ๋ž€์Šค๋Ÿฌ์šด ๋ทฐ ์œ ํ˜•์˜ ์กฐํ•ฉ
  • ๋งŽ์€ ๊ฒƒ๋“ค์ด ๋ช…์‹œ๋˜์ง€ ์•Š์€ ์ฑ„ ๋‚จ์•„ ์žˆ์Œ:
    • ์–ด๋–ค ์ข…๋ฅ˜์˜ ์š”์†Œ์ธ๊ฐ€?
    • ์–ด๋–ค ์ข…๋ฅ˜์˜ ๊ด€๊ณ„์ธ๊ฐ€?
    • ์ƒ์ž์™€ ํ™”์‚ดํ‘œ๋Š” ๋ฌด์—‡์„ ์˜๋ฏธํ•˜๋Š”๊ฐ€?
    • ๋ ˆ์ด์•„์›ƒ์˜ ์ค‘์š”์„ฑ์€ ๋ฌด์—‡์ธ๊ฐ€?

What Could the Arrow Mean?

  • ๋งŽ์€ ๊ฐ€๋Šฅ์„ฑ
    • A๊ฐ€ B์—๊ฒŒ ์ œ์–ด๊ถŒ ์ „๋‹ฌ
    • A๊ฐ€ B์—๊ฒŒ ๋ฐ์ดํ„ฐ ์ „๋‹ฌ
    • A๊ฐ€ B๋กœ๋ถ€ํ„ฐ ๊ฐ’ ํš๋“
    • A๊ฐ€ B์—๊ฒŒ ๋ฐ์ดํ„ฐ ์ŠคํŠธ๋ฆฌ๋ฐ
    • A๊ฐ€ B์—๊ฒŒ ๋ฉ”์‹œ์ง€ ์ „์†ก
    • A๊ฐ€ B ์ƒ์„ฑ
    • A๊ฐ€ B๋ณด๋‹ค ๋จผ์ € ๋ฐœ์ƒ
    • B๊ฐ€ A๋กœ๋ถ€ํ„ฐ ์ „๊ธฐ ๊ณต๊ธ‰๋ฐ›์Œ

Guidelines: Avoiding Ambiguity

  • ํ•ญ์ƒ legend(๋ฒ”๋ก€) ํฌํ•จ
  • ์ƒ์ž๊ฐ€ ์˜๋ฏธํ•˜๋Š” ๋ฐ”๋ฅผ ์ •ํ™•ํ•˜๊ฒŒ ์ •์˜
  • ์„ ์ด ์˜๋ฏธํ•˜๋Š” ๋ฐ”๋ฅผ ์ •ํ™•ํ•˜๊ฒŒ ์ •์˜
  • ์˜๋„์น˜ ์•Š๊ฒŒ ๋ทฐ ์œ ํ˜• ํ˜ผํ•ฉ ๊ธˆ์ง€
    • ์ƒ๊ธฐ: Module(classes), C&C(components)
  • ๊ทธ๋ž˜ํ”ฝ์„ ์„ค๋ช…์œผ๋กœ ๋ณด์ถฉ
    • ๋งค์šฐ ์ค‘์š”: rationale(์ด๋ก ์  ๊ทผ๊ฑฐ)(architectural intent - ์•„ํ‚คํ…์ฒ˜ ์˜๋„)
  • ํ•˜๋‚˜์˜ ๋‹ค์ด์–ด๊ทธ๋žจ์— ๋„ˆ๋ฌด ๋งŽ์€ ๊ฒƒ์„ ํ•˜๋ ค๊ณ  ์‹œ๋„ ๊ธˆ์ง€
    • ์•„ํ‚คํ…์ฒ˜์˜ ๊ฐ ๋ทฐ๋Š” ํ•œ ํŽ˜์ด์ง€์— ๋งž์•„์•ผ ํ•จ
    • ๊ณ„์ธต ๊ตฌ์กฐ ์‚ฌ์šฉ

Common Software Architectures

Pipes and Filters

  • https://medium.com/@e0324913/pipe-and-filter-software-architecture-cdf47a14d789

Pipes and Filters Example: Compilers

Object-Oriented Organization

  • David Garlan and Mary Shaw, CMU/SEI-94-TR-021

Event-Driven Architecture

Event-Driven Architecture Example: HTML DOM + JavaScript

Blackboard Architecture

Layered Architecture

Layered Architecture Example: Internet Protocol Suite

์ตœ๊ทผ ์ˆ˜์ •: 25. 11. 6. ์˜คํ›„ 12:07
Contributors: kmbzn
Prev
7. Requirements Elicitation and Documentation
Next
9. Unified Modelling Language

BUILT WITH

CloudflareNode.jsGitHubGitVue.jsJavaScriptVSCodenpm

All trademarks and logos are property of their respective owners.
ยฉ 2025 kmbzn ยท MIT License