26
Something Architecture Anton Kril Director of Architecture @AntonKril

Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Something Architecture

Anton Kril

Director of Architecture

@AntonKril

Page 2: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Storefront

Admin

Browser Server

Catalog Checkout

App Framework

Advanced Checkout

Negotiable Quote

Shared Catalog

Configurable Product

Bundle Product

Online Payment

Customer

Company Hierarchy

Customer Segment

RES

TH

TTP

& S

SRG

rap

hQ

L

Extension

Extension

Extension

Customization

Customization

Open Source Commerce B2B CustomizationExtension

Page 3: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Evolvability of platform guaranteed by Isolation of Services and Stable APIs

Page 4: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Storefront

Admin

Browser Server

App Framework

RES

TG

rap

hQ

L

Open Source Commerce B2B CustomizationExtension

Catalog

Catalog

Shared Catalog

Configurable Product

Bundle ProductCat

alo

g A

PI

Extension

Customization

Checkout

Quote

Negotiable Quote

Checkout

Advanced Checkout

Ch

ecko

ut

AP

I

Extension

Customization

Catalog Query

CatalogQuery

Shared Catalog

BundleProductC

atal

og

Qu

ery

AP

I

Extension

Customization

Customer

Customer

Company

Customer SegmentCu

sto

mer

AP

I

Extension

Customization

Elastic

Page 5: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Storefront

Admin

Browser Server

App Framework

RES

TG

rap

hQ

L

Open Source Commerce B2B CustomizationExtension

Catalog

Catalog

Shared Catalog

Configurable Product

Bundle ProductCat

alo

g A

PI

Extension

Customization

Ch

ecko

ut

AP

I

Catalog Query

CatalogQuery

Shared Catalog

BundleProduct

Cat

alo

g Q

ue

ry A

PI

Extension

Customization

Customer

Customer

Company

Customer SegmentCu

sto

mer

AP

I

Extension

Customization

Elastic

Saas Checkout Service

Page 6: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Storefront

Open Source Commerce B2B

Browser

Admin

Checkout

Checkout

App Framework

Negotiable Quote

AdvancedCheckoutR

EST

Customization

Catalog

Catalog

App Framework

Shared Catalog

Configurable Product

Bundle Product

RES

T

Extension

CustomizationOrder Management

Sales

App Framework

RMA

RES

T

Extension

Customization

Customer

Customer

App Framework

CompanyHierarchy

CustomerSegmentsRES

T

Extension

Customization

Storefront GatewayGraphQL

AdminGateway

REST

Admin

UP

WA

RD

CatalogQuery

CatalogQuery

App Framework

RES

T SharedCatalog

Customization

CustomizationExtension

Page 7: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Storefront

Open Source Commerce B2B

Browser

Admin

Checkout

Checkout

App Framework

Negotiable Quote

AdvancedCheckout

RES

T

Customization

Catalog

Catalog

App Framework

Shared Catalog

Configurable Product

Bundle Product

RES

T

Extension

CustomizationOrder Management

Sales

App Framework

RMA

RES

T

Extension

Customization

Customer

Customer

App Framework

CompanyHierarchy

CustomerSegmentsRES

T

Extension

Customization

Storefront GatewayGraphQL

AdminGateway

REST

Admin

UP

WA

RD

CatalogQuery

CatalogQuery

App Framework

RES

T SharedCatalog

Customization

CustomizationExtension

MFTF TestSuite

Catalog

Shared Catalog

Configurable Product

Bundle Product

Extension

Customization

Page 8: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Static decomposition

Page 9: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Commerce

Extension Vendor

repo.magento.com

Cloud

Makretplace

CoreCommunity

Testing Service

Page 10: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Service Isolation@AntonKril

http://bit.ly/magento-service-isolation

Page 11: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

More Details

Page 12: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

CAP Theorem

Consistency

AvailabilityPartitionTolerance

CACP

AP

Page 13: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Service design principles

• All merchant operations SHOULD BE eventually consistent

• All operations MUST BE idempotent.

• There MUST BE NO data dependencies between services.

• Sagas and confirmation timeouts SHOULD BE used for consistency of distributed operations

• All new state modifying service contracts SHOULD expose asynchronous bulk APIs

• Command & Query responsibility segregation – storefront APIs for data immutable in storefront (catalog, pricing,

promotions) should be optimized for data retrieval

• Compare and Swap (CAS) tokens SHOULD be used to avoid race conditions

Page 14: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Manual testing is not an option

• MFTF – modular functional testing framework

• Run MFTF on marketplace to validate extensions & upgrades

• Run MFTF on cloud to validate changes & upgrades

• Add capacity testing capabilities

Page 15: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Reduce WIP

2.3.0 2.3.1 2.3.x 2.4.0

CheckoutAPI 100.0.0 - alpha

CheckoutAPI 100.0.0 - Beta

CheckoutAPI 100.0.0 – RC1

CheckoutAPI 100.0.0

Time

Page 16: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Distributed Deployment

Microservices

Page 17: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Storefront

Open Source Commerce B2B

Browser

Admin

Checkout

Checkout

App Framework

Negotiable Quote

Advanced CheckoutR

EST

Customization

Catalog

Catalog

App Framework

Shared Catalog

Configurable Product

Bundle Product

RES

T

Extension

CustomizationOrder Management

Sales

App Framework

RMA

RES

T

Extension

Customization

Customer

Customer

App Framework

Company Hierarchy

Customer SegmentsRES

T

Extension

Customization

Storefront GatewayGraphQL

AdminGateway

REST

Admin

UP

WA

RD

CatalogQuery

CatalogQuery

App Framework

RES

T SharedCatalog

Customization

CustomizationExtension

Page 18: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Network is a scary placeIt is hard to design distributed systems

Page 19: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Fallacies of distributed computing

• The network is reliable.

• Latency is zero.

• Bandwidth is infinite.

• The network is secure.

• Topology doesn't change.

• There is one administrator.

• Transport cost is zero.

• The network is homogeneous.

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

Page 20: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Service Mesh

Checkout

Service mesh

Customer

Service mesh

Application

Service mesh

Catalog

Service mesh

Page 21: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Checkout Service Catalog Service

Cat

alog

AP

I

Cat

alog

P

roxy

Cat

alog

AP

I

Checkout Impl

Catalog Impl

Page 22: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Request processingindex.php Bootstrap

Load global configApplication\HttpLoad area config

Storefront FrontAction Routing

Action ControllerExecute

ViewExecute

Webapi FrontService Contract Routing

Service ContractExecute

index.php BootstrapLoad global config

Webapi FrontService Contract Routing

Service ContractExecute

Service ContractExecute

Page 23: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Lightweight framework

• Automated cache invalidation

• Area is loaded immediately. No intermediate “global” step

• No “isInstalled” checks

• No store resolving

• No application classes

• Lightweight Request/Response class

• No Layout loading

• No UrlRewrite, default store redirect plugins

• Simplified webapi routing

• No “registration.php” loaded per module on every request

• ….

Page 24: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Unified environmentDev stack Staging & Production stack

Commerce Cloud

Page 25: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Autoscaling group

Checkout Checkout Checkout

LB Autoscaling group

Catalog Catalog Catalog

LB

Autoscaling group

Customer

LB

Customer Customer

Admin machine> magento context:add checkout administrative_endpoint_address> magento context:set checkout> Magento info:dependencies:show-modules

Page 26: Magento / Software Testing / Party - Something Architecture · 2019-03-08 · Quote Shared Catalog Configurable Product Bundle Product Online Payment Customer Company Hierarchy Customer

Service Isolation@AntonKril

http://bit.ly/magento-service-isolation