35
TheFork B2B data migration with Symfony3 R2D2 to BB8

R2D2 to BB8 (english version)

Embed Size (px)

Citation preview

Page 1: R2D2 to BB8 (english version)

TheFork B2B data migration with Symfony3

R2D2 to BB8

Page 2: R2D2 to BB8 (english version)

“When something evolves, everything around evolves the same”

Paulo Coelho

Page 3: R2D2 to BB8 (english version)

Vincent Chalamon

Lead Developer atLes-Tilleuls.coop

@vincentchalamon

github.com/vincentchalamon

Page 4: R2D2 to BB8 (english version)

Guillaume Voisin

Lead Developer atTheFork

@guillaumvoisin

github.com/guillaumevoisin

Page 5: R2D2 to BB8 (english version)

450kreservations per month

12++ countries

32krestaurants

70++developers

Page 6: R2D2 to BB8 (english version)

Many usages

Users++

Internationalization

Page 7: R2D2 to BB8 (english version)

R2D2Current V2

Page 8: R2D2 to BB8 (english version)

The ForkManager V2

R2D2 > Current V2

Content

Reservation

Seating planMarketing& CRM

Stats

8

● Application dedicated to restaurants

● Service management for restaurant

● Communication tool

Page 9: R2D2 to BB8 (english version)

The Fork Manager V2

R2D2 > Current V2

Important technical debt

Hard to update

Many projects dependencies

Outdated/Non user-friendly features

9

Page 10: R2D2 to BB8 (english version)

The Fork Manager V2

R2D2 > Current V2 10

Page 11: R2D2 to BB8 (english version)

BB8V3

Page 12: R2D2 to BB8 (english version)

The ForkManager V3

BB8 > V3

Content

Seating planMarketing& CRM

Stats

Reservation

Page 13: R2D2 to BB8 (english version)

Starting on good practices

BB8 > V3

Semantics

MVP approachSustainable thinking: refactos

Try POC

Failingis cool!

Quality: UT, FT

13

Page 14: R2D2 to BB8 (english version)

BB8 > V3

TwGit

14

API

SPA

And for front-end guys…

Page 15: R2D2 to BB8 (english version)

BB8 > V3

V2

APP

Loaders

Transformers

Double writing

15

V3

Page 16: R2D2 to BB8 (english version)

LegacyBundle

BB8 > V3

Isolate developments

16

Disable LegacyBundle

V2 entity mapping

Page 17: R2D2 to BB8 (english version)

BB8 > V3 17

Imported data

Restaurant

ReservationsDescription

Opening times

Closing times

Customers

Page 18: R2D2 to BB8 (english version)

Loaders

Page 19: R2D2 to BB8 (english version)

● Symfony command● 1 loader per entity● Each loader has its

own priority

Loaders

Loaders

Registry Loader

19

Page 20: R2D2 to BB8 (english version)

V2

Loaders

INSERT INTO v3.restaurant…SELECT v2.restaurant…

Loaders

20

V3

Page 21: R2D2 to BB8 (english version)

Loaders

Loaders

Think disposable

MVP: import relevant data only

Doctrine can be useless

Refacto, did you say refacto?

Duplication / errors management

21

Page 22: R2D2 to BB8 (english version)
Page 23: R2D2 to BB8 (english version)

Complicated sometimes Loader can be

Page 24: R2D2 to BB8 (english version)

Execute loaders in production

Loaders

● Load all data = 9 days

Progressive migration

24

Outage

Page 25: R2D2 to BB8 (english version)

V2

Loaders

Company 3 Company 1Company 2

25

V3

Progressive migration

Page 26: R2D2 to BB8 (english version)

Transformers

Page 27: R2D2 to BB8 (english version)

Transformers

V2

V3

27

Transformers

Page 28: R2D2 to BB8 (english version)
Page 29: R2D2 to BB8 (english version)
Page 30: R2D2 to BB8 (english version)

Double writing

Page 31: R2D2 to BB8 (english version)

Double writing 31

V2

APP

TransformersV3

Double writing

POST http://api.tfm3-lafourchette.com/restaurants PUT http://api.tfm3-lafourchette.com/restaurants/legacy/3

Page 32: R2D2 to BB8 (english version)

Review

Page 33: R2D2 to BB8 (english version)

Review

Review

> 300unit tests

> 80%code coverage

1 year of development

33

LegacyBundle:75% of dev.

> 10 contributors

> 150functional tests

Page 34: R2D2 to BB8 (english version)

Jedi advices

Review 34

“A thorough study of legacy you will do”

“With real data you’ll test”

“Careful you’ll be”

Page 35: R2D2 to BB8 (english version)

@TheFork_tech

https://joind.in/talk/e08a1

Michiel VanWerkhovenProduct Owner

Olivier VersanneScrummaster

Mickael LabrutBackend lead developer

Guillaume VoisinBackend lead developer

@guillaumvoisin

Vincent ChalamonBackend lead developer

@vincentchalamon

Gregory CopinTechnical director @gregcop1

Dimitri HautotFrontend developer@Dhautot

Matteo ReinerioFrontend developer@zippymat

Alexis TondelierFrontend lead developer @AlexisTondelier

Cédric DéservilleBackend lead developer @talumn

#MayTheForkBeWithYou

@coopTilleuls