Maksym Iaroshenko Co-Founder and Senior Software Engineer at Eltrino. Magento non-mysql implementations



Similar documents
IS6030 Data Management Fall Semester 2015

Introducing Microsoft SQL Server 2012 Getting Started with SQL Server Management Studio

DBMS / Business Intelligence, SQL Server

Querying Microsoft SQL Server 2012

Course 10774A: Querying Microsoft SQL Server 2012

Course 10774A: Querying Microsoft SQL Server 2012 Length: 5 Days Published: May 25, 2012 Language(s): English Audience(s): IT Professionals

Querying Microsoft SQL Server

MySQL for Beginners Ed 3

Module 1: Getting Started with Databases and Transact-SQL in SQL Server 2008

Writing Queries Using Microsoft SQL Server 2008 Transact-SQL

Building Views and Charts in Requests Introduction to Answers views and charts Creating and editing charts Performing common view tasks

Course ID#: W 35 Hrs. Course Content

Course 20461C: Querying Microsoft SQL Server Duration: 35 hours

Querying Microsoft SQL Server 20461C; 5 days

Connect to MySQL or Microsoft SQL Server using R

Writing Queries Using Microsoft SQL Server 2008 Transact-SQL

ICAB4136B Use structured query language to create database structures and manipulate data

Q&A for Zend Framework Database Access

MOC QUERYING MICROSOFT SQL SERVER

database abstraction layer database abstraction layers in PHP Lukas Smith BackendMedia

Outline. SAS-seminar Proc SQL, the pass-through facility. What is SQL? What is a database? What is Proc SQL? What is SQL and what is a database

How To Use A Microsoft Sql Server 2005

Querying Microsoft SQL Server Course M Day(s) 30:00 Hours

HP OO 10.X - SiteScope Monitoring Templates

5.5 Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall. Figure 5-2

Data Migration from Magento 1 to Magento 2 Including ParadoxLabs Authorize.Net CIM Plugin Last Updated Jan 4, 2016

TIM 50 - Business Information Systems

CounterPoint SQL and Magento ecommerce Interface

Analyzing the Customer Experience. With Q-Flow and SSAS

Introduction to Oracle Business Intelligence Standard Edition One. Mike Donohue Senior Manager, Product Management Oracle Business Intelligence

KonyOne Server Installer - Linux Release Notes

End the Microsoft Access Chaos - Your simplified path to Oracle Application Express

SQL Server for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach

Bussiness Intelligence and Data Warehouse. Tomas Bartos CIS 764, Kansas State University

edoc Document Generation Suite

DBX. SQL database extension for Splunk. Siegfried Puchbauer

Using Databases With LabVIEW

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

Introducing Oracle BI / XML Publisher

Microsoft Services Exceed your business with Microsoft SharePoint Server 2010

Oracle Business Intelligence EE. Prab h akar A lu ri

MOC 20461C: Querying Microsoft SQL Server. Course Overview

SQL Pass-Through and the ODBC Interface

Implementing and Maintaining Microsoft SQL Server 2008 Integration Services

Jet Data Manager 2012 User Guide

Conquer the 5 Most Common Magento Coding Issues to Optimize Your Site for Performance

VBA and Databases (see Chapter 14 )

2.3 - Installing the moveon management module - SQL version

Quick start. A project with SpagoBI 3.x

AV-005: Administering and Implementing a Data Warehouse with SQL Server 2014

CHAPTER 5: BUSINESS ANALYTICS

Saskatoon Business College Corporate Training Centre

Querying Microsoft SQL Server Querying Microsoft SQL Server D. Course 10774A: Course Det ails. Co urse Outline

DBQT - Database Query Tool Manual 1/11. Manual DBQT. Database Query Tool. Document Version: unu.ch

<Insert Picture Here> Extending Hyperion BI with the Oracle BI Server

Querying Microsoft SQL Server 2012

SQL Server Administrator Introduction - 3 Days Objectives

Discovering SQL. Wiley Publishing, Inc. A HANDS-ON GUIDE FOR BEGINNERS. Alex Kriegel WILEY

BUILDING OLAP TOOLS OVER LARGE DATABASES

Kony MobileFabric. Sync Windows Installation Manual - WebSphere. On-Premises. Release 6.5. Document Relevance and Accuracy

Short notes on webpage programming languages

Release: 1. ICADBS601A Build a data warehouse

LearnFromGuru Polish your knowledge

"SQL Database Professional " module PRINTED MANUAL

SQL Server 2012 End-to-End Business Intelligence Workshop

Databases in Engineering / Lab-1 (MS-Access/SQL)

Data Warehousing OLAP

Creating Reports Crystal Clear

Course 6234A: Implementing and Maintaining Microsoft SQL Server 2008 Analysis Services

Supported Platforms and Software Requirements Effective on 7 May HULFT-DataMagic for Windows Ver.2.2.0

An Architectural Review Of Integrating MicroStrategy With SAP BW

Zend Framework Database Access

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to:

Financial Data Access with SQL, Excel & VBA

Data. Data and database. Aniel Nieves-González. Fall 2015

Distributed Database Access in the LHC Computing Grid with CORAL

SQL - QUICK GUIDE. Allows users to access data in relational database management systems.

Building Advanced Data Models with SAP HANA. Werner Steyn Customer Solution Adoption, SAP Labs, LLC.

THE OPEN UNIVERSITY OF TANZANIA FACULTY OF SCIENCE TECHNOLOGY AND ENVIRONMENTAL STUDIES BACHELOR OF SIENCE IN INFORMATION AND COMMUNICATION TECHNOLOGY

SQL Server and MicroStrategy: Functional Overview Including Recommendations for Performance Optimization. MicroStrategy World 2016

CHAPTER 4: BUSINESS ANALYTICS

Introducing the Reimagined Power BI Platform. Jen Underwood, Microsoft

System requirements. Java SE Runtime Environment(JRE) 7 (32bit) Java SE Runtime Environment(JRE) 6 (64bit) Java SE Runtime Environment(JRE) 7 (64bit)

Advanced Object Oriented Database access using PDO. Marcus Börger

Large Data Methods: Keeping it Simple on the Path to Big Data

Creating Pivot Tables and Diagrams with Microsoft Excel, Visio and SQL Server 2008

ORACLE OLAP. Oracle OLAP is embedded in the Oracle Database kernel and runs in the same database process

Querying Databases Using the DB Query and JDBC Query Nodes

IBM Cognos 8 Business Intelligence Analysis Discover the factors driving business performance

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World

agileworkflow Manual 1. agileworkflow 2. The repository 1 of 29 Contents Definition

Open Source Monitoring

2015, André Melancia (Andy.PT) 1

Querying Microsoft SQL Server 2012

Adam Rauch Partner, LabKey Software Extending LabKey Server Part 1: Retrieving and Presenting Data

Geodatabase Programming with SQL

Consolidate by Migrating Your Databases to Oracle Database 11g. Fred Louis Enterprise Architect

Oracle 11g is by far the most robust database software on the market

Turning your Warehouse Data into Business Intelligence: Reporting Trends and Visibility Michael Armanious; Vice President Sales and Marketing Datex,

Transcription:

Maksym Iaroshenko Co-Founder and Senior Software Engineer at Eltrino Magento non-mysql implementations

http://ice.eltrino.com/

MySQL? Magento OOB supports MySQL only Since release of Magento CE 1.6 and Magento EE 1.11 it could potentially work with other RDBMS (e.g. Microsoft SQL Server, Oracle, PostgreSQL) It was announced by Andrey Tserkus (a member of Magento team) back in 2011 at Magento Developers Paradise

Intro Magento experience since 2007 One of former Magento developers Was working on RDBMS implementation into Magento Working on large MSSQL project Starting another Oracle project

Why not MySQL? Security standards SLA Support Corporate policies Technical advantages, potential performance increase because of using other RDBMS features etc

Agenda How DB layer works in Magento? What is the role of resource helpers? How to support new Database? Common problems & solutions Available features in other RDBMS

How DB layer works in Magento Model Resource helper Resource model DB Adapter Database Driver

Responsibilities of DB Adapter Connect to database Perform platform related operations Provide platform related queries Management of nested transactions

Example of interaction Mage_Customer_Model_Address Mage_Customer_Model_Resource_Address Mage_Core_Model_Resource_ Helper_Abstract DB Adapter Database

Example of interaction Class Mage_Core_Model_Resource_Helper_Mssql { extends Mage_Core_Model_Resource_Helper_Abstract... public function groupconcatprepare (Varien_Db_Select $select, $groupconcatdelimiter = ',') {... return $select; //Varien_Db_Select

Example of interaction Class Mage_Customer_Model_Resource_Address extends { public function getname() {... $select = Mage::getResourceHelper('core') ->groupconcatprepare($this->getselect()) $this->_getreadadapter()->fetchrow($select);...

The role of resource helpers Not all differences between databases can be covered by adapter. Primary role of resource helper is to get the same result of execution for resource models. Example: MySQL SELECT GROUP_CONCAT(field) FROM table Oracle SELECT LISTAGG(field) FROM table

Example of res/helper usage Usage in resource model: $select->where( Mage::getResourceHelper('catalog') ->getisnullnotnullcondition('pis.value','pid.value')); Method of resource helper public function getisnullnotnullcondition($field1, $field2) { return sprintf('%s IS NOT NULL', $this->_getreadadapter() ->getifnullsql($field1, $field2)); }

How to support new Database? Create new adapter which will implements native Magento Db Adapter Interface Define Adapter class in specific resource model & configuration Prefer PDO db libs, because they have a lot common parts with existing adapter

Enabling new DB layer Create a new adapter class Varien_Db_Adapter_Xrdbms Create a new statement class (if needed) Varien_Db_Statement_Xrdbms Create a new resource type DB Mage_Core_Model_Resource_Type_Db_Xrdbms Create a new resource helper Mage_Core_Model_Resource_Helper_Xrdbms

Define Adapter class in app/etc/config.xml <config> <global> <resource> <connection> <types> <pdo_xrdbms> <adapter>varien_db_adapter_pdo_xrdbms</adapter> <class> Mage_Core_Model_Resource_Type_Db_Pdo_xRdbms </class> </pdo_xrdbms> </types> </connection> </resource>...

Connection in app/etc/local.xml <config> <global> <default_setup> <connection> <host><![cdata[192.168.0.1]]></host> <username><![cdata[sa]]></username> <password><![cdata[qwerty]]></password> <dbname><![cdata[dbname]]></dbname> <initstatements><![cdata[]]></initstatements> <model><![cdata[xrdms]]></model> <type><![cdata[pdo_xrdbms]]></type> <pdotype><![cdata[dblib]]></pdotype> <active>1</active> </connection> </default_setup>...

Common problems & solutions Differences in transactions Differences in SQL syntax

Differences in transactions Almost all databases have some differences in transactions logic Before starting developing a new adapter be sure that you understand this differences

Differences in SQL syntax The main problem on the way to support new DB is differences in SQL syntax. All database have a differences in their dialects. Next slides show frequently uses cases:

Aggregation MySQL : SELECT * FROM catalog_product_entity AS entity INNER JOIN catalog_product_index_price AS price ON price.entity_id = entity.entity_id GROUP BY entity.entity_id SQL Server : SELECT entity.entity_id, MAX(entity.sku) AS sku, MAX(price.final_price) AS max_final_price FROM catalog_product_entity AS entity INNER JOIN catalog_product_index_price price ON price.entity_id = entity.entity_id GROUP BY entity.entity_id

GROUP_CONCAT MySQL: SELECT GROUP_CONCAT(value SEPARATOR ' ') AS name FROM customer_entity_varchar WHERE attribute_id in (5,7) GROUP BY entity_id; SQL Server: SELECT stuff((select cast(' ' as varchar(max)) + v.value FROM customer_entity_varchar v WHERE v.entity_id = cev.entity_id AND attribute_id in (5,7) for xml path('')), 1, 1, '') AS name FROM customer_entity_varchar AS cev GROUP BY entity_id;

DATETIME manipulation MySQL: SELECT (TO_DAYS('2012-12-12 00:00:00') - TO_DAYS('2012-12-10 00:00:00')); SQL Server: SELECT DATEDIFF(DAY, '2012-12-10 00:00:00', '2012-12- 12 00:10:00');

LIMIT MySQL: SELECT * FROM customer_entity LIMIT 5,10; SQL Server: SELECT * FROM ( SELECT TOP (5 + 10) *, ROW_NUMBER() OVER ( ORDER BY code) AS rownum FROM customer_entity ) AS t WHERE rownum > 5

Available features in other RDBMS Analytic functions (Anywhere but not in MySQL) Materialized view (Oracle, DB-2) OLAP functions (PIVOT, UNPIVOT)

Analytic functions Analytic functions compute an aggregate value based on a group of rows. They differ from aggregate functions in the way that they return multiple rows for each group Can be used for Reports, Indexers, anywhere where we need compute statistic

Materialized view A materialized view is a database object that contains the results of a query. It may be join result, or summary based on aggregations of a table's data Can be used for Reports, Indexers, anywhere where we need get calculated data by one click.

PIVOT You can use the PIVOT and UNPIVOT relational operators to change a table valued expression into another table. Can be used for EAV based reports.

Reference http://www.magentocommerce.com/blog /comments/creating-adapters-for-rbdms/

Q&A maksym@eltrino.com