[2024 dev2next] Architecture.Next: 4 trends for architecture

Speakers: Mark Richards (markrichardssa) & Neal Ford (neal4d)

For more see the table of contents


Architectural Nexûs

  • Need to recognize intersections (I didn’t type “intersection” repeatedly, but they used the word many times)
  • How many architectures to screw in a lightbulb? None; it’s an implementation detail
  • Implementation needs to be fault tolerant; not just architecture
  • Engineering practices need to be agile
  • Team topology makes hard to implement certain types of architectures
  • Often ignore data topologies and system architecture
  • “The enterprise” – processes, standards, frameworks from dept, division, enterprise enforcing for many reasons; usually good
  • Business environment – ex: cost cutting mode vs aggressively expanding, rate of change in business or marketplace. Software must be flexible enough to change as business changes to achieve goals. Cannot be bottleneck
  • Generative AI – can apply governance, find inefficiencies in architectures, etc. This is the fourth trend in this session
  • Architecture can’t live along which is why often system just don’t work
  • Mechanical sympathy – use tool so works at it’s best. ex: bytecode so small, avoid context switching. On prem storage is expensive and CPU is cheap so use CPU to break up data. The opposite is true in the cloud. CPU is more expensive. Ex: we don’t question normalizing data, but new topologies don’t always follow them.

Automated Governance and Fitness Functions

  • We write tests every day. And if you don’t watch out for Venkat 🙂
  • We do a good job testing functionality
  • How do you test structural integrity of architecture? Elasticity? Maintainability?
  • Fitness function – objectively evaluates an architectural characteristics
  • Operational fitness functions – availability, scalability, etc. Scalability problems manifest as responsiveness problems
  • Structural fitness functions – bridge is fine as cars drive over it. Until it’s not.
  • ArchUnit in Java, ArchUnit and NeArchTest for .NET, PyTestArch for Python, TSArch for JavaScript/TypeScript. Get AI does a good job generating the tests
  • ArchUnit example for structural integrity were the package dependency ones [these seem like the easiest ones to write]
  • Data fitness functions – ex: foreign key constraint across databases, checksum to ensure data consistency
  • Process fitness functions – ex: testability measured by error rates
  • https://blog.hello2morrow.com/2018/12/a-promising-new-metric-to-track-maintainability/
  • Architecture as code

Aspect oriented architecture

  • Spring uses AOP as output
  • Hexagonal architecture – loose coupling to separate plumbing from domain stuff. Alistair Cockburn drew a hexagon when talking about it, but too late, it stuck. Almost got it right. Can’t treat database as a separate thing. Most people use a shorthand for separating domain and plumbing.
  • Don’t need hexagonal architecture anymore. [yet new book on it: Hexagonal Architecture Explained ]
  • Need data to be in context. Microservices preserve this boundary
  • Service mesh
  • Data mesh – operational vs analytical data, However, can’t build an analytics sidecar. Instead build cooperative quantum
  • Sidecar/mesh pattern – can build aspect oriented architecture.
  • Governance mesh. Ad hoc governance/fitness function all over. ex: logging, monitoring, circuit breaker
  • join point – governance mesh
  • pointcut – holistic capabilities like observability
  • advice – fitness functions

AI ∩ Architecture

  • Updating thoughtworks tech radar.
  • AI came up a lot, but only one is in adopt which requires maturity
  • Categories – AI assistant software dev, local inference, fine tuning, inference, cloud services, evals and guard rails, structures outputs, prompts, information retrieval , observability for LLM, building agendas
  • Easy to make a talking dog. Hard to get it to talk right in prod. Also hard to get the talking dog to call an API
  • Vector database used for LLMs
  • Guard rails – how prevent from doing something shouldn’t
  • Eval – how well doing
  • More expensive LLM can validate results of cheaper LLM

How four trends related

  • Can use fitness functions to validate code generated by LLMs
  • Architecture as code and fitness functions describe intersections. Need executable, not diagrams
  • Once critical mass of fitness functions, have governance mesh
  • Systems are too large; can’t manually validate
  • When Log4J, people asked architects what in product and didn’t know [solution to that is a tool. don’t need governance mesh. I agree with the point, but not a fan of the example]

