microservices and monorepos - qcon london · microservices and monorepos match made in heaven? sven...

23
Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

Upload: phungdung

Post on 17-Sep-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

Microservices and Monorepos

Match made in heaven?

Sven Erik Knop, Perforce Software

Page 2: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

2

Overview

Microservices refresher

Microservices and versioning

What are Monorepos and why use them?

These two concepts seem to contradict – why mix them together?

The magic of narrow cloning

A match made in heaven!

Page 3: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

3

Why Microservices?

Monolithic approach:

App

Database

Page 4: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

4

Microservices approach

Individual Services

DatabaseDB DB

Page 5: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

5

Versioning Microservices

Code

Executables and Containers

Configuration

Natural choice: individual repositories for each service Git

But:

• Security

• Visibility

• Refactoring

• Single change id to rule them all?

Page 6: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

6

Monorepo

Why would you use a monorepo?

Who is using monorepos?

How would you use a monorepo?

Page 7: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

7

Monorepos: Why would you do this?

Single Source of Truth for all projects

Simplified security

Configuration and Refactoring across entire application

Single change id across all projects

Examples:

• Google, Facebook, Twitter, Salesforce, ...

Page 8: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

8

Single change across projects

change 314156

Page 9: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

9

Monorepos: Antipatterns

User workspace

User workspace

Page 10: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

10

Monorepos – view mapping

User workspace

Map one or more services

Users only access files they need

Simplified pushing of changes

Page 11: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

11

What does this have to do with Git?

Git does not support Monorepos

• Limitations on number and size of files, history, contributing users

• Companies have tried and failed

Android source spread over a thousand Git repositories

• Requires repo and gerrit to work with

Page 12: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

12

How can we square this circle?

https://en.wikipedia.org/wiki/Squaring_the_circle

Page 13: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

13

Narrow cloning!

Clone individual projects/services

Clone a group of projects into a single repo

Page 14: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

14

Working with narrowly cloned repos

Users work normally in Git

Fetch and push changes from and to monorepo

SHAs preserved within the same repo

SHAs for compound repos will differ

• But: common change id in the monorepo

Page 15: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

15

So what does Perforce have to offer?

The vendor talk bit ...

Page 16: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

16

Who we are

Perforce helps delivery teams build complex products collaboratively, securely and efficiently.

Commonly used for…

• Software

• Games

• Electronics

• Animations

• Chipsets

• Medical Devices

• IoT

Global 24x7 Support

Page 17: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

17

Managing IP for market leaders

ChipsGames

& AnimationCloud/SW Electronics Systems Automotive

Page 18: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

18

Hybrid Workflows

• Distributed & Centralized Version control,

code reviews, simple file sharing

• Happy developers & contributors

Every File

• Efficiently handles large, often binary, data

DevOps Stay Happy & Productive

• A mainline source for all builds even with

distributed development

All IP Safe & Secure

• Granular permissions, theft risk monitoring

Perforce Helix

CONTRIBUTORS

CONSUMERS

Page 19: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

19

More performanceMore uptimeMore control

Better coordinationBinaries

Large filesProtect IP

Regulations/audit

More codeMore frequentlyMore freedomMore flexibility

All textSmall files

Code anywhereLocal repos

Perforce Helix

Serves developers Serves operations

Coordinate Development & Operations at Scale

Page 20: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

20

GitSwarm: Integrated Git Management

Based on GitLab CE

Self-service repos

Merge requests

Permissions

Issue tracking, etc.

Page 21: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

21

Mirrored to the Helix Versioning Engine

Automatic bidirectional mirroring with Helix servers

Helix enforces security, down to the file level if needed

Immutable content for audit trails, regulated industries, etc.

Support for Git LFS that works for DevOps

Page 22: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

22

Work Locally, Scale Globally

Distributed environment for developers

Git experience and workflow equivalent to well known tools

Single source of truth

Perforce reliability and stability protecting your assets

HelixGitSwarm

Page 23: Microservices and Monorepos - QCon London · Microservices and Monorepos Match made in heaven? Sven Erik Knop, Perforce Software

23

Microservices and Monorepos?

Narrow cloning ...