Search Sreeni's Insights

Filter by content type
technical March 1, 2018 12 min read

How to design and implement Future State Architecture? - Part 2

Design a Future State Architecture in three views, logical components, technology choices and solution architecture, and plan the move from the current state.

Share:

How to design and implement Future State Architecture? - Part 2

A vision and a set of principles tell us what good looks like, but teams can’t build a principle. They need to see the building blocks, know which technologies to use for each of them, and understand how the pieces talk to each other. And above all, they need a way to get there from where they are today, without stopping the business for a rewrite. In the previous article, we discussed what a future state architecture is, why we need it, how to think about it, and the vision and principles which form its foundation. In this article, we are going to see how to design the future state with its logical components, technology choices and solution architecture, and how to implement it step by step.

Future State Architecture series:

  1. What is Future State Architecture and why do we need it?
  2. How to design and implement Future State Architecture? (this article)

TL;DR Summary

  • Design the future state in three views: logical components (what), technology choices (with what) and solution architecture (how they interact).
  • Our logical architecture has layers (user, proxy, UI/client, API, data), surrounded by cross-cutting services, supportive domain services, integrations, monitoring, and development and deployment practices.
  • Choose technologies per logical component, guided by the principles; prefer managed services, and keep the choices few.
  • Implement incrementally: assess the gap, prioritize by business value and risk, apply the strangler pattern, and build new work in the future state from day one.
  • Govern lightly with design reviews against the principles and Architecture Decision Records, measure the progress, and refine the FSA regularly.

Designing the future state

We describe the future state in three views, from the most abstract to the most concrete,

ViewAnswersAudience
Logical componentsWhat building blocks do we need?Everyone, including the business
Technology choicesWhich technologies do we use for each building block?Architects, tech leads, developers
Solution architectureHow do the building blocks interact?Tech leads, developers, operations

Keeping the logical view separate from the technology view is important. The logical components change slowly, because they follow the business; the technologies change faster. When a better technology comes along, we replace it in one box without redrawing the whole architecture.

Logical components

The following diagram depicts the logical components of our future state architecture.

Logical components of the future state architecture - user, proxy, UI/client, API and data layers, with cross-cutting services, supportive domain services, integration, monitoring and development and deployment
Logical components of the future state architecture - user, proxy, UI/client, API and data layers, with cross-cutting services, supportive domain services, integration, monitoring and development and deployment

Let us walk through the layers from the top,

  • User/Consumer - Our users, and the internal and third-party applications which consume our services.
  • Proxy Layer - A CDN edge server and firewall in front of everything. It provides security, caching and performance at the edge, before a request reaches our infrastructure (refer to Edge-first architecture).
  • UI/Client - The ways our users interact with us: web pages, micro frontends, embeddable widgets and public APIs. Each of them is a client of the API layer; none of them talks to a database directly.
  • API - A gateway/load balancer in front of three kinds of services,
    • Business Domain APIs - Services which own a business domain and its data.
    • Aggregators - Services which combine data from several domain APIs for a specific client, so the clients don’t make many chatty calls (refer to the Backend for Frontend (BFF) pattern).
    • Computation Services - Services which perform processing or calculations, without owning business data.
  • Data - The data stores owned by the services: house-keeping data stores, log data stores, other data stores chosen per need (polyglot persistence), and the internal data provider APIs.

Around these layers,

  • Cross Cutting Services - Shared capabilities which every application needs: authentication providers, messaging services, enterprise and application specific security policies, and application specific cache policies and stores. Building these once and reusing them removes a lot of the architecture drift.
  • Supportive Domain Services - Services which support many products but are not the core business: charting, PDF generation and email.
  • Integration - Connections to the systems outside our core platform: marketing services, external data providers and the asset managers’ platform.
  • Monitoring/Instrumentation - Spans all layers, because every component must be observable.
  • Development & Deployment - The practices which make the architecture work: iterative and evolutionary design, continuous deployment and automation.

