SlideShare a Scribd company logo
#MM17PL
Sander Mangel
Headless Magento
#MM17PL
• Magento developer
• Lead @ FitForMe
• Co-organiser MMNL,
Unconf, MageStackDay,
Meetups
• Avid community member
twitter.com/sandermangel
linkedin.com/in/sandermangel
github.com/sandermangel
#MM17PL
#MM17PL
What is headless architecture
"Headless architecture means an application offering APIs that abstract away business logic
for a multitude of clients to consistently and repeatedly execute the same tasks."
#MM17PL
Read more
http://bit.ly/2qo6XBc
http://bit.ly/1Wku9c0
http://bit.ly/2rtVIas
http://bit.ly/2qrkQKP
http://bit.ly/2hyM6Dy
#MM17PL
Putting it into practice
#MM17PL
#MM17PL
#MM17PL
?
#MM17PL
Common integrations
● ERP
● Fulfillment
● Logs
● Email server
● ….
#MM17PL
Clients
● Magento backend
● Magento frontend
● Legacy system
● Dashboards
● Magento 2?
#MM17PL
So we take a different
approach
• Magento will be a client &
provide data
• Implement a basic data
warehouse
• Which is fed by, and queried
by various services separated
by domains
• Isolate data & business logic
per domain
That allows for a smooth integration
#MM17PL
#MM17PL
Leverage middleware for a
stable environment
storage
source consumer server
#MM17PL
Leverage middleware for a
stable environment
storage
source consumer server
● Normalize & combine data
● Offer stable APIs for clients
● Insulate from future changes
#MM17PL
#MM17PL
Incoming data
#MM17PL
Build on standardised libraries
● There is a solution for everything
already out there
● Use popular libraries, preferably
adhering to a PSR protocol
● Don't overcomplicate dependency
injection
● Think carefully about what you need
and spend time finding the best
option
[...]
"require": {
"php": ">=7.0",
"slim/slim": "^3.1",
"monolog/monolog": "^1.17",
"cache/filesystem-adapter": "^0.4.0",
"guzzlehttp/guzzle": "^6.2",
"cache/array-adapter": "^0.5.0",
"illuminate/database": "^5.4",
"yadakhov/insert-on-duplicate-key": "^1.1",
"symfony/console": "^3.3",
"league/oauth1-client": "^1.7"
}
[...]
#MM17PL
Build on standardised libraries
● slimphp - Routing, DI
● monolog - gives insight in what the service does
for monitoring and debugging
● cache/… - stores certain API calls, temporary data
● guzzle - offers a way to consume APIs over http
● illuminate/database - Laravel ORM (personal
preference)
● Insert-on-duplicate.... - not a default option in
illuminate/database but a must for me
● symfony/console - for cronjobs and commandline
tasks
● league/oauth1-client - offers built in Magento 1
REST integration
[...]
"require": {
"php": ">=7.0",
"slim/slim": "^3.1",
"monolog/monolog": "^1.17",
"cache/filesystem-adapter": "^0.4.0",
"guzzlehttp/guzzle": "^6.2",
"cache/array-adapter": "^0.5.0",
"illuminate/database": "^5.4",
"yadakhov/insert-on-duplicate-key": "^1.1",
"symfony/console": "^3.3",
"league/oauth1-client": "^1.7"
}
[...]
#MM17PL
Build on standardised libraries
● SlimPHP project as basis
● One module in src some basic
setup files needed by SlimPHP
● Keep it simple and self-contained
#MM17PL
Some learnings
● Single purpose
● It should feel overly simple
● Within the service, separate tasks
● Document, document, document
● Write integration tests for the API
endpoints
● Log everything
#MM17PL
Exposing data
#MM17PL
Exposing data
● Read only
● Easy to integrate
● Offer sorting, filtering, and a host of
other query options
● Be very fast (d'oh)
● Standardized & easily scalable
#MM17PL
Standardizing?
● Output format and syntax
● Filtering and sorting
● Caching
#MM17PL
Enabling various integrations
protected function _prepareCollection()
{
[...]
try {
$client = new Client();
$res = $client->request('GET', $helper->getBaseUrl(0) . 'quarantine?'.
http_build_query([ 'limit' => $limit, 'page' => $page, 'sort' => $columnId, 'sortdir'
=> $dir, 'filters' => (array)$filter, '', '&'));
} catch (Exception $error) {
Mage::logException($error);
$this->setCollection($collection); // set a dummy empty collection
return $this;
}
$data = json_decode($res->getBody(), true);
$lastPage = $data['to'];
array_walk($data['data'], function($order) use (&$collection) {
$collection->addItem(
new Varien_Object(
[ 'shipping_date' => $order['shipping_date'],
'order_reference' => $order['order_reference'],
'customer_reference' => $order['customer_reference'],
'updated_at' => $order['updated_at'],
'shipping_fullname' => "{$order['shipping_firstname']}
{$order['shipping_middlename']} {$order['shipping_lastname']}",
]
)
);
});
$collection->setCurPage($page);
$collection->setLastPageNumber($lastPage);
$collection->setSize($lastPage * $limit);
$this->setCollection($collection);
● Magento 1 grids
● Ajax calls for smaller values
● Data imports
● Communication between services
● ...
#MM17PL
Caching
● How dynamic is dynamic content
● Cache is all about control
● Think of a strategy upfront
#MM17PL
Caching
● How dynamic is dynamic content
● Cache is all about control
● Think of a strategy upfront
https://github.com/magespecialist/m2-M
SP_APIEnhancer
Magento 2 API enhancer
#MM17PL
Wish list & ideas
#MM17PL
Database
● MariaDB
○ Relational
○ Easy to work with
○ Offers good performance up to 1TB
data
● Elastic
○ REST output
○ Plug and play
○ Advanced search
#MM17PL
#MM17PL
Monolithic
● Dedicated / VPS server
○ Offered by all hosting
companies
○ Easy to maintain
○ Does not scale easily
○ If one goes down...
Distributed
● Instances on a cloud
○ Scales easily
○ Environments are isolated
○ Requires more knowledge
○ Can be harder to
administrate
#MM17PL
API gateway
● Allow for easy service discovery
● Handle authentication, call rate limiting
● Routing
- http://microservices.io/patterns/apigateway.html
- https://www.nginx.com/blog/building-microservic
es-using-an-api-gateway/
#MM17PL
API gateway
● Allow for easy service discovery
● Handle authentication, call rate limiting
● Routing
- http://microservices.io/patterns/apigateway.html
- https://www.nginx.com/blog/building-microservic
es-using-an-api-gateway/
#MM17PL
Output format
There are great solution for better
documenting, discovery and output
formatting.
However, standardising output across
a large set of APIs has it's pitfalls as
no implementation is ever perfect
#MM17PL
Summary
● By offloading tasks from Magento we keep
it fast and lightweight
● Storing data in a central place and making
it available via REST apis makes for easy
integration
● Headless can start by adding some of
those APIs to the existing back- or frontend
● Using lightweight php frameworks with
limited features makes for easy to develop
and fast applications
Code: https://github.com/sandermangel/headless-middleware
twitter.com/sandermangel
github.com/sandermangel
Integrating a ReactJS frontend in Magento 2
- Riccardo Tempesta
https://www.youtube.com/watch?v=ElZ5UtTXpzQ

More Related Content

What's hot

Hyperledger in AWS
Hyperledger in AWSHyperledger in AWS
Hyperledger in AWS
Carsten Eckelmann
 
Generic repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity FrameworkGeneric repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity Framework
Md. Mahedee Hasan
 
Full stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choiceFull stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choice
FDConf
 
Zing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat ArchitectZing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat Architect
Chau Thanh
 
Web Application Development using PHP and MySQL
Web Application Development using PHP and MySQLWeb Application Development using PHP and MySQL
Web Application Development using PHP and MySQLGanesh Kamath
 
Scaling Production Data across Microservices
Scaling Production Data across MicroservicesScaling Production Data across Microservices
Scaling Production Data across Microservices
Erik Ashepa
 
Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
Nitin Kumar
 
PHPCR - Standard Content Repository for PHP
PHPCR - Standard Content Repository for PHPPHPCR - Standard Content Repository for PHP
PHPCR - Standard Content Repository for PHP
Henri Bergius
 
Total cloud immersion
Total cloud immersionTotal cloud immersion
Total cloud immersion
Avishai Ish-Shalom
 
NoSQL Database in .NET Apps
NoSQL Database in .NET AppsNoSQL Database in .NET Apps
NoSQL Database in .NET AppsShiju Varghese
 
Introduction to JavaScript Full Stack
Introduction to JavaScript Full StackIntroduction to JavaScript Full Stack
Introduction to JavaScript Full Stack
Mindfire Solutions
 
Couch DB/PouchDB approach for hybrid mobile applications
Couch DB/PouchDB approach for hybrid mobile applicationsCouch DB/PouchDB approach for hybrid mobile applications
Couch DB/PouchDB approach for hybrid mobile applications
Ihor Malytskyi
 
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
Columbia Developers Guild
 
Synchronization with CouchDB and PouchDB
Synchronization with CouchDB and PouchDBSynchronization with CouchDB and PouchDB
Synchronization with CouchDB and PouchDB
EU Edge
 
Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3
Dobrica Pavlinušić
 
JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"
JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"
JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"
GeeksLab Odessa
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sitesdrupalcampest
 
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
GreeceJS
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its EvolutionDeepu S Nath
 

What's hot (20)

Hyperledger in AWS
Hyperledger in AWSHyperledger in AWS
Hyperledger in AWS
 
Generic repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity FrameworkGeneric repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity Framework
 
Sinatra
SinatraSinatra
Sinatra
 
Full stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choiceFull stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choice
 
Zing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat ArchitectZing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat Architect
 
Web Application Development using PHP and MySQL
Web Application Development using PHP and MySQLWeb Application Development using PHP and MySQL
Web Application Development using PHP and MySQL
 
Scaling Production Data across Microservices
Scaling Production Data across MicroservicesScaling Production Data across Microservices
Scaling Production Data across Microservices
 
Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
 
PHPCR - Standard Content Repository for PHP
PHPCR - Standard Content Repository for PHPPHPCR - Standard Content Repository for PHP
PHPCR - Standard Content Repository for PHP
 
Total cloud immersion
Total cloud immersionTotal cloud immersion
Total cloud immersion
 
NoSQL Database in .NET Apps
NoSQL Database in .NET AppsNoSQL Database in .NET Apps
NoSQL Database in .NET Apps
 
Introduction to JavaScript Full Stack
Introduction to JavaScript Full StackIntroduction to JavaScript Full Stack
Introduction to JavaScript Full Stack
 
Couch DB/PouchDB approach for hybrid mobile applications
Couch DB/PouchDB approach for hybrid mobile applicationsCouch DB/PouchDB approach for hybrid mobile applications
Couch DB/PouchDB approach for hybrid mobile applications
 
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
 
Synchronization with CouchDB and PouchDB
Synchronization with CouchDB and PouchDBSynchronization with CouchDB and PouchDB
Synchronization with CouchDB and PouchDB
 
Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3
 
JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"
JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"
JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
 
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its Evolution
 

Similar to Headless Magento - Meet Magento Poland 2017

Zendcon scaling magento
Zendcon scaling magentoZendcon scaling magento
Zendcon scaling magento
Mathew Beane
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotCloud
daoswald
 
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling StoryPHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
vanphp
 
12 Ways to Improve Magento 2 Security and Performance
12 Ways to Improve Magento 2 Security and Performance12 Ways to Improve Magento 2 Security and Performance
12 Ways to Improve Magento 2 Security and Performance
Elogic Magento Development
 
Scaling symfony apps
Scaling symfony appsScaling symfony apps
Scaling symfony apps
Matteo Moretti
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
Matteo Moretti
 
How Sysbee Manages Infrastructures and Provides Advanced Monitoring by Using ...
How Sysbee Manages Infrastructures and Provides Advanced Monitoring by Using ...How Sysbee Manages Infrastructures and Provides Advanced Monitoring by Using ...
How Sysbee Manages Infrastructures and Provides Advanced Monitoring by Using ...
InfluxData
 
Serverless? How (not) to develop, deploy and operate serverless applications.
Serverless? How (not) to develop, deploy and operate serverless applications.Serverless? How (not) to develop, deploy and operate serverless applications.
Serverless? How (not) to develop, deploy and operate serverless applications.
gjdevos
 
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Binary Studio
 
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Pôle Systematic Paris-Region
 
Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applications
BrettTasker
 
There is something about serverless
There is something about serverlessThere is something about serverless
There is something about serverless
gjdevos
 
Eko10 Workshop Opensource Database Auditing
Eko10  Workshop Opensource Database AuditingEko10  Workshop Opensource Database Auditing
Eko10 Workshop Opensource Database Auditing
Juan Berner
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2
aspyker
 
Magento Performance Optimization 101
Magento Performance Optimization 101Magento Performance Optimization 101
Magento Performance Optimization 101
Angus Li
 
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORINGEko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
Pablo Garbossa
 
How to deploy & optimize eZ Publish
How to deploy & optimize eZ PublishHow to deploy & optimize eZ Publish
How to deploy & optimize eZ Publish
Kaliop-slide
 
introduction to micro services
introduction to micro servicesintroduction to micro services
introduction to micro services
Spyros Lambrinidis
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructure
Yshay Yaacobi
 
Modern tools for magento development
Modern tools for magento developmentModern tools for magento development
Modern tools for magento development
Umberellaa
 

Similar to Headless Magento - Meet Magento Poland 2017 (20)

Zendcon scaling magento
Zendcon scaling magentoZendcon scaling magento
Zendcon scaling magento
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotCloud
 
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling StoryPHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
 
12 Ways to Improve Magento 2 Security and Performance
12 Ways to Improve Magento 2 Security and Performance12 Ways to Improve Magento 2 Security and Performance
12 Ways to Improve Magento 2 Security and Performance
 
Scaling symfony apps
Scaling symfony appsScaling symfony apps
Scaling symfony apps
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
How Sysbee Manages Infrastructures and Provides Advanced Monitoring by Using ...
How Sysbee Manages Infrastructures and Provides Advanced Monitoring by Using ...How Sysbee Manages Infrastructures and Provides Advanced Monitoring by Using ...
How Sysbee Manages Infrastructures and Provides Advanced Monitoring by Using ...
 
Serverless? How (not) to develop, deploy and operate serverless applications.
Serverless? How (not) to develop, deploy and operate serverless applications.Serverless? How (not) to develop, deploy and operate serverless applications.
Serverless? How (not) to develop, deploy and operate serverless applications.
 
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
 
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
 
Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applications
 
There is something about serverless
There is something about serverlessThere is something about serverless
There is something about serverless
 
Eko10 Workshop Opensource Database Auditing
Eko10  Workshop Opensource Database AuditingEko10  Workshop Opensource Database Auditing
Eko10 Workshop Opensource Database Auditing
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2
 
Magento Performance Optimization 101
Magento Performance Optimization 101Magento Performance Optimization 101
Magento Performance Optimization 101
 
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORINGEko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
 
How to deploy & optimize eZ Publish
How to deploy & optimize eZ PublishHow to deploy & optimize eZ Publish
How to deploy & optimize eZ Publish
 
introduction to micro services
introduction to micro servicesintroduction to micro services
introduction to micro services
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructure
 
Modern tools for magento development
Modern tools for magento developmentModern tools for magento development
Modern tools for magento development
 

More from Sander Mangel

Shopware PWA - a technical overview of
Shopware PWA - a technical overview ofShopware PWA - a technical overview of
Shopware PWA - a technical overview of
Sander Mangel
 
Quality Assurance at every step of a Magento project
Quality Assurance at every step of a Magento projectQuality Assurance at every step of a Magento project
Quality Assurance at every step of a Magento project
Sander Mangel
 
PWA 101, what you need to know about ShopwarePWA
PWA 101, what you need to know about ShopwarePWAPWA 101, what you need to know about ShopwarePWA
PWA 101, what you need to know about ShopwarePWA
Sander Mangel
 
Exploring pwa for shopware
Exploring pwa for shopwareExploring pwa for shopware
Exploring pwa for shopware
Sander Mangel
 
Pwa, separating the features from the solutions
Pwa, separating the features from the solutions Pwa, separating the features from the solutions
Pwa, separating the features from the solutions
Sander Mangel
 
Van Magento 1 naar 2
Van Magento 1 naar 2Van Magento 1 naar 2
Van Magento 1 naar 2
Sander Mangel
 
Layered Landing
Layered LandingLayered Landing
Layered Landing
Sander Mangel
 
Scaling an eCommerce environment
Scaling an eCommerce environmentScaling an eCommerce environment
Scaling an eCommerce environment
Sander Mangel
 
Migrating to Magento 2 - As a Merchant
Migrating to Magento 2 - As a MerchantMigrating to Magento 2 - As a Merchant
Migrating to Magento 2 - As a Merchant
Sander Mangel
 

More from Sander Mangel (9)

Shopware PWA - a technical overview of
Shopware PWA - a technical overview ofShopware PWA - a technical overview of
Shopware PWA - a technical overview of
 
Quality Assurance at every step of a Magento project
Quality Assurance at every step of a Magento projectQuality Assurance at every step of a Magento project
Quality Assurance at every step of a Magento project
 
PWA 101, what you need to know about ShopwarePWA
PWA 101, what you need to know about ShopwarePWAPWA 101, what you need to know about ShopwarePWA
PWA 101, what you need to know about ShopwarePWA
 
Exploring pwa for shopware
Exploring pwa for shopwareExploring pwa for shopware
Exploring pwa for shopware
 
Pwa, separating the features from the solutions
Pwa, separating the features from the solutions Pwa, separating the features from the solutions
Pwa, separating the features from the solutions
 
Van Magento 1 naar 2
Van Magento 1 naar 2Van Magento 1 naar 2
Van Magento 1 naar 2
 
Layered Landing
Layered LandingLayered Landing
Layered Landing
 
Scaling an eCommerce environment
Scaling an eCommerce environmentScaling an eCommerce environment
Scaling an eCommerce environment
 
Migrating to Magento 2 - As a Merchant
Migrating to Magento 2 - As a MerchantMigrating to Magento 2 - As a Merchant
Migrating to Magento 2 - As a Merchant
 

Recently uploaded

Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
Trending Blogers
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
CIOWomenMagazine
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
zyfovom
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
harveenkaur52
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
SEO Article Boost
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
cuobya
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
hackersuli
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 

Recently uploaded (20)

Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 

Headless Magento - Meet Magento Poland 2017

  • 2. #MM17PL • Magento developer • Lead @ FitForMe • Co-organiser MMNL, Unconf, MageStackDay, Meetups • Avid community member twitter.com/sandermangel linkedin.com/in/sandermangel github.com/sandermangel
  • 4. #MM17PL What is headless architecture "Headless architecture means an application offering APIs that abstract away business logic for a multitude of clients to consistently and repeatedly execute the same tasks."
  • 10. #MM17PL Common integrations ● ERP ● Fulfillment ● Logs ● Email server ● ….
  • 11. #MM17PL Clients ● Magento backend ● Magento frontend ● Legacy system ● Dashboards ● Magento 2?
  • 12. #MM17PL So we take a different approach • Magento will be a client & provide data • Implement a basic data warehouse • Which is fed by, and queried by various services separated by domains • Isolate data & business logic per domain That allows for a smooth integration
  • 14. #MM17PL Leverage middleware for a stable environment storage source consumer server
  • 15. #MM17PL Leverage middleware for a stable environment storage source consumer server ● Normalize & combine data ● Offer stable APIs for clients ● Insulate from future changes
  • 18. #MM17PL Build on standardised libraries ● There is a solution for everything already out there ● Use popular libraries, preferably adhering to a PSR protocol ● Don't overcomplicate dependency injection ● Think carefully about what you need and spend time finding the best option [...] "require": { "php": ">=7.0", "slim/slim": "^3.1", "monolog/monolog": "^1.17", "cache/filesystem-adapter": "^0.4.0", "guzzlehttp/guzzle": "^6.2", "cache/array-adapter": "^0.5.0", "illuminate/database": "^5.4", "yadakhov/insert-on-duplicate-key": "^1.1", "symfony/console": "^3.3", "league/oauth1-client": "^1.7" } [...]
  • 19. #MM17PL Build on standardised libraries ● slimphp - Routing, DI ● monolog - gives insight in what the service does for monitoring and debugging ● cache/… - stores certain API calls, temporary data ● guzzle - offers a way to consume APIs over http ● illuminate/database - Laravel ORM (personal preference) ● Insert-on-duplicate.... - not a default option in illuminate/database but a must for me ● symfony/console - for cronjobs and commandline tasks ● league/oauth1-client - offers built in Magento 1 REST integration [...] "require": { "php": ">=7.0", "slim/slim": "^3.1", "monolog/monolog": "^1.17", "cache/filesystem-adapter": "^0.4.0", "guzzlehttp/guzzle": "^6.2", "cache/array-adapter": "^0.5.0", "illuminate/database": "^5.4", "yadakhov/insert-on-duplicate-key": "^1.1", "symfony/console": "^3.3", "league/oauth1-client": "^1.7" } [...]
  • 20. #MM17PL Build on standardised libraries ● SlimPHP project as basis ● One module in src some basic setup files needed by SlimPHP ● Keep it simple and self-contained
  • 21. #MM17PL Some learnings ● Single purpose ● It should feel overly simple ● Within the service, separate tasks ● Document, document, document ● Write integration tests for the API endpoints ● Log everything
  • 23. #MM17PL Exposing data ● Read only ● Easy to integrate ● Offer sorting, filtering, and a host of other query options ● Be very fast (d'oh) ● Standardized & easily scalable
  • 24. #MM17PL Standardizing? ● Output format and syntax ● Filtering and sorting ● Caching
  • 25. #MM17PL Enabling various integrations protected function _prepareCollection() { [...] try { $client = new Client(); $res = $client->request('GET', $helper->getBaseUrl(0) . 'quarantine?'. http_build_query([ 'limit' => $limit, 'page' => $page, 'sort' => $columnId, 'sortdir' => $dir, 'filters' => (array)$filter, '', '&')); } catch (Exception $error) { Mage::logException($error); $this->setCollection($collection); // set a dummy empty collection return $this; } $data = json_decode($res->getBody(), true); $lastPage = $data['to']; array_walk($data['data'], function($order) use (&$collection) { $collection->addItem( new Varien_Object( [ 'shipping_date' => $order['shipping_date'], 'order_reference' => $order['order_reference'], 'customer_reference' => $order['customer_reference'], 'updated_at' => $order['updated_at'], 'shipping_fullname' => "{$order['shipping_firstname']} {$order['shipping_middlename']} {$order['shipping_lastname']}", ] ) ); }); $collection->setCurPage($page); $collection->setLastPageNumber($lastPage); $collection->setSize($lastPage * $limit); $this->setCollection($collection); ● Magento 1 grids ● Ajax calls for smaller values ● Data imports ● Communication between services ● ...
  • 26. #MM17PL Caching ● How dynamic is dynamic content ● Cache is all about control ● Think of a strategy upfront
  • 27. #MM17PL Caching ● How dynamic is dynamic content ● Cache is all about control ● Think of a strategy upfront https://github.com/magespecialist/m2-M SP_APIEnhancer Magento 2 API enhancer
  • 29. #MM17PL Database ● MariaDB ○ Relational ○ Easy to work with ○ Offers good performance up to 1TB data ● Elastic ○ REST output ○ Plug and play ○ Advanced search
  • 31. #MM17PL Monolithic ● Dedicated / VPS server ○ Offered by all hosting companies ○ Easy to maintain ○ Does not scale easily ○ If one goes down... Distributed ● Instances on a cloud ○ Scales easily ○ Environments are isolated ○ Requires more knowledge ○ Can be harder to administrate
  • 32. #MM17PL API gateway ● Allow for easy service discovery ● Handle authentication, call rate limiting ● Routing - http://microservices.io/patterns/apigateway.html - https://www.nginx.com/blog/building-microservic es-using-an-api-gateway/
  • 33. #MM17PL API gateway ● Allow for easy service discovery ● Handle authentication, call rate limiting ● Routing - http://microservices.io/patterns/apigateway.html - https://www.nginx.com/blog/building-microservic es-using-an-api-gateway/
  • 34. #MM17PL Output format There are great solution for better documenting, discovery and output formatting. However, standardising output across a large set of APIs has it's pitfalls as no implementation is ever perfect
  • 35. #MM17PL Summary ● By offloading tasks from Magento we keep it fast and lightweight ● Storing data in a central place and making it available via REST apis makes for easy integration ● Headless can start by adding some of those APIs to the existing back- or frontend ● Using lightweight php frameworks with limited features makes for easy to develop and fast applications
  • 36. Code: https://github.com/sandermangel/headless-middleware twitter.com/sandermangel github.com/sandermangel Integrating a ReactJS frontend in Magento 2 - Riccardo Tempesta https://www.youtube.com/watch?v=ElZ5UtTXpzQ