Monday, April 8, 13. Creating Successful Magento ERP Integrations

Similar documents
Magento Customization With Extensions. Ashley Schroder aschroder.com

Practical Performance Understanding the Performance of Your Application

Services. Relational. Databases & JDBC. Today. Relational. Databases SQL JDBC. Next Time. Services. Relational. Databases & JDBC. Today.

Certified PHP/MySQL Web Developer Course

Using DOTS as Apache Derby System Test

Jitterbit Technical Overview : Microsoft Dynamics CRM

Using Redis as a Cache Backend in Magento

Magento & Zend Benchmarks Version 1.2, 1.3 (with & without Flat Catalogs)

Legal. Copyright 2016 Magento, Inc.; All Rights Reserved.

Best Practices: Extending Enterprise Applications to Mobile Devices

Manage cloud infrastructures using Zend Framework

Open Source DBMS CUBRID 2008 & Community Activities. Byung Joo Chung bjchung@cubrid.com

ASULPUNTO Magento unicenta opos integration extension Version 1.0.0

Java SE 8 Programming

: provid.ir

Top 10 reasons your ecommerce site will fail during peak periods

Java Interview Questions and Answers

The Service Availability Forum Specification for High Availability Middleware

Performance Analysis of Web based Applications on Single and Multi Core Servers

Zapper for ecommerce. Magento Plugin Version Checkout

TestStand Certification Overview

SOFT 437. Software Performance Analysis. Ch 5:Web Applications and Other Distributed Systems

Production time profiling On-Demand with Java Flight Recorder

1. ERP integrators contacts. 2. Order export sample XML schema

Zend and IBM: Bringing the power of PHP applications to the enterprise

HORIZONTAL SCALABILITY

Oracle Corporation Proprietary and Confidential

The ROI of Test Automation

Case Study. Application Development & Modernization ERP System. Case Study. Nations Photo Lab (Photo finishing Industry)

Virtuozzo Virtualization SDK

SQL Server An Overview

Data Synchronization between Magento and VTiger

Version of this tutorial: 1.06a (this tutorial will going to evolve with versions of NWNX4)

Designing and Implementing an Online Bookstore Website

ODBC Client Driver Help Kepware, Inc.

Real Time Market Data and Trade Execution with R

Affdex SDK for Android. Developer Guide For SDK version 1.0

Working with Motorola RFID

Who is SharePoint Joel?

Quantifind s story: Building custom interactive data analytics infrastructure

A Technical Review of TIBCO Patterns Search

Tivoli IBM Tivoli Web Response Monitor and IBM Tivoli Web Segment Analyzer

Resource Monitoring During Performance Testing. Experience Report by Johann du Plessis. Introduction. Planning for Monitoring

LAMP [Linux. Apache. MySQL. PHP] Industrial Implementations Module Description

Jitterbit Technical Overview : Microsoft Dynamics AX

How to create/avoid memory leak in Java and.net? Venkat Subramaniam

Developing Algo Trading Applications with SmartQuant Framework The Getting Started Guide SmartQuant Ltd Dr. Anton B.

Magento Customer Segments Under the Hood

Introduction to LabVIEW Design Patterns

Real-time reporting at 10,000 inserts per second. Wesley Biggs CTO 25 October 2011 Percona Live

Big Data Analytics Nokia

Data Distribution with SQL Server Replication

PHP FRONT END DEVELOPER (BERLIN)

Effective Team Development Using Microsoft Visual Studio Team System

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

q for Gods Whitepaper Series (Edition 7) Common Design Principles for kdb+ Gateways

Cognos8 Deployment Best Practices for Performance/Scalability. Barnaby Cole Practice Lead, Technical Services

WHAT WE NEED TO START THE PERFORMANCE TESTING?

Moreketing. With great ease you can end up wasting a lot of time and money with online marketing. Causing

Mimer SQL Real-Time Edition White Paper

Improve business agility with WebSphere Message Broker

Performance Testing Process A Whitepaper

Writing a Logical Decoding Plug-In. Christophe Pettus PostgreSQL Experts, Inc. FOSDEM 2015

Product Review: James F. Koopmann Pine Horse, Inc. Quest Software s Foglight Performance Analysis for Oracle

PERFORMANCE MODELS FOR APACHE ACCUMULO:

Recommendations for Performance Benchmarking

Clustering with Tomcat. Introduction. O'Reilly Network: Clustering with Tomcat. by Shyam Kumar Doddavula 07/17/2002

Creating Value through Innovation MAGENTO 1.X TO MAGENTO 2.0 MIGRATION