Notice how the principles show up in the logical view: the proxy and the cross-cutting security services make it secure, the API layer is decomposed, the messaging services enable asynchronous processing, the data layer is polyglot, monitoring enables automated self-management, and the development and deployment practices enable frequent small updates and immutable infrastructure.

Technology choices

Once the logical components are clear, we choose the technologies for each of them. The following diagram depicts our technology choices for each layer.

Technology choices for each layer of the future state architecture
Technology choices for each layer of the future state architecture
Layer / componentTechnology choicesWhy
ProxyCloudflareSecurity (WAF, DDoS), caching and performance at the edge, and edge logic with workers (refer to the Cloudflare Workers series)
UI/ClientReact for web pages and widgets, ASP.NET MVC views, public APIsA modern component model for rich UIs, while keeping server-rendered views where they fit
Gateway/Load balancerAzure API Management, Application Gateway, Traffic ManagerOne front door for APIs with policies, regional routing and failover
APIAzure App Service, Azure Functions, containersManaged platforms which scale horizontally; serverless for event-driven work (refer to Containers vs PaaS vs Serverless)
DataAzure SQL Database, Cosmos DB, PostgreSQL, Azure StorageThe right store for each kind of data
Cross-cuttingAzure AD, our enterprise auth provider, Key Vault, encryption, Azure Security Center, Redis Cache, messaging/notification serviceCentralized identity, secrets and security posture, shared caching and messaging
MonitoringApplication Insights, infrastructure monitoringApplication and infrastructure level observability

We followed these guidelines while choosing the technologies,

  • Follow the principles. Every choice should support at least one principle and not break any.
  • Prefer managed services (PaaS, serverless) over managing VMs ourselves, so the teams spend their time on business features, not on patching servers.
  • Keep the choices few. One or two options per component are enough. Every extra technology adds skills, tooling and operational cost.
  • Consider the team. A technology the team can’t support in production is not the right choice, however good it is.
  • Document the decision. Record why a technology was chosen, and what alternatives were considered (refer to Architecture Decision Records (ADR)).

Solution architecture

The solution architecture shows how the components interact at runtime. The following diagram depicts our future state solution architecture.

Future state solution architecture - requests flow from Cloudflare to UI/client, gateway, API and data, with notification systems, workers, supportive domain services, data providers and shared security, monitoring and cache services
Future state solution architecture - requests flow from Cloudflare to UI/client, gateway, API and data, with notification systems, workers, supportive domain services, data providers and shared security, monitoring and cache services

There are three main flows in this diagram.

1. The synchronous request flow (the thick arrows)

User or application → Cloudflare → UI/Client → Gateway/Load balancer → API → Data.

This is the path a user’s request takes while they wait for the response. It should be as short and as fast as possible, so we keep only the work which must happen in real time on this path.

2. The asynchronous flow (the dashed arrows with envelopes)

The API, the UI and the workers communicate through a notification system. For example, the API publishes an event when something changes, a worker picks it up and does the heavy work, and the UI is notified when the result is ready. This keeps the request path short, absorbs the spikes, and lets each part scale on its own.

3. The background and integration flow

  • Workers/Workflows request work from the API, read and write data, pull from and push to the external data platforms/providers, and read from the internal data APIs.
  • Supportive domain services (PDF, email, charting) are used by the UI and the API through the same contracts.
  • Marketing services (like analytics and email marketing tools) are used by the UI.

Below all the flows, the shared services support every component,

  • Security - The enterprise auth provider, Key Vault, encryption, Azure Security Center and Azure Active Directory. The UI, the gateway and the API all use the same auth provider.
  • Monitoring - Application Insights and infrastructure monitoring.
  • Cache - A shared distributed cache.

Must Be Aware: A shared service is a shared dependency. Design the shared services (auth, cache, messaging) for high availability, and design the applications to degrade gracefully when one of them is slow or down.

Implementing the future state

Designing the future state is the easy part; getting there is where most FSA efforts fail. These are the steps we follow.

Step 1: Assess the gap

For each application, compare its current state with the future state, principle by principle. A simple scorecard works well,

