Entity Attribute Value Database vs. strict Relational Model Ecommerce

前端 未结 10 1622
谎友^
谎友^ 2020-11-22 05:23

It is safe to say that the EAV/CR database model is bad. That said,

Question: What database model, technique, or pattern should be used to deal with \"clas

10条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 06:04

    // At this point, I'd like to take a moment to speak to you about the Magento/Adobe PSD format.
    // Magento/PSD is not a good ecommerce platform/format. Magento/PSD is not even a bad ecommerce platform/format. Calling it such would be an
    // insult to other bad ecommerce platform/formats, such as Zencart or OsCommerce. No, Magento/PSD is an abysmal ecommerce platform/format. Having
    // worked on this code for several weeks now, my hate for Magento/PSD has grown to a raging fire
    // that burns with the fierce passion of a million suns.
    

    http://code.google.com/p/xee/source/browse/trunk/XeePhotoshopLoader.m?spec=svn28&r=11#107

    The internal models are wacky at best, like someone put the schema into a boggle game, sealed that and put it in a paint shacker...

    Real world: I'm working on a midware fulfilment app and here are one the queries to get address information.

    CREATE OR REPLACE VIEW sales_flat_addresses AS
    SELECT sales_order_entity.parent_id AS order_id, 
           sales_order_entity.entity_id, 
           CONCAT(CONCAT(UCASE(MID(sales_order_entity_varchar.value,1,1)),MID(sales_order_entity_varchar.value,2)), "Address") as type, 
           GROUP_CONCAT( 
             CONCAT( eav_attribute.attribute_code," ::::: ", sales_order_entity_varchar.value )
             ORDER BY sales_order_entity_varchar.value DESC
             SEPARATOR '!!!!!' 
           ) as data
      FROM sales_order_entity
           INNER JOIN sales_order_entity_varchar ON sales_order_entity_varchar.entity_id = sales_order_entity.entity_id
           INNER JOIN eav_attribute ON eav_attribute.attribute_id = sales_order_entity_varchar.attribute_id
       AND sales_order_entity.entity_type_id =12
     GROUP BY sales_order_entity.entity_id
     ORDER BY eav_attribute.attribute_code = 'address_type'
    

    Exacts address information for an order, lazily

    --

    Summary: Only use Magento if:

    1. You are being given large sacks of money
    2. You must
    3. Enjoy pain

提交回复
热议问题