Magento 101: A technical overview


Published on

Magento technology has been adopted by over 100,000 stores worldwide, which makes it the fastest growing open-source e-commerce platform. A technical overview of Magento's system architecture will cover layers including libraries in PHP and JavaScript, configuration, controllers, event-driven models, blocks and templates, layout XML, customization and core APIs for integration.

Published in: Technology
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • limit less ecommerce
  • Hi everyone.Hi, my name is Dmitriy Soroka, I’m System Architect at Magento Inc., an eBay Company (X.Commerce). Today, together with Kevin Eichelberger, who is the CTO of Blue Acorn, we will do short technical overview of Magento Platform.The goal of this session if to show that Magento is highly customizable limit less ecommerce solution the allows to build online stores.During the presentation we will overview Magento technology stack and Magento architecture, will see how to customize Magento functionality for particular business needs. After thatKevin will show us real examples of Magento customizations and will share his company experience.
  • Lets start from the technology and take a look into magentofoundation.
  • Recommended and most tested environment for Magento is the LAMP stack which includes Linux as OS, Apache as Web server, MySQL as database and PHP as the server side scripting language.LAMP is recommended environment for Magento installation, but it is not a limitation. Magento performs good on Windows Server, could be set up with nGinx web server, could use different RDBMS’s like MSSQL and Oracle.
  • Magento server side is written on PHP and JS is used as client side scripting language. PHP and JS communities are very big and provides a lot of functionality implemented in frameworks and libraries.The list of available frameworks is huge and it is not easy to chose a specific one.At the moment when we started magento (earlier 2007) the PHP frameworks world was very active and the main player came with own one: Zend (the PHP company) developed Zend Framework. Right now we are using it as main components library.Also we are using some components from biggest PHP extensions and Application Repository (PEAR).Solr PHP Client is another example of 3rd party library that helps to integrate Magento with very powerful SOLR search engine.This list could be as big as you need because you, us developer, could use any existing library with magento.On JS side more than 90% of functionality is implemented with Prototype & script.aculo.usWe are using some features from Jquery and TinyMCE is wysiwyg editor that integrated with Magento out of the box.Our team is continuously monitoring technology changes (they are changing too fast) and doing system improvements related with them.
  • Right technology choice is very important, but even with best technology in the world the final result could be not so good.The very important aspect of success is system architecture. Architectural requirements list for Magento was not so big at the beginning: it was like “The system should be” FlexibleScalableExtendableModularPerform well….In one word the best system in the worldAnd now I’m proposing to dive a little bit dipper into Magento architecture and see how we achieve them.
  • Top level of Magento Architecture understanding is starting from application layers grid, which you can see on the slideThe library layer is fundamental and represented by set of frameworks and libraries that are shared across the system and available in any module on any upper layer.Data layer represented install/upgrade scripts, resource models is responsible for communication to the data storage.On the domain layer Magento has all Business logic that is used by presentation layer.The system is modular and modules are units of decomposition for all layers except libraries.Presentation layer has few more decomposition units like theme and skin.Layered and modular design gives really high level of flexibility to the system.
  • Magento architecture is based on MVC architectural pattern and initially was started with native MVC implementation of Zend Framework.Later, due to architectural requirements, we end up with own implementation that has very flexible view layer, data storage independent models and Controllers that are very similar to ZF controllers.
  • Module, as a smallest unit of application decomposition, has impact on almost all system layers.Module structure is simple and includes ….For general understanding I would like to stop a little bit on each part of the module.Module configuration defines module version, extendibility points, frontend and backend customizations and many other things.Module blocks are regular PHP classes that describes the interface to module domain data.The domain itself is implemented in module modelsControllers are part of the Front Controller pattern and are used as module requests entry points.Also module can have database schema installation and upgrade scripts.
  • Presentation layer, that corresponds to View in MVC pattern, is most customizable.Magento structures it in following hierarchyDesign Interfaces that are used as themes fallback containers and contain ThemesEach theme has layout upgrades and templates that allows to change your site HTML code. Fallback mechanism between different themes gives the ability to customize just necessary blocks in needed places.Also Magento has set of skins that are shared across the themes and contain images, CSS and JS files
  • A lot of features are available in Magento but much more are available as extensions on Magento Connect.Magento extension is the package which includes source code of the extension (module or theme files) and instructions for files location.Also extension can include requirements to the Magento version, relations with other extensions, requirements to PHP.In such a way you can use Magento as foundation for your business and add to it any necessary peace (like new payment or shipping method).
  • Rich set of Magento and Magento extensions functionality is not always enough because each business/store is unique and usually requires customizations.Magento is highly customizable and allows to do customizations on all application layers
  • For example on data layer the data schema could be changed with install and upgrade scripts.It gives ability to create new tables or modify existing ones, update your data, support multiple versions.
  • Ability to override model and block classes (that is based on DI pattern) allows customization even on class methods level. Controller actions overrides, together with models and blocks classes flexibility, gives to customization developers almost full control on the system without system code modification.In addition to that Magento has a lot of internal events that allows to bring customizations into specific execution point with custom observers implementation.
  • Theme developers have power of the page layout upgrades.Writing just simple XML instruction allows to move you page blocks to different places, reorder them, add new one or remove existing from the page.Themes fallback mechanism provides ability to customize particular block templates on theme level and in such a way full control over the page HTML code.
  • Magento skins mechanism gives to the frontend developer the control over page look and feel.That allows to change color schemas, introduce custom java script behaviors or localize page images.
  • I hope that as result of this short overview you have overall picture of the magento architecture that shows how flexible and customizable it is.Using Magento gives you a lot of functionality out of the box and provides the access to different customization sources.
  • Also we have a lot of integration and solution partners that have experience in different areas: System integrators, Development firms, Design agencies, hosting providers.You can find the proper one on the Magentocommerce site. Looks as that is it from me and I’m passing the ball to Kevin.His company is Magento Gold Partner since version 1.0 and implemented tons of different customizations for different environments. Some of them he will show to us.
  • “Thanks Dmitryi. Hello everyone, my name is Kevin Eichelberger, the founder and CEO of Magento Gold Partner Blue Acorn. I’m going to now shift focus on the business benefits of this architecture, both to us as a service provider, and also what it means to our clients with their Magento implementation.As Dmitryi demonstrated, Magento is architected in a manner that is extensible, and modular. It’s an architecture that, for us as a Magento service provider, allows for great flexibility in implementation. And most importantly, provides organizations a solution that can grow and adapt with their changing needs.“
  • “But before I get too far into this – let me preface my presentation that while Dima may be a Magento architectural genius – I myself, though having a development background, “
  • “There’s not a single implementation that is exactly like another, and each organization we work with comes to the table with requirements and needs that must be met by their eCommerce solution. From systems integrations, to a unique user experience, or business critical functions, we consider Magento an infrastructure for eCommerce.Let me rephrase that, it’s an infrastructure for Commerce.“
  • “Let us think for a second about how the technology of an eCommerce platform enables it be implemented in a wide variety of scenarios. Why is this so important? One of the many reasons I love the eCommerce industry is how it couples technology and business together so tightly. Technology isn’t an afterthought, it isn’t a marketing tool, or a communication tool, it doesn’t just make the business easier to manage. In eCommerce, technology IS the business – it is at its core – it is mission critical. Now tell me how many businesses that you know of that operate in the same exact way to another. Sure, you may know some that sell the same product, or operate in the same market, and even in seemingly similar fashion with a consistent business model. But each comes equipped with a value proposition, with a differentiator, with a business plan that at some level defines a unique combination of characteristics that defines that business.And because technology is so critical to eCommerce, this platform HAS to meet the definition of that business in order for it to be successful. As developers, you are responsible with delivering a solution to be that business. The technology that drives a successful eCommerce platform must allow developers to support three critical functions:Support specific functional requirementsIntegrate with third party systemsReadily adapt for new technologiesAs developers, you’re not just developing some functionality for the sake of it being there, you are shaping that business.“
  • “So let’s talk about a little about the first technical requirement of an eCommerce platform – the ability to support a variety of functional requirements. On average, the native functionality of Magento might get you about 80% of the way there, and the success of the implementation often comes down to the remaining 20%“
  • “Each client we work with comes to the table with a specific set of goals or functional requirements needed for their business. These can take the shape of enhancing the user-experience, supporting a specific business workflow or process, or extending core functionality to support a unique requirement.So let’s discuss one specific example of such requirements in a real-life scenario…“
  • “Take for example the following requirement for Hello!Lucky.First, some background information - Hello!Lucky is a specialty letterpress printer and design studio and have been creating wedding invitations, greeting cards and personalized stationery since 2003. With offices right here down the street in San Francisco and London, their work for clients such as Anthropologie and Liberty and London, have been featured on the Today Show, InStyle Magazine, Martha Stewart, and more.They launched on Magento years ago, but have recently been working on a series of updates to their site including several new features to improve the user experience. One such requirement is to allow users to customize a product leveraging Adobe Scene7, and allow them the ability to save those designs into their account for sharing, or future purchase. “
  • “Designing an invitation is an intimate process, that typically involves more than one visit to the site and often involves seeking input from your friends and family. The saved designs functionality is designed around the shopping process for these products.The functional requirements of Hello Lucky dictated that users be able to customize or personalize a product on their site, and at any point in the process, be able to save what they have created so far. An individual user can save multiple designs giving them a unique name, along with the ability to change, add, or remove designs from their list – and share that list via email or social media to friends and family. To ensure a seamless user experience, it is important for the customer to be able to accomplish this without leaving the page, through the use of AJAX and modal windows.Based on some of these requirements, we can identify that we’ll need certain components to deliver this - controllers to handle each of the actions, and models to handle the saved design collection and functionality, and views for rendering this information to the user. Which gives us an architecture resembling this: “
  • “As Dima described the MVC architecture - Controllers to route the actions from the user – saving a design, logging in, and sharing the designs all require AJAX based controllers to handle those requests to send to the object model.“
  • “We’ll need two models to support the saved design functionality - to control the data storage of the collection, along with other methods of interacting with the saved design itself. The first model associates the customer with the saved design list, the other represents a collection of customized items in the saved design list“
  • “And of course the accompanying views to render to the user their saved designs in their account, along with the product page enhancements to sign in, name, save, view, and share their customized product“
  • “Looking at this from a code-level architecture standpoint in Magento, the Saved Design functionality breaks down into three Modules An AJAX login module to allow users to login via modal window A Saved design module to provide the saved design functionality defined A Send friend module that allows for social sharing of the saved designAll modules you’ll see consist of a block, helper, model, controllers, configuration, and sql elements where applicable - consistent with the architecture that Dmitryi explained earlier. “
  • “Which ends up like this [demo] screenshotsGo to product pageCustomize the productSave the productLoginName the saved designGo to my account to saved designs, find the designShare it via emailYou can also now add it to your cart directly from here, or you can continue from where you left off“
  • Now aside from specific functional needs, third party integrations are commonplace for eCommerce implementations. As much as we might love Magento – it’s not intended to be the answer for everything. Remember, it’s a framework for commerce. Like any framework, its success lies in the ability to be readily modified, and tied into other platforms.
  • “Most implementations involve an integration with at least one 3rd party system. This integration may involve: ERP / Accounting (SAP, Oracle, MS Dynamics GP, Quickbooks, etc) CRM (, MS Dynamics CRM, etc) email Marketing Services (Mailchimp, Constant Contact, Listrak) third party product marketplaces (eBay, amazon,, etc)With Magento, you’ll find many of these integrations already publicly available as third party extensions. But, you’ll also come across many situations that either these extensions do not exist, or they may not meet the specific requirements of the integration for your client. And in these scenarios, these integrations can be delivered through custom development. “
  • “Let’s look at an example of integrating Magento with an ERP platform. Now, we know there are a wide variety of systems implemented by online retailers, each with their own business rules, data formats, and integration capabilities. Much of this is dependent on the other system you’re integrating with, it’s capabilities, and the resources you’re working with. Magento comes with native Webservice capabilities to handle much of the integration requirements. But let’s look at one scenario that requires a little more.“
  • “One of the most common integration points in these scenarios is the need to pass order information down to an ERP system for order processing. Now keep in mind there are more potential order integration points than this, things like order editing, status updates, etc. in many cases need data to flow back and forth between both systems. But for the purpose of this example, we’ll focus on just this one point of integration.When looking at these integrations, the requirements ultimately break down into a few key components:- Defining the data format which includes both structural definition, and data definitions Establishing the medium in which to pass this data from one system to the other – securely of course. Typically you will find this as either a WS to WS integration or a flat file transfer The supporting framework or WebServices to facilitate the handling of the data and the transfers“
  • “For our specific exmple, we’ll look at an ERP integration with the following requirements:“
  • “So, to develop this integration, we need to create a Magento module with the following components: Blocks to control modifications or additions to Magento’s admin Helper classes to define labels and translations Models to define the integration capabilities Controllers to route the URL requests in the admin Configuration files to tie the module into Magento SQL scripts to manage changes to the database tables“
  • “The end result is an order integration that when an order is successfully placed in Magento – it is automatically transferred to the backoffice systemNow we’ve talked about how Magento’s infrastructure supports specific functional requirements in the case of Hello Lucky, it’s ability to integrate with third party systems through it’s native webservices or custom modules, so let’s talk about how important it is for the eCommerce infrastructure to readily adapt for new technologies.“
  • “Most of us are aware of the changing face of eCommerce, where transactions are happening in multiple channels, in different places, and with different technology. By removing the roadblocks that so many retailers face with their eCommerce platform, Magento has appropriately positioned itself in a marketplace that is ever evolving and rapidly changing.As an infrastructure for Commerce, Magento allows retailers to readily adapt to these technologies and reach their customers, wherever they may be.“
  • “That’s great to hear, but what does that really mean?We’re all here to learn how technology can help solve challenges. My company for example, Blue Acorn, is here to help our clients solve their challenges by applying best of breed service with best of breed software. And the technology put together by eBay and the X.Commerce team is going to change the way many of us approach those challenges. But that’s around the corner – what Magento offers us today, is a tool that can be leveraged to grow eCommerce. Many of you here may be new to Magento, and many of you probably know it pretty well. But who here can tell me what the Magento tagline or positioning statement is?It is the eCommerce platform for growth. And that’s exactly the challenge that we’re all here to provide to our clients or internally in our organizations. We are here to apply these technologies to achieve growth. And where is that growth today? it’s online…. it’s social…. it’s mobile…. it’s in store….[insert statistic]So the technology we need to use to achieve that goal needs to able to support those channels, and it needs to be able to adapt to what’s around the corner.“
  • “We’re all familiar with a little company known as Twitter. Look at how quickly user adoption rose for Twitter in a very short timeframe. We can look at example after example with Facebook, tablets, Groupon, etc, etc. But you see how quickly technology changes, and how quickly adoption increases for those channels. What is not even on the radar today, may be a thriving sales channel tomorrow. Online retailers need to be able to quickly adapt for these changes, to always be in front of the customer. To developers, this means that the requirements of our clients are going to change with innovation, and they are going to request – no – demand – that the system adapt. Magento provides an infrastructure to quickly adapt, and build on to what exists without compromising the rest of the platform. This allows retailers to stay on the platform and support its growth no matter where the technology might take them. At all times, Magento can be the core of Commerce that drives successful businesses.“
  • “By using Magento as an eCommerce framework, we not only benefit from these capabilities, but it’s all done in a manner that is modular, separating core from customization allowing for lower maintenance costs, quality assurance, and future upgradability. This benefits the business resulting in lower maintenance costs, improved quality, and ensures that the platform can be upgraded independently from customizations.“
  • Closing slide“I hope that everyone enjoyed learning more about the Magento Technical Overview - hopefully you can start to imagine how you can harness the power that Magento can bring to the table – not only to you as developers – but also to your clients as retailers.“
  • Magento 101: A technical overview

    1. 1. <?>Linux Apache MySQL PHP
    2. 2. Presentation Layer Module Skin ThemeDomain LayerData LayerLibrary Layer Framework Library
    3. 3. ModelView Controller
    4. 4. Design Interface Theme 1 Theme 2Template Layout Template Layout Skins
    5. 5. ModelView Controllers - Save Design AJAX Controller - AJAX Login for account - Send to a friend AJAX Controller
    6. 6. Models - User Saved Design List - Saved Design collectionView Controller
    7. 7. Model Controller Views - Saved Design Customer Account Area- Multiple lightbox interactive AJAX elements