https://fwdays.com/en/event/php-fwdays-2020
All of us think about many questions when we start a project, when we already have a product and when we release it. Here are some of them: which architecture and infrastructure to choose? what should be the repository structure? how to make the right evolution from one application to 100 microservices with success product release? how to distribute cross-stack commands as a whole? what development practices to use?
This story will expose approaches to solving these and many other problems in PHP projects through: None-Breaking change development approach, Cross-stack contacts, Trunk Based development, evolution from Polyrepo to Monorepo with components on different technologies, Boilerplates for components, different Architecture Views, Continuous Testing & Quality, Infrastructure View, Infrastructure as a code as the main tool.
This topic will appeal to everyone - from Software Developer to Architect, as many Tips & Tricks will be revealed.
2. Speaker.
winner of Ukrainian IT Awards in category
Software Engineering in 2019
10+ years in software design & development
worked as Developer, Architect, Head of PHP
Head of Core Development in Ciklum
co-founder and contributor of open-source
products
partnership programs with big IT companies
(SensioLabs, AWS, Microsoft, Google Cloud
Platform)
3. What to expect for You?
● Pet-projects
● Front-End topics
TO BE:
● Common software development practices
● Architecture patterns & approaches
● Useful components & libs
● Examples from real world
● Links to useful materials
NOT TO BE:
30. Software Architecture. Architecture Views
SEI software architecture views
Module
Decomposition Uses
Layered
Class
Component -
and - connector
Client-Server Concurrence Process Shared Data
Allocation
Work
Assignment
Deployment Implementation
4+1 View Model
38. Software Architecture components.
Business service 1
open-source libs
business logic
shared data model
shared business logic
shared libs
infra service clients
Business service N
open-source libs
business logic
shared data model
shared business logic
shared libs
infra service clients
FE
src open-source libs FE shared libs
Infra service 1
open-source libs
logic
shared libs
Infra service N
open-source libs
logic
shared libs
39. Software Dev practices. Core Team
Core Team Business Team
● Responsible for shared components:
○ infra services
○ infra services client libs
○ shared business related libs
○ shared none-business related libs
● Drives Product Architecture and Infrastructure
● Enablers for future business features
● Should know business scope
● Responsible for shared components:
○ business services
○ shared business related libs
● Drives Service Architecture and
Infrastructure
● Use functionality of Core Team
● Should know business scope
42. Software Architecture components. Service API Client
Business Service
Client 1
Infra Service 1 Infra Service 2 Infra Service 3
Client 2 Client 3
Business Logic
Business
Logic
Client DTO
RequestData
DTOparams
Caller
YAML configGuzzle
Endpoint
Symfony
HTTP Client
1
2
RequestData
<<validates>>
7
<<creates>>
<<creates>>
8
RequestData
3
4
5
ResponseData6
ResponseData
48. Software Architecture components. Delivery Approach
idea,
requirements,
dependencies
Implementation to
Test service
Implementation to
Business Service
Components Development
New versions,
Change logs,
Documentations,
Knowledge Sharings
Definition of Done
50. Software Architecture components. Delivery Approach
idea,
requirements,
dependencies
1 week
2 week
3 week
Implementation to
Test service
Implementation to
Business Service
Components Development
New versions,
Change logs,
Documentations,
Knowledge Sharings
Definition of Done
1 month
4 week
53. Development practices. Feature Teams
Business Services
business logic
open-source libs
open-source
packs
infra services
clients
shared business
libs
shared
non-business libs
Infra Services
src
open-source libs
open-source
packs
shared
non-business libs
Service Boilerplate
Library Boilerplate
54. Development practices. Feature Teams
Business service
open-source libs
business logic
shared data model
shared business logic
shared libs
infra service 1 client
Infra service 1
open-source libs
logic
shared libs
infra service 2 client
Infra service 1
open-source libs
logic
shared libs
7pull-requests
7repo code review
6change logs
56. Code Repository Structure. Migration to Monorepo
Monorepo
migration process
folder structure
migration tool
branching strategy
versioning
shared libs
to control the functionality
CI/CD
58. Code Repository Structure. Monorepo - branching strategy
Trunk Based
Development
https://trunkbaseddevelopment.com/
MASTER M1 M2 M3 M4 M5 M6
R1 R1.1 R2
F1 F2 F2.1 F2.2
M7
R1.1
● all FEATURE branches from MASTER;
● all PR’s merged to MASTER;
● short-living FEATURE branch;
● CI/CD, Tests;
● MASTER is always stable (green);
● RELEASE branch if needed only;
● Cherry picked from MASTER to RELEASE;
59. Code Repository Structure. Monorepo - working with components
Polyrepos READONLY
Monorepo
business service
shared-lib-3
shared-lib-2
infra service
shared-lib-1
shared-lib-1
shared-lib-2
shared-lib-3
Satis
SINGLEversion
Version ?
Tag ?
MASTER M1 M2 M3 M4
F1 F1.1 F1.1
60. Code Repository Structure. Monorepo - working with components
composer.json
composer.lock
service
open-source libs
logic
shared-libs-1
/library-be-shared-lib-1
/library-be-shared-lib-2
/library-be-shared-lib-3
/library-be-shared-lib-4
/service-1
/service-2
shared-libs-4
62. Development practices. Monorepos
● Single Feature in a Single PR
● Refactoring is very easy
● Developer onboarding
● Codebase “Big Picture”
● Productivity increase & Less
management
● One Team == One Repository
● Easy on start of project
PROS CONS
● “One version fits all”
● Releasable components
● composer symlinks
● IDE performance, Git History
● new CI / CD
● No real code ownership
67. None-Breaking change development. Code
Backward Compatibility Promise
code
● Class renaming/namespace changes
● New method added to the interface
● Method removed from class
● New required parameter added to class constructor
● Dependency changed in class constructor