Synchronous multi-master clusters with MySQL: an introduction to Galera

Pervasive Software + NetSuite = Seamless Cloud Business Processes

Hands-On Microsoft Windows Server 2008

Resource Utilization of Middleware Components in Embedded Systems

CSCI E 98: Managed Environments for the Execution of Programs

How To Apply Software Archeology To Your Development Process

Continuous Integration Part 2

Performance Testing Microsoft Dynamics NAV

LYONSCG ECOMMERCE ACCELERATOR (LEA) FOR MAGENTO. Discussion of Features

IMPORT / EXPORT PRODUCTS

Architectural patterns for building real time applications with Apache HBase. Andrew Purtell Committer and PMC, Apache HBase

Session Storage in Zend Server Cluster Manager

CIC Audit Review: Experian Data Quality Enterprise Integrations. Guidance for maximising your investment in enterprise applications

InfiniteGraph: The Distributed Graph Database

All Things Oracle Database Encryption

Title Release Notes PC SDK Date Dealt with by, telephone. Table of Content GENERAL Corrected Issues PDD...

Capabilities of a Java Test Execution Framework by Erick Griffin

SELECTING ECOMMERCE WEB HOSTING & SUPPORT

Application Performance Testing Basics

Java Monitoring. Stuff You Can Get For Free (And Stuff You Can t) Paul Jasek Sales Engineer

Performance Monitoring AlwaysOn Availability Groups. Anthony E. Nocentino

Network traffic monitoring and management. Sonia Panchen 11 th November 2010

Jitterbit Technical Overview : Salesforce

Pega as a Service. Kim Singletary, Dir. Product Marketing Cloud Matt Yanchyshyn, Sr. Mgr., AWS Solutions Architect

Transcription:

Creating Successful Magento ERP Integrations

Happy Together Creating Successful Magento ERP Integrations David Alger CTO / Lead Engineer www.classyllama.com

A Little About Me Exclusively focused on Magento ecommerce since early 09 Member of the Magento Technical Partner Council Member of the Magento Certification Advisory Board Magento Certified Developer Plus Magento Front End Certified Developer Zend Certified Engineer Experienced Software Integrator

Creating Magento ERP Integrations Architecting and engineering a Magento ERP integration while avoiding the pitfalls and challenges that come with integrating multiple enterprise-level software components

What s On Our Agenda Reasons for Integrating Purpose Driven Nature Architectural Design Facing Challenges Engineering Solutions Integration Scalability

Why an Integration? An ERP in simple terms: Software built around the premise of having the ability to manage all of the information and functions of a company seamlessly and in real-time What benefits are there? Centralization, accuracy, less hassle! Order Fulfillment Customer Service Product Management Integrating Magento with your ERP means an increase in efficiency

Purpose Driven Nature Integrations with any software should be purpose driven What are the goals of the integration? Example: Guaranteed accurate information across properties Example: Less headaches during order fulfillment

Architectural Design The importance of having an integration blueprint Information Coverage Master of Record Direction of Flow Pre-requisites for designing a workable solution Insights into business process Familiarity with software Knowledge of the data Integration paradigms Middleware vs Direct

Typical Technical Blueprint 1. Integration Goals / Summary 2. Integration Dependencies 3. Integration Method 4. Integration Requirements 4.1. Product Information 4.1.1. Inventory 4.1.2. Pricing 4.1.2.1. General Pricing 4.1.2.2. Customer Tiers 4.2. Customer Accounts 4.3. Orders 4.3.1. Export 4.3.2. Fulfillment / Updates 4.3.3. Payment Processing

Facing Challenges Using COTS (Commercial Off the Shelf) products Controlling data exposure at connection points aka PCI-DSS compliance Real-time data synchronization: Is it possible or even worth it? Maintaining data integrity between disparate systems Overall reliability of the integration processes

Engineering Solutions Methods of Direct Integration Managing Memory Leaks Building a Scalable Integration

Methods of Direct Integration Database Remote Local Flat Files Web Services Combinations