PrincipleApplication AApplication BApplication C
SecurePartiallyYesNo
DecomposedNo (monolith)YesPartially
Frequent small updatesNo (manual release)YesYes
Design for failureNo DRActive-passiveRedeploy
Immutable infrastructureNoYesPartially
…

This gives a factual picture of where each application stands, and where the biggest gaps are.

Step 2: Prioritize by value and risk

We can’t close all the gaps at once. Prioritize the work based on,

  • Business value - Which gaps slow down the business the most, or block a business goal (like a new product or opening APIs to external users)?
  • Risk - Which gaps expose us to security, reliability or compliance risks?
  • Effort - Which gaps can be closed with little effort (quick wins), and which need a larger investment?
  • Timing - Which applications are about to change anyway? Moving them towards the future state as part of the planned work costs much less.

Step 3: Build new work in the future state

The simplest rule with the biggest effect: every new application, service or major feature is built in the future state from day one. This stops the gap from growing while we work on closing it.

Step 4: Migrate incrementally with the strangler pattern

For the existing applications, avoid big-bang rewrites. Use the strangler pattern: put a facade (like the proxy or the gateway) in front of the legacy application, build the new functionality as services in the future state, route the traffic for each migrated functionality to the new services, and retire the legacy parts one by one (refer to Strangler pattern - migrating a legacy monolith step by step).

Each step is a transition architecture: it delivers value on its own, and it moves us closer to the future state.

Step 5: Build the shared foundations first

Some future state capabilities are shared by all applications: the proxy, the API gateway, the auth provider, the CI/CD pipelines, the monitoring and the IaC templates. Building these first makes it easier and cheaper for every team to move, and it is where the standardization pays off most.

Step 6: Govern lightly

Governance should help the teams make good decisions, not slow them down,

  • Design reviews against the principles. For every significant design, walk through the ten principles and the five pillars. The principles table from the previous article doubles as a review checklist.
  • Architecture Decision Records. Record the significant decisions, especially the deviations from the future state, with the reason and the plan to close the gap later.
  • Reference implementations. A working sample of each pattern (a domain API, a worker, a pipeline, an IaC template) is worth more than a long document.
  • Architecture community. A regular forum where the tech leads share their designs, problems and learnings keeps the FSA alive and owned by the teams, not only by the architects.

Step 7: Measure the progress

Measure whether the architecture is really moving, with metrics which reflect the principles,

  • Deployment frequency and lead time for changes (frequent small updates)
  • Number of applications with CI/CD and IaC (immutable infrastructure)
  • MTTR and SLA per application (design for failure)
  • Security findings per application (secure)
  • Cost per application and its trend (cost optimize)
  • Gap scorecard progress over time

Step 8: Refine the future state

Review the FSA at a regular interval, for example once or twice a year. The business drivers change, new technologies appear, and the teams learn what works and what doesn’t. A future state which is never updated becomes a past state.

Common pitfalls

PitfallWhy it hurtsInstead
Big-bang rewriteLong periods without business value, high risk, often abandoned halfwayIncremental migration with transition architectures
An ivory tower architectureTeams don’t own it, and they work around itBuild it with the tech leads, and keep it alive in an architecture community
Too many principles and technologiesNobody remembers them, and the variety grows instead of shrinkingTen principles at most, one or two technologies per component
Technology firstThe FSA becomes a list of trendy tools which don’t solve the business problemsBusiness drivers → vision → principles → technologies
No measurementNobody knows whether the architecture is improvingTrack a few metrics and the gap scorecard
Never updatedThe FSA becomes irrelevantReview and refine it regularly

Wrap up

In this article, we have looked at how to design the future state in three views (logical components, technology choices and solution architecture), the three main flows of the solution architecture, and how to implement the future state step by step: assessing the gap, prioritizing, building new work in the future state, migrating with the strangler pattern, building the shared foundations, governing lightly, measuring and refining. With this, we have completed the Future State Architecture series. I really appreciate that you took the time to read this series. I hope it helps you to give your teams a shared destination, and a practical road to get there.

Related Posts