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) architecture1
  • 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


architecture2

  • 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

See node-js-design-patterns

๐Ÿช• 4. Software Architecture Patterns

๐Ÿ“‘ Design Patterns vs. Architecture Patterns (higher level)


software architecture 1

๐Ÿ“‘ 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 SOA
  • 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

Microservices

  • Serverless

    • Backend as a Service
    • Function as a Service
    • Cold Start
    • AWS cloud
  • Peer-to-Peer

    • Share resources

๐Ÿ“‘ Application Structure Patterns


  • Layered

    • Easy to organize software architecture 4
  • Microkernel: Plugin Pattern, flexibility, separate

    • Taskk scheduler
    • Workflow
    • Data processing
    • Browser
    • Graphic designer

๐Ÿ“‘ UI Patterns


software architecture 6

MVC, MVP, MVVM Similarities:

  • Decoupling view and model
  • Extra component in between
  • Increased testability
  • Web: MVC; Desktop: MVP; Morden/Mobile: MVVM