Managing Memory Leaks PHP 5.3 Garbage Collector Largely addressed circular reference memory leaks Far better than PHP 5.2 but doesn t eliminate all possible leaks Global anonymous functions can still be orphaned! Looping over all records of a large catalog in one execution is a practical impossibility... particularly when running PHP 5.2 or GC disabled Using memory_get_usage and a bit of clever logic: We can prevent processes dying due to memory leaks Create a robust and reliable process manager

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 abstract class CLS_Integration_Model_Process_Abstract { protected static function _getmemlimit() { static $limit = NULL; if ($limit === NULL) { $value = trim(ini_get('memory_limit')); $code = strtolower($value[strlen($value)-1]); switch ($code) { case 'g': // intentional fall through $value *= 1024; case 'm': // intentional fall through $value *= 1024; case 'k': // intentional fall through $value *= 1024; } $limit = (int)$value; } return $limit; } /** * Reschedules the cron job $interval seconds into the future. * * @param Mage_Cron_Model_Schedule $schedule

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 } * @param CLS_Integration_Model_Resource_Erp_Db_Collection_Abstract $collection * @param string $callback */ protected function _processdatacollection($collection, $callback) { $index = 0; $limit = self::_getmemlimit(); // store the memory limit in bytes for calculations $baseline = 0; // the current memory usage at last iteration $delta = 0; // maximum difference in memory usgae from one iteration to the next $space = NULL; // the remaining number of iterations we have based on the $delta } foreach ($collection as $record) { $baseline = memory_get_usage(); // update the baseline try { $this->$callback($record); // process the record } catch (Zend_Db_Exception $e) { // catch, log and skip items where an exception (like a deadlock or lock timeout) occurs... Mage::logException($e); continue; } if ($index == 0) { $baseline = memory_get_usage(); // first iteration, update this post-processing to avoid inflated delta } else { $delta = max($delta, memory_get_usage() - $baseline, 0.0001); // calculate memory usage delta $space = floor(($limit - memory_get_usage()) / $delta); // calculate approximate space for iterations } // if we have space for less than 100 estimated iteration remaining, log a message and break to cleanup if ($space!== NULL && $space <= 100) { Mage::log("CLS_Integration [". CLASS."::". FUNCTION."]: Must terminate, within 100"." iterations of remaining space allowed by memory_limit!"); return false; } } return true;

Building a Scalable Integration Dealing with large amounts of data Polling for changes Data write throughput Index management Managing integration processes Use the built-in cron dispatcher for job execution Thread locks are critical to avoid racing and overworking jobs A page cursor can come in very handy when polling is used

} /** * Reschedules the cron job $interval seconds into the future. * * @param Mage_Cron_Model_Schedule $schedule * @param int $interval */ protected function _reschedulecron(mage_cron_model_schedule $pschedule, $interval = 10) { $timestamp = Mage::getSingleton('core/date')->gmtTimestamp()+$interval; $schedule = Mage::getModel('cron/schedule'); $schedule->setjobcode($pschedule->getjobcode()) ->setstatus(mage_cron_model_schedule::status_pending) ->setcreatedat($timestamp) ->setscheduledat($timestamp) ; $schedule->save(); } return $this; /** * Takes a data collections and process it within a memory monitoring loop * * @param CLS_Integration_Model_Resource_Erp_Db_Collection_Abstract $collection

8e7c076 a minute ago Blame Fu -- -- cls_integration_process_lock - table schema -- CREATE TABLE `cls_integration_process_lock` ( `code` varchar(50) NOT NULL COMMENT 'Job Code', `locked_at` timestamp NULL DEFAULT NULL COMMENT 'Locked At', `freed_at` timestamp NULL DEFAULT NULL COMMENT 'Freed At', `status` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Lock Status', PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Holds an atomically set lock to prevent overlapping jobs.'; -- -- cls_integration_process_lock - atomic lock update -- ref: CLS_Integration_Model_Resource_Process_Lock::obtainLock -- UPDATE `cls_integration_process_lock` SET `status` = 1 WHERE `status` = 0 AND `code` = 'product'; Blog Report a bug Support Documentation API Forum Server status Terms of service Privacy policy

8e7c076 a minute ago Blame Fu -- -- cls_integration_process_lock - table schema -- CREATE TABLE `cls_integration_process_lock` ( `code` varchar(50) NOT NULL COMMENT 'Job Code', `locked_at` timestamp NULL DEFAULT NULL COMMENT 'Locked At', `freed_at` timestamp NULL DEFAULT NULL COMMENT 'Freed At', `status` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Lock Status', PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Holds an atomically set lock to prevent overlapping jobs.'; -- -- cls_integration_process_lock - atomic lock update -- ref: CLS_Integration_Model_Resource_Process_Lock::obtainLock -- UPDATE `cls_integration_process_lock` SET `status` = 1 WHERE `status` = 0 AND `code` = 'product'; Blog Report a bug Support Documentation API Forum Server status Terms of service Privacy policy

P.S. WE RE HIRING!!! Questions or Comments? David Alger (@blackbooker) CTO / Lead Engineer www.classyllama.com david@classyllama.com http://bit.ly/imagine-erp