My take

I like that they covered a variety of topics while also getting into code for ArchUnit

[devnexus 2024] ai proof your career with software architecture

Speaker: Kelly Morrison

For more, see the 2024 DevNexus Blog Table of Contents


HIstory

  • Fairly recent. GPT created in 2018. Number parameters increasing exponentially
  • Microsoft CoPilot released in 2021. Uses Codex; a specialized model off GPT3 for creating code. Trained on billions of lines of GitHub code and can learn from a local code base
  • Amazon released CodeWhisperer in 2022. Can generate code for 15 languages. Specialized for AWS Code Deployment

Basic Example

  • Asked ChatGPT to write a Java 17 Spring boot rest API for stats in a MongoDB with JUnit 5 tests cases for the most common cases
  • Looks impressive on first pass, but then find problems
  • Hard coded info
  • Used Lombok instead of Java 17 records
  • Code doesn’t compile

Complicated Example

  • Asked ChatGPT to write an entire enterprise app for selling over 10K crafts with a whole bunch of requirements like OpenID, Sarbanes Oxley, etc
  • Didn’t try. Instead came back with a list of things to consider in terms of requirements

What AI can/can’t do

  • Can do “Ground level” work.
  • Still need humans for large orchestratoin – ex: architects
  • Can do more self without junior devs
  • Garbage in, garbage out. Trained on public code in GitHub. Not all good/correct. Some obsolete.
  • Humans better at changing frameworks, working with CSS (does it look nice), major architectural changes, understanding impact of code when requirements change

Hallucinations

  • Doesn’t understand. Asks as mime/mimic/parrot
  • If can’t find answer, will give answer that looks like what you want even if made up. Example where made up up a kubectl option
  • Not enough training data on new languages/technologies. More hallucinations when less training data
  • Mojo created May 2023. Likely to get Python examples if ask for Mojo. However, it is a subset of Python with some extra things

Security Concerns

  • Learns from what you enter so can leak data
  • Almost impossible to remove something in a LLM. ex: passwords, intellectual propery, trade secrets
  • Some companies forbid using these models or require anonymous air gapped use. Translate something innocuous into what actually want

Debugging

  • Can human understand AI generated code well enough to debug
  • GPT and Copilot can sometimes debug code, but have to worry about security

Pushback

  • Law – ChatGPT made up cases
  • Hollywood strike – copying old plots/scripts/characters
  • Unclear if generated output can be copyrighted. For now, not copyrightable but could change.
  • Some software is too important to risk hallucinations 0 ex: plane, car (although Telsa getting there), pacemakers, spacecraft, satellites
  • Lack of context – other software at compnay, standards, reuse, why use certain technologies, securities
  • Lack of creativity – need to determine problem to solve or new approaches

What AI does well

  • Low level code gen (REST APIs, config, database access)
  • Code optimization
  • Greenfield development
  • Generateing docs or tests
  • Basically the kin of tasks you hand off to a junior developer [I disagree that some of these are things you hand off]

Career Advice

  • Focus on architecture, not code
  • Don’t just learn a langauge or framework.
  • Learn which langauges are best in different situations
  • Learn common idioms
  • Look at pricing, availability of libraries and programmers
  • Learn which architectures should be implemented in different languages
  • Learn how to create great prompts for code generation
  • Learn how to understand, follow, test, and debug AI generated code

Book recommendations

  • Building Evolutionary Architectures
  • Domain Driven Design
  • Fundamentals of Software Archicture
  • Head First Software Architecture

More skills

  • Types or architecutures – Layered, event driven, microkernel, microservices, space based, client/server, broker, peer to peer, etc
  • Determine requirements – domain experts don’t know enough about software to specify. Can be bridge between AI and domain experts

Mentoring junior developers

  • Teach how write high quality prompts.
  • Remind to ask for security, test cases, docs, design patterns, OWASP checks
  • Show to spot and deal with hallucinations
  • Help to understand and debut AI written code
  • Help learn architecture by explaining why choices made
  • Ensure code reviews are held
  • Precommit git hooks to test code
  • Use AI to help generate unit tests

