Architecture
GitbookCourses2021-02-16
๐ก Software Architecture Foundations
LinkedIn, Allen Holub
๐ช 1. The Software Architect
UML: Unified Modeling Language, xmind
๐ Modern Architects
Agile Software Development (incremental design)
An Agile Architect (Servant ไปไบบ Leader) duty:
- teaching, coaching, coordinating
- main design responsibility: assures coherence(่ฟ่ดฏๆง) across the system (reviews work, makes suggestions, helps refine process)
- guide, direction, collaboratively, make decisions
- Researching is part of job: programmers, conferences, vendors, operations
Daily work
- 9:00am meeting: ba, po, tech leader, scrum master, developers, ui/ux designers, db experts, testers, devops,
- 10:30am: Sprint Review
- 2:00pm: techincal understanding and availibility, trade-offs(ๆ่กก), innerconnections, etc(open-source research, license, dependencies, firewall setup, backup, searching engines, kubernates, i18n, cloud/api integration)
- meetup, work collaboratively
Good Architecture
- Simplicity
- Maintainability
- Testability
๐ Thinking Architecturally
- Conwayโs law: Architecutre and organization structure
- Story: a description of the userโs work - a story touches every piece of the system
- Agile Incremental Designs: Customer, Stories, Technology
- DDD (Domain-Driven Design): The structure of your code should map to the structure of the problem domain.( =300x200)
- ubiquitous language(ๆ ๅคไธๅจ็่ฏญ่จ) in DDD: universal notation, such as SKU=order item,
- JIRA, Sticky notes
- -
๐ System vs. enterprise architecture (EA)
Broad architectural patterns
๐ monolith ๆดไฝๅผ
- homogeneous (ๅ่ดจ) structure, heterogeneous (ๅผ่ดจ), Protocol Aware Heterogeneous Interoperability (ๅ่ฎฎๆ็ฅๅผๆไบๆไฝๆง)
- N-Tier
๐ Microkernel(plugin) architecture
- Isolation prevents big ball-of-mud dependencies
- Plugins are small and easy to write, debug, and maintain
๐ Message-based architectures
- producer, broker, consumer
- Pub/Sub Model
- messaging infrastructure
๐ Microservices and miniservices
- Small (few hundred lines of source codes)
- independently deployable
- fully autonomous(่ชไธปๆง)
- distributed
- Highly observable
- Modeled around business concepts
๐ Reactive and choreographed(็ผๆ) systems
๐ช 2. Microservices Foundations
- Decompositions, System Decompositions
- polyglot (ๅค็ง่ฏญ่จ) development support
- All communications over ReST/GraphQL
- The stages of evolution in modern software servicce architectures, from oldest to most modern are: N-Tier, SOA, Microservices
- BPEL (Business Process Execution Language) is an XML-based language that allows Web services in a service-oriented architecture (SOA) to interconnect and share data. Programmers use BPEL to define how a business process that involves web services will be executed.
- ACID: atomic, consitent, isolated, durable transaction
- BASE
๐ช 3. Node.js: Design Patterns
๐ Creational Patterns
- singleton
- prototype
- factory
-
builder
class Person { constructor(builder) { this.name = name; this.isEmployee = builder.isEmployee; this.shoppingList = builder.shoppingList || []; } toString() { return JSON.stringify(this); } } class PersonBuilder { constructor(name) { this.name = name; } makeEmployee() { this.isEmployee = true; return this; } build() { return new Person(this); } } const bill = new PersonBuilder("Bill").makeEmployee().makePartTime().build(); console.log(bill.toString());
๐ Structural Patterns
- adapter: ๅ ผๅฎนไธๅ็ฏๅข๏ผๆฏๅฆ browser ็ฏๅขๅ nodejs ็ฏๅข็ๅ ผๅฎนใ
- proxy
- composite ็ปผๅ
- decorator
See
github/test/my-package
๐ Behaviral Patterns
- command
- iterator
- observer
- strategy
๐ช 4. Software Architecture Patterns
๐ Design Patterns vs. Architecture Patterns (higher level)
๐ Categories of patterns (3)
-
Application Landscape Patterns
- Monolith
- N-tier (BusinessTier, DataTier, PresentationTier, โฆ)
- Service-oriented
- Microservices
- Serverless
- Peer-to-peer (discoverable)
-
Application Streucture Patterns
- Layered
- Microkernel
- Command Query Responsibility Segregation (CQRS)
- Event sourcing
- Command Query Responsibilityy Segregation and event souring combined
-
User Interface Patterns
- Model-view-controller(MVC)
- Model-view-presenter (MVP)
- Model-view-viewmodel (MVVM)
๐ Application Landscape Patterns
- SOA: Service-Oriented Architecture
-
Microservices
- Docker, containers
- No logic-heavy enterprise serivce bus
- Teams run multiple services independently
- Each service is a business activity
- Loosely coupled and easily scalable, reliability, designed to handle failures
-
Serverless
- Backend as a Service
- Function as a Service
- Cold Start
- AWS cloud
-
Peer-to-Peer
- Share resources
๐ Application Structure Patterns
-
Layered
-
Microkernel: Plugin Pattern, flexibility, separate
- Taskk scheduler
- Workflow
- Data processing
- Browser
- Graphic designer
๐ UI Patterns
MVC, MVP, MVVM Similarities:
- Decoupling view and model
- Extra component in between
- Increased testability
- Web: MVC; Desktop: MVP; Morden/Mobile: MVVM