scaling an ecommerce environment

52
Scaling an eCommerce environment Beyond Magento

Upload: sander-mangel

Post on 14-Apr-2017

613 views

Category:

Technology


1 download

TRANSCRIPT

Scaling an eCommerce environment

Beyond Magento

Sander Mangel- Worked at several web agencies

- Currently working as Technical Lead at FitForMe

- 10 as PHP developer, 5 years as Magento developer

- MageStackDay, Rotterdam MUG, Meet Magento NL

- sandermangel.nl / @sandermangel

Scaling An Ecommerce Environment @sandermangel

FitForMe- Food supplements for bariatric patients

- Magento EE 1.14.x

- 13 websites (countries) in 1 installation

- > 1000 orders per week via webshop

- Rest via telephone, agents, resellers, pharmacies

Migrating to Magento 2 - As a Merchant @sandermangel

Fulfillment- Warehouse in The Netherlands

- Warehouse in the UK soon active

- Resellers on other continents Q4 2016

B2B orders are booked directly into the ERP system

B2C orders via Magento

Scaling An Ecommerce Environment @sandermangel

Basic outsourced order fulfillment

Scaling An Ecommerce Environment @sandermangel

Expanding requirements

Scaling An Ecommerce Environment @sandermangel

Fulfillment integrated in Magento- Extracts data from the order & customer object

- Performs some address checks (formatting and validity)

- Creates an XML to send to the fulfillment company by FTP

- Determines the type of shipping box

- And some other magic that fixes/patches order data for fulfillment company

Scaling An Ecommerce Environment @sandermangel

Expanding requirements

Scaling An Ecommerce Environment @sandermangel

POS for pharmacies, events, hospitals and sales agents

ERP for B2B, exotic countries and Bulk orders

Promotions, loyalty gifts, etc

Something like this

Scaling An Ecommerce Environment @sandermangel

Magento as the shipping platformMagento > Warehouse 1

Magento > Warehouse 2

Magento <> Shipping Contract Manager

ERP <> Magento

POS <> Magento

Dotmailer > Magento

Scaling An Ecommerce Environment @sandermangel

Magento as the shipping APIRequires a full order, invoice and

shipment to be made in Magento.

No guarantee for a stable API, if Magento

changes (modules, updates, etc) the API

breaks

Magento 2 compatible? Probably not...

Scaling An Ecommerce Environment @sandermangel

Magento sucks at doing everything

Scaling An Ecommerce Environment @sandermangel

Magento sucks at doing everything

But excels at being an online catalogue & checkout

Scaling An Ecommerce Environment @sandermangel

Use Magento for its purposeMagento as a slow, resource heavy

eCommerce platform should never be

used for anything else than being an

online catalog and ordering system,

which is cached and optimized either out

of the box or through a couple of tweaks.

Scaling An Ecommerce Environment @sandermangel

Using Magento for the rest- Restricted by Magento

- Creates overhead

- Tightly coupled

Generally, it takes more effort to make it

work with Magento than to actually build

the feature.

Scaling An Ecommerce Environment @sandermangel

The agency way- Projects are normally done with 1 framework

- Features are made to fit the technical solution

- Scalability is relative

- Only keeping in mind project scope

- Just make it work for now, changes can be done in a later project

- Make sure all hours are billable

Scaling An Ecommerce Environment @sandermangel

Meeting a merchant needs- Scope changes as the business grows

- Build features to be easily replaceable, all code is expendable

- Think outside of frameworks, budgets and scopes defined by business

- Should be affordable even when doing high volumes

- Applications should be build modular and movable

Scaling An Ecommerce Environment @sandermangel

Make it a Microservice!

Scaling An Ecommerce Environment @sandermangel

Make it a Microservice!

Well… Microservice-ish

Scaling An Ecommerce Environment @sandermangel

"In computing, microservices is a software architecture style

in which complex applications are composed of small, independent processes

communicating with each other using language-agnostic APIs."

— https://en.wikipedia.org/wiki/Microservices

Scaling An Ecommerce Environment @sandermangel

Ah right, so what does it do?An application and underlying infrastructure specifically designed and optimized for

one task with an API interface allowing other systems to communicate with it.

Scaling An Ecommerce Environment @sandermangel

Ah right, so what does it do?An application and underlying infrastructure specifically designed and optimized for

one task with an API interface allowing other systems to communicate with it.

or in the case of the FitForMe Fulfillment module…

An application that creates properly formatted shipment orders really well.

Scaling An Ecommerce Environment @sandermangel

A different approach

Scaling An Ecommerce Environment @sandermangel

Where to start- Write down what business logic should be moved to the Microservice

- Document the API interface. What data will be send

- Pick a framework to build it in

- Set up an environment to run the Microservice.

Scaling An Ecommerce Environment @sandermangel

Bonus tips- Keep it simple

- Stick to what you know

- Do read up on microservices

- Pick a simple module that has minimal coupling with Magento

- Document, Document, Document

Scaling An Ecommerce Environment @sandermangel

Requirements for a framework- Low learning curve

- Built on PHP and compatible with NginX, PHP 5.6 and up

- Fast & lightweight

- Has an API layer built in

- Has a testing framework built in

Scaling An Ecommerce Environment @sandermangel

Requirements for a framework- Low learning curve

- Built on PHP and compatible with NginX, PHP 5.6 and up

- Fast & lightweight

- Has an API layer built in

- Has a testing framework built in

Scaling An Ecommerce Environment @sandermangel

Basic Magento model

Extracting Magento data in models

Logic in loosely coupled classes

Set up the Database table

Define the API interface

And set up a cronjob

So that's it

Scaling An Ecommerce Environment @sandermangel

So that's it

Or is it?

Scaling An Ecommerce Environment @sandermangel

Whats next

Scaling An Ecommerce Environment

- Better infrastructure

@sandermangel

Whats next- Better infrastructure

- Management Layer

Scaling An Ecommerce Environment @sandermangel

Whats next- Better infrastructure

- Management Layer

- Using event driven hosting

Scaling An Ecommerce Environment @sandermangel

Whats next- Better infrastructure

- Management Layer

- Using event driven hosting

- Build more services

Scaling An Ecommerce Environment @sandermangel

Whats next- Better infrastructure

- Management Layer

- Using event driven hosting

- Build more services

- URL shortener

Scaling An Ecommerce Environment @sandermangel

Whats next- Better infrastructure

- Management Layer

- Using event driven hosting

- Build more services

- URL shortener

- Subscription order generation

Scaling An Ecommerce Environment @sandermangel

Whats next- Better infrastructure

- Management Layer

- Using event driven hosting

- Build more services

- URL shortener

- Subscription order generation

- ...Scaling An Ecommerce Environment @sandermangel

Thank you

Sources

Microservice in generalhttp://microservices.io/patterns/microservices.htmlhttp://martinfowler.com/articles/microservices.html

http://blog.eventuate.io/2016/01/27/microservices-more-than-just-infrastructure/Microservice in Magento

http://fbrnc.net/blog/2015/10/super-scaling-magentohttp://alankent.me/2016/01/15/microservices-and-magento-quick-note/

https://firebearstudio.com/blog/microservices-ecommerce-magento.htmlAPI in Lumen

http://laravelista.com/build-an-api-with-lumen-and-fractal/

slideshare.net/SanderMangel/scaling-an-ecommerce-environment

Scaling An Ecommerce Environment @sandermangel