ArchUnit

  • archunit.org tests architecuture.
  • Can add own architecture rules.
  • ex: never use Java Util Logging or Joda Time
  • ex: fields should be private/static/final
  • ex: no field injection
  • ex: what layers are allowed to call
  • Can include “Because” reason for each rule
  • Ensures AI doesn’t sneak in something that goes against conventions

My take

Good examples. I was worried about the omission of “where to senior devs” come from but there were examples like changing frameworks so not entirely ignored. Good examples from the ecosystem as well. Good list of skills to focus on.

[devnexus 2022] meta-modern software architecture

Speaker: Neal Ford from thoughtworks

@neal4d

Link to table of contents

———————

Were architectures come from

  • Architecture is reactive
  • Someone starts doing something, then others do
  • Once a bunch doing, named (after the fact)
  • Reflection on how doing software development at the time
  • Once in an architecture, can watch how it grows and changes

Eras

  • Victorian – 1801-1900 – science, cassifying natural world
  • Modernism – 1890-1945 – industriial revolution, explosive growth of cities, abstract art, radio.
  • Post-modernism – 1946-1990 – push back about modernism, irony, questioning everything, television, Seinfield’s ”never hug, never learn”
  • Post-post modernism or metamodernism – 1990-present – internet
  • Naming things is hard. Not just in software. Modernism is bad choice of name because what would come next

Metamodern

  • In 1989, to find out Chicago weather would need to watch Weather Channel and wait for it to cycle around or go to library. Now pull it up onlie.
  • In 1989, could read a few books and know pretty much everything about wine. Now too much info and keep generating more.
  • Holism – view various systems as whole
  • Parks and recreating is first meta-modern show
  • Breaking bad – colo driven – yellow is safe and purple is bad
  • Return to sentimentaliitiy. Can’t live on ironism alone

Software architecture

  • microservices – one of most popular pages on Martin Fowler’s website. Say what it is and more importantly, what it isn’t.
  • First law of software architecture: ”Everything in software architecture is a tradeoff”. If you haven’t encountered yet, will be in the future
  • Reuse reduces complexity but comes with high coupling
  • Metamodern software architect needs to do tradeoff analysis. Ex: things that change slowly are good for reuse such as frameworks and OS
  • service mesh and sidecar pattern – orthogonal coupling

Books

  • ”Fundamentals of Software Architecture”
  • ”Software Architecture: the Hard Parts”
  • ”Data Mesh”

Forces

  • Consistency – atoic, eventual
  • Communication – sync, asych
  • Coordination – orchestrated, choreography
  • 8 possiblities by choosing one of each. ex: one is a monolith. All 8 can exist as pattern or antipattern.
  • Named them transactional sagas. epic, fantasy fiction, fairy tale, parallel, phone tag, horror story time travel, anthology

Richard Feinman

  • Computers used to be a room full of people (usually women) calculating things
  • Feyman added specialization and paralleliation. Some people are better at some tasks than others. And recovering from problems
  • 1945 – atomic bomb blast is what shifted eras
  • reonsider why continuing to do thing. revisit when reasons change

Internet

  • Pushed us to net era
  • Volkswagon used software to cheat on emissions test. Some people knew actively working to break the law
  • Facebook keeps getting busted for doing bad thigs – data breaches, illegally tracking users, Cambridge Analytica, using two factor for marketing.
  • Last week, Facebook made up a meme that TikTok that students slapping teachers. Then it became a self fulling prophacy

Finance and ethics

  • Modernism – double enry accounting
  • Post-modern – quants
  • Metamodern humane corporation, ethics. Recognize all connected to each other
  • Don’t want to create something cool and spening rest of career on appology tour
  • Apple, Google employees pushed back

My take

Fun start to the day. I hadn’t heard of the ”saga” approach before. Googling, at least some of them see to be a real thing. (and all are from ”the hard parts” book I also increased my book reading list. The end felt rushed. Maybe because started late?