MySQL transactions in Zend framework

Share
Posted on May 13th, 2011 | Posted by admin

Hi! Today I’m going to explain a part of Zend framework DB functionality. Transactions in general are quite useful, like temporary tables, but in most of situations unnecessary. Because of that, I’m going to explain when and how to use them through Zend framework.

What is transaction?

A simple answer would be – a number of individual queries that are grouped together.

An example would be something like this:

1
2
UPDATE balance SET total = total - 100 WHERE account_id=1;
UPDATE balance SET total = total + 100 WHERE account_id=2;

MySQL – Left, Right, Outer or Inner Join? No – the SELF JOIN

Share
Posted on April 27th, 2011 | Posted by admin

Hi to all of you! Today, I’m going to explain SELF JOIN in MySQL – I’ll answer why and then how should you use it.

But first, a short explanation. I’m going to explain a non often used SQL that came in hand recently. If you are still learning MySQL, please refer to some basics first – a good start. And now, to the fun part. :D

Why do anyone need SELF JOIN?

Well, SQL self-join is very useful when you want to retrieve related data stored in one table such as organizational structure. Its basically an inner join with reference on the table itself.

Usage of temporary tables in MySQL databases

Share
Posted on April 25th, 2011 | Posted by admin

Hi! My recent project had some specific requirements regarding the work with database. Since DB server had some limitations (regarding number of queries), and fairly big number of queries that needed to be executed I created a solution that included temp tables. And now, I’d like to explain how to use them and why.

Suppose that in your application, you need to execute a calculation on a set of tables. The usual approach is to create a query that defines the joins between multiple tables, and selects the data from the joined tables. The problem with that approach is that every time you call that the query, the tables have to be rejoined in order to create the result. And that is usually fairly resource hungry. Instead, you can get around the problem by putting the results into temporary table, so the values are there while the database connection lasts.

Magento MySQL database diagram

Share
Posted on February 24th, 2011 | Posted by admin
Magento MySQL database diagram

If you worked with osCommerce, Zen Cart, CRE Loaded or any similar eCommerce platform before, you might find Magento database structure quite confusing when you see it for the first time. I advise you not to rush too much figuring out what is what by glancing through database. Try to spend first few hours getting familiar with some background. For purposes of flexibility, the Magento database heavily utilizes an Entity-Attribute-Value (EAV) data model. As is often the case, the cost of flexibility is complexity. Is there something in Magento that is simple from developers point of view?

Magento MySQL database diagram

Share
Posted on February 22nd, 2011 | Posted by admin

If you worked with osCommerce, Zen Cart, CRE Loaded or any similar eCommerce platform before, you might find Magento database structure quite confusing when you see it for the first time. I advise you not to rush too much figuring out what is what by glancing through database. Try to spend first few hours getting familiar with some background. For purposes of flexibility, the Magento database heavily utilizes an Entity-Attribute-Value (EAV) data model. As is often the case, the cost of flexibility is complexity. Is there something in Magento that is simple from developers point of view?

Page 1 of 212»