105
Breaking Down Your Build: Architectural Patterns for A More Efficient Pipeline FromFragileToAgile.com & Equal Experts @AbrahamMarin

Pipeline conference 2017 - Breaking down your build: architectural patterns for a more efficient pipeline 4-3

Embed Size (px)

Citation preview

Breaking Down Your Build: Architectural Patterns for A More

Efficient Pipeline

FromFragileToAgile.com & Equal Experts@AbrahamMarin

About me

Making Software. Better.Simple solutions to big business problems.

Equal Experts is a network of talented, experienced, software consultants, specialising in agile delivery.

What’s in a Build?

Complexityvs.

Simplicity

"Perfection Is Achieved Not When There Is Nothing More to Add,

But When There Is Nothing Left to Take Away”

Antoine de Saint-Exupéry | The Little Prince

The fastest build is the one you don’t need to run

Break down a monolith

Break down a monolith

Break down a monolith

APPBACKEND

SUPERAPP

DATAMODEL

APPBACKEND

SUPERAPP

SUPERAPP

DATAMODEL

APPBACKEND

GUI

Build up your microservices

Build up your microservices

Build up your microservices

Build up your microservices

Build up your microservices

Build up your microservices

Build up your microservices

How to build a CI/CD system like this

https://skillsmatter.com/skillscasts/6371-scalable-continuous-deployment-with-maven

View my talk

Good Refactoring Skills Needed

Safety First

Restructuring Patterns

Restructuring Patterns

● Decoupling API from implementation

● Horizontal vs. vertical slices

● Library as a service

● Reduce fan-out

● Configuration as a service

Restructuring Patterns

● Decoupling API from implementation

● Horizontal vs. vertical slices

● Library as a service

● Reduce fan-out

● Configuration as a service

Decoupling API from implementation

Decoupling API from implementation

WEB INTERFACE

LIBRARY

Decoupling API from implementationGoal

WEB INTERFACE

LIBRARY IMPL

ASSEMBLYLIBRARY

API

Decoupling API from implementation

WEB INTERFACE

LIBRARY

Decoupling API from implementation

ASSEMBLYWEB

INTERFACELIBRARY

Integration TestDeploySmoke Test

ASSEMBLY

Decoupling API from implementation

WEB INTERFACE

LIBRARY

CompileUnit TestContract Test

Decoupling API from implementation

LIBRARY API

LIBRARY IMPL

ASSEMBLYWEB

INTERFACE

Decoupling API from implementation

DI for IMPLUse explicit wiring

LIBRARYAPI

LIBRARY IMPL

ASSEMBLYWEB

INTERFACE

Decoupling API from implementation

WEB INTERFACE

LIBRARY IMPL

No conflict in run time thanks to explicit wiring

ASSEMBLY

LIBRARY API

LIBRARY IMPL

Decoupling API from implementation

WEB INTERFACE

LIBRARY IMPL

ASSEMBLY

LIBRARY API

LIBRARY IMPL

Decoupling API from implementation

WEB INTERFACE

LIBRARY IMPL

ASSEMBLYLIBRARY

API

Restructuring Patterns

● Decoupling API from implementation

● Horizontal vs. vertical slices

● Library as a service

● Reduce fan-out

● Configuration as a service

Horizontal vs. vertical slices

Horizontal vs. vertical slices

PersistenceValidation

LogicFront-End

Web Service

Horizontal vs. vertical slices

PersistenceValidation Front-end

ACCOUNT

COMMS

PAYMENT

ACCOUNT

COMMS

PAYMENT

ACCOUNT

COMMS

PAYMENT

Web Service

Horizontal vs. vertical slicesEnd Goal

COMMS

PERSISTENCE

VALIDATION

FRONT-END

PAYMENT

PERSISTENCE

VALIDATION

FRONT-END

ACCOUNT

PERSISTENCE

VALIDATION

FRONT-END

Web Service

Horizontal vs. vertical slices

PersistenceValidation Front-end

ACCOUNT

COMMS

PAYMENT

ACCOUNT

COMMS

PAYMENT

ACCOUNT

COMMS

PAYMENT

Web Service

Horizontal vs. vertical slices

PAYMENT

PERSISTENCE

VALIDATION

FRONT-END

Persistence Validation Front-end

ACCOUNT

COMMS

PAYMENT

ACCOUNT

COMMS

PAYMENT

ACCOUNT

COMMS

PAYMENT

Web Service

Horizontal vs. vertical slices

PAYMENT

PERSISTENCE

VALIDATION

FRONT-END

Persistence Validation Front-end

ACCOUNT

COMMS

PAYMENT

ACCOUNT

COMMS

PAYMENT

ACCOUNT

COMMS

PAYMENT

Web Service

Horizontal vs. vertical slices

PAYMENT

PERSISTENCE

VALIDATION

FRONT-END

Persistence Validation Front-end

ACCOUNT

COMMS

ACCOUNT

COMMS

ACCOUNT

COMMS

Web Service

Horizontal vs. vertical slices

COMMS

PERSISTENCE

VALIDATION

FRONT-END

PAYMENT

PERSISTENCE

VALIDATION

FRONT-END

Persistence Validation Front-end

ACCOUNT

COMMS

ACCOUNT

COMMS

ACCOUNT

COMMS

Web Service

Horizontal vs. vertical slices

COMMS

PERSISTENCE

VALIDATION

FRONT-END

PAYMENT

PERSISTENCE

VALIDATION

FRONT-END

Persistence Validation Front-end

ACCOUNT

COMMS

ACCOUNT

COMMS

ACCOUNT

COMMS

Web Service

Horizontal vs. vertical slices

COMMS

PERSISTENCE

VALIDATION

FRONT-END

PAYMENT

PERSISTENCE

VALIDATION

FRONT-END

Persistence Validation Front-end

ACCOUNT ACCOUNT ACCOUNT

Web Service

Horizontal vs. vertical slices

ACCOUNTCOMMS

PERSISTENCE

VALIDATION

FRONT-END

PAYMENT

PERSISTENCE

VALIDATION

FRONT-END

Persistence Validation Front-end

ACCOUNT ACCOUNT ACCOUNT

Web Service

PERSISTENCE

VALIDATION

FRONT-END

Horizontal vs. vertical slices

ACCOUNTCOMMS

PERSISTENCE

VALIDATION

FRONT-END

PAYMENT

PERSISTENCE

VALIDATION

FRONT-END

Persistence Validation Front-end

ACCOUNT ACCOUNT ACCOUNT

Web Service

PERSISTENCE

VALIDATION

FRONT-END

Horizontal vs. vertical slices

COMMS

PERSISTENCE

VALIDATION

FRONT-END

PAYMENT

PERSISTENCE

VALIDATION

FRONT-END

ACCOUNT

PERSISTENCE

VALIDATION

FRONT-END

Web Service

Restructuring Patterns

● Decoupling API from implementation

● Horizontal vs. vertical slices

● Library as a service

● Reduce fan-out

● Configuration as a service

Library as a service

Library as a service

Library SERVICE B

SERVICE C

SERVICE A

Library as a serviceGoal

SERVICE B

SERVICE C

SERVICE A IT A

IT B

IT C

Library Service

Library as a service

Library SERVICE B

SERVICE C

SERVICE A

Library as a service

Library SERVICE B

SERVICE C

SERVICE A IT A

IT B

IT C

Library as a service

Library

SERVICE B

SERVICE C

SERVICE A IT A

IT B

IT C

Library Service

Library as a service

Library

SERVICE B

SERVICE C

SERVICE A IT A

IT B

IT C

Library Service

Library as a service

Library

SERVICE B

SERVICE C

SERVICE A IT A

IT B

IT C

Library Service

Library as a service

Library

SERVICE B

SERVICE C

SERVICE A IT A

IT B

IT C

Library Service

Library as a service

SERVICE B

SERVICE C

SERVICE A IT A

IT B

IT C

Library Service

Restructuring Patterns

● Decoupling API from implementation

● Horizontal vs. vertical slices

● Library as a service

● Reduce fan-out

● Configuration as a service

Reduce fan-out

Reduce fan-out

B

H

C

D

E

F

G

A

Reduce fan-out

B

H

C

D

E

F

G

A

A1

A2A3

Reduce fan-outGoal

B

H

C

D

E

F

G

A2

A3

A1

Reduce fan-out

B

H

C

D

E

F

G

A

A1

A2A3

Reduce fan-out

B

H

C

D

E

F

G

A1

A2A3

A1

Reduce fan-out

B

H

C

D

E

F

G

A1

A2A3

A1

Reduce fan-out

B

H

C

D

E

F

G

A2

A3

A1

Reduce fan-out

B

H

C

D

E

F

G

A2

A3

A1

A3

Reduce fan-out

B

H

C

D

E

F

G

A2

A3

A1

A3

Reduce fan-out

B

H

C

D

E

F

G

A2

A3

A1

Reduce fan-out

B

H

C

D

E

F

G

A2

A3

A1

Restructuring Patterns

● Decoupling API from implementation

● Horizontal vs. vertical slices

● Library as a service

● Reduce fan-out

● Configuration as a service

Configuration as a service

Configuration as a service

Configuration

Configuration as a service

Configuration

● Feature Flag● Throttling Variable● A/B Testing● URLs to other systems● …● (for each environment!)

Configuration as a service

Configuration

● Feature Flag● Throttling Variable● A/B Testing● URLs to other systems● …● (for each environment!)

Service Rebuild

● Compile● Test Internal Logic● Contract Tests● Full Integration Tests● Deploy● Smoke Tests

Configuration as a service

Config itemsSoft : can check in runtime (eg. feature flag)

Hard : need to check in startup (eg. DB connection)

Configuration as a service

Service

Configuration as a serviceGoal

ServiceSmoke Tests

Soft Config Service

Hard Config

Deploy

Configuration as a service

Service

Configuration as a service

Service

Config

Everything Else

Deploy

Smoke Tests

Configuration as a service

Service

Config

Smoke Tests

Configuration as a service

Service

Config Smoke Tests

Configuration as a service

Service

Soft Config

Smoke Tests

Hard Config

Configuration as a service

Service

Soft Config

Smoke Tests

Hard Config

Soft Config Service

Configuration as a service

Service

Soft Config

Smoke Tests

Hard Config

Soft Config Service

Configuration as a service

ServiceSmoke Tests

Hard Config

Soft Config Service

Configuration as a service

ServiceSmoke Tests

Soft Config Service

Hard Config

Everything Else

Deploy

Configuration as a service

ServiceSmoke Tests

Soft Config Service

Hard Config

Deploy

Restructuring Patterns

● Decoupling API from implementation

● Horizontal vs. vertical slices

● Library as a service

● Reduce fan-out

● Configuration as a service

But… Should I Do It?

But… Should I Do It?

https://youtu.be/8JxoKJng_eQ

Check out my video on YouTube

Recapping…

Don’t run things faster, run fewer things

Seek simplicity

Restructure as needed

Thank You!

FromFragileToAgile.com@AbrahamMarin

Thank You

Twitter@EqualExperts

LinkedInlinkedin.com/company/equal-experts

UNITED KINGDOM

+44 203 603 7830

[email protected]

Equal Experts UK Ltd

30 Brock Street

London NW1 3FG

INDIA

+91 20 6607 7763

[email protected]

Equal Experts India Private Ltd

Office No. 4-C

Cerebrum IT Park No. B3

Kumar City, Kalyani Nagar

Pune, 411006

Webwww.equalexperts.com

CANADA

+1 403 775 4861

[email protected]

Equal Experts Devices Inc

205 - 279 Midpark way S.E.

T2X 1M2

Calgary, Alberta

PORTUGAL

+351 211 378 414

[email protected]

Equal Experts Portugal

Avenida Dom João II, Nº35

Edificio Infante 11ºA

1990-083 Parque das Nações

Lisboa – Portugal

& Equal Experts

USA

+1 866-943-9737

[email protected]

Equal Experts Inc

1460 Broadway

New York

NY 10036