SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
© 2016 Magento, Inc. Page | 1
2.1 EE Content
Staging Technical
overview
© 2016 Magento, Inc. Page | 2
Software Architect at Magento
Anton Kaplya
© 2016 Magento, Inc. Page | 3
Agenda
• What is Content Staging
• How Content Staging works
• How to work with Content Staging
© 2016 Magento, Inc. Page | 4
Magento Staging
Scheduling data changes for ecommerce
entities
© 2016 Magento, Inc. Page | 5
What is Content Staging
• Scheduling data changes
• Instant Preview
• Automatic changes deployment
© 2016 Magento, Inc. Page | 6
© 2016 Magento, Inc. Page | 7
Magento Content Staging
© 2016 Magento, Inc. Page | 8
Magento Content Staging
© 2016 Magento, Inc. Page | 9
Magento Staging Dashboard
© 2016 Magento, Inc. Page | 10
Magento Content Staging Preview
© 2016 Magento, Inc. Page | 11
Supported Entities
• Products & Categories
• CMS Pages & Blocks
• Cart Price Rules
• Catalog Rule
© 2016 Magento, Inc. Page | 12
How Content Staging works
© 2016 Magento, Inc. Page | 13
MVCC
• Multiversion Concurrency Control
• InnoDB transaction engine is built upon MVCC
• Copy on change
© 2016 Magento, Inc. Page | 14
© 2016 Magento, Inc. Page | 15
MVCC
1 100 150 200
A
50 MAX
A'
A''
B
B'
C
© 2016 Magento, Inc. Page | 16
How MVCC influences Magento
• Entity may have several representations in main table
• Creation time
• Expiration time
© 2016 Magento, Inc. Page | 17
Assumptions & Agreements
• We use UNIX_TIMESTAMP as a pointer for versions
• Default value for creation time is 1
• Default for value expiration time is MAX INT
© 2016 Magento, Inc. Page | 18
Table structure
CREATE TABLE entity_table (
row_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
entity_id UNSIGNED NOT NULL,
created_in BIGINT UNSIGNED NOT NULL,
updated_in BIGINT UNSIGNED NOT NULL,
...
PRIMARY KEY ( row_id),
KEY ix_entity_id ( entity_id),
KEY ix_created_in ( created_in),
KEY ix_updated_in ( updated_in)
) ENGINE=InnoDB;
© 2016 Magento, Inc. Page | 19
Example
SELECT
e.row_id, e.entity_id, e.created_in,
e.updated_in, v.value
FROM catalog_product_entity e
JOIN catalog_product_entity_varchar v
ON v.row_id = e.row_id AND v.attribute_id = 73
WHERE e.entity_id = 1;
© 2016 Magento, Inc. Page | 20
Creation of new entity
+--------+-----------+------------+------------+-----------+
| row_id | entity_id | created_in | updated_in | value |
+--------+-----------+------------+------------+-----------+
| 1 | 1 | 1 | 2147483647 | Green Car |
+--------+-----------+------------+------------+-----------+
© 2016 Magento, Inc. Page | 21
Create a new version for entity
+--------+-----------+------------+------------+-----------+
| row_id | entity_id | created_in | updated_in | value |
+--------+-----------+------------+------------+-----------+
| 1 | 1 | 1 | 1474829340 | Green Car |
| 2 | 1 | 1474829340 | 2147483647 | Blue Car |
+--------+-----------+------------+------------+-----------+
© 2016 Magento, Inc. Page | 22
Create several future versions
+--------+-----------+------------+------------+-----------+
| row_id | entity_id | created_in | updated_in | value |
+--------+-----------+------------+------------+-----------+
| 1 | 1 | 1 | 1474829340 | Green Car |
| 2 | 1 | 1474829340 | 1474988880 | Blue Car |
| 3 | 1 | 1474988880 | 1475161680 | Red Car |
| 4 | 1 | 1475161680 | 2147483647 | Blue Car |
+--------+-----------+------------+------------+-----------+
© 2016 Magento, Inc. Page | 23
How select works
© 2016 Magento, Inc. Page | 24
How select works
WHERE (created_in <= 125 AND updated_in > 125)
+--------+-----------+------------+------------+
| row_id | entity_id | created_in | updated_in |
+--------+-----------+------------+------------+
| 1 | 1 | 1 | 100 |
| 2 | 1 | 100 | 200 |
| 3 | 1 | 200 | 2147483647 |
| 4 | 2 | 1 | 150 |
| 5 | 2 | 150 | 2147483647 |
| 6 | 3 | 1 | 2147483647 |
+--------+-----------+------------+------------+
© 2016 Magento, Inc. Page | 25
How SELECT works (Query)
SELECT e.row_id, e.entity_id,
e.created_in, e.updated_in, v.value
FROM catalog_product_entity e
JOIN catalog_product_entity_varchar v ON v.row_id = e.row_id
AND v.attribute_id = 73
WHERE e.entity_id = 1
AND (e.created_in <= 1474828140
AND updated_in > 1474828140
);
© 2016 Magento, Inc. Page | 26
How SELECT works (Data)
+--------+-----------+------------+------------+-----------+
| row_id | entity_id | created_in | updated_in | value |
+--------+-----------+------------+------------+-----------+
| 1 | 1 | 1 | 1474829340 | Green Car |
+--------+-----------+------------+------------+-----------+
| 2 | 1 | 1474829340 | 2147483647 | Blue Car |
+--------+-----------+------------+------------+-----------+
© 2016 Magento, Inc. Page | 27
How to work with
Content Staging
Short notice for extension developers
© 2016 Magento, Inc. Page | 28
Content Staging & Code Compatibility
• Magento API supports data versioning
• Collection API supports data versioning
• MagentoDbSelect except case with attribute table join;
© 2016 Magento, Inc. Page | 29
How to query values from attribute table
• Do not use direct SQLs
• If you do not have other choice
© 2016 Magento, Inc. Page | 30
Example: how to query attributes from table
$metadata = $pool->getMetadata(ProductInterface::class);
$linkField = $this->metadata->getLinkField();
$connection->select()
->from(['e' => $entityTable], ['e.entity_id']);
->join(
['a' => $attributeTable],
'a.' . $linkField . ' = e.' . $linkField
);
© 2016 Magento, Inc. Page | 31
Summary
• Scheduling data changes
• Instant Preview
• Automatic changes deployment
© 2016 Magento, Inc. Page | 32
Q&A

Contenu connexe

En vedette

MagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagentoMagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagento
Kirill Morozov
 

En vedette (9)

Secure input and output handling - Meet Magento Romania 2016
Secure input and output handling - Meet Magento Romania 2016Secure input and output handling - Meet Magento Romania 2016
Secure input and output handling - Meet Magento Romania 2016
 
MagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagentoMagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagento
 
Using Oro layouts
Using Oro layoutsUsing Oro layouts
Using Oro layouts
 
Magento 2 - hands on MeetMagento Romania 2016
Magento 2 -  hands on MeetMagento Romania 2016Magento 2 -  hands on MeetMagento Romania 2016
Magento 2 - hands on MeetMagento Romania 2016
 
Scalability
ScalabilityScalability
Scalability
 
De Magento 1 Community a Magento 2 Enterprise sin escalas. Meet Magento Argen...
De Magento 1 Community a Magento 2 Enterprise sin escalas. Meet Magento Argen...De Magento 1 Community a Magento 2 Enterprise sin escalas. Meet Magento Argen...
De Magento 1 Community a Magento 2 Enterprise sin escalas. Meet Magento Argen...
 
ORO Meetups - Doctrine Events
ORO Meetups - Doctrine EventsORO Meetups - Doctrine Events
ORO Meetups - Doctrine Events
 
Magento Presentation Layer
Magento Presentation LayerMagento Presentation Layer
Magento Presentation Layer
 
How to Install Magento 2 [Latest Version]
How to Install Magento 2 [Latest Version]How to Install Magento 2 [Latest Version]
How to Install Magento 2 [Latest Version]
 

Similaire à Magento 2.1 ee content staging

Similaire à Magento 2.1 ee content staging (20)

Mage Titans USA 2016 - Igor Melnykov - Staging and Preview
Mage Titans USA 2016 - Igor Melnykov - Staging and Preview Mage Titans USA 2016 - Igor Melnykov - Staging and Preview
Mage Titans USA 2016 - Igor Melnykov - Staging and Preview
 
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum PerformanceEugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
 
Demystifying Multi Source Inventory(MSI) - M2NGP03 (Virtual Meetup)
 Demystifying Multi Source Inventory(MSI) - M2NGP03 (Virtual Meetup) Demystifying Multi Source Inventory(MSI) - M2NGP03 (Virtual Meetup)
Demystifying Multi Source Inventory(MSI) - M2NGP03 (Virtual Meetup)
 
Max Yekaterinenko - Magento 2 & Quality
Max Yekaterinenko - Magento 2 & QualityMax Yekaterinenko - Magento 2 & Quality
Max Yekaterinenko - Magento 2 & Quality
 
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
 
Automated Testing in Magento 2
Automated Testing in Magento 2Automated Testing in Magento 2
Automated Testing in Magento 2
 
Meet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey IvashchenkoMeet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey Ivashchenko
 
Testing in Magento 2
Testing in Magento 2 Testing in Magento 2
Testing in Magento 2
 
Architecture and workflow of Multi-Source Inventory
Architecture and workflow of Multi-Source InventoryArchitecture and workflow of Multi-Source Inventory
Architecture and workflow of Multi-Source Inventory
 
Magento Multi-Source Inventory (MSI)
Magento Multi-Source Inventory (MSI)Magento Multi-Source Inventory (MSI)
Magento Multi-Source Inventory (MSI)
 
Cafeteria Automation System
Cafeteria Automation SystemCafeteria Automation System
Cafeteria Automation System
 
Magento 2 Go-Live Checklist - Ensure a Smooth Site Launch - Massmage USA.pdf
Magento 2 Go-Live Checklist - Ensure a Smooth Site Launch - Massmage USA.pdfMagento 2 Go-Live Checklist - Ensure a Smooth Site Launch - Massmage USA.pdf
Magento 2 Go-Live Checklist - Ensure a Smooth Site Launch - Massmage USA.pdf
 
A-Concise-Guide-to-Magento-Development-Services 1.pdf
A-Concise-Guide-to-Magento-Development-Services 1.pdfA-Concise-Guide-to-Magento-Development-Services 1.pdf
A-Concise-Guide-to-Magento-Development-Services 1.pdf
 
How to implement payment gateway integration for non-credit card on Magento2
How to implement payment gateway integration for non-credit card on Magento2How to implement payment gateway integration for non-credit card on Magento2
How to implement payment gateway integration for non-credit card on Magento2
 
Igor Miniailo - Magento 2 API Design Best Practices
Igor Miniailo - Magento 2 API Design Best PracticesIgor Miniailo - Magento 2 API Design Best Practices
Igor Miniailo - Magento 2 API Design Best Practices
 
IRJET- Website on Restaurant Management System using VUEJS and NODEJS Backend
IRJET- Website on Restaurant Management System using VUEJS and NODEJS BackendIRJET- Website on Restaurant Management System using VUEJS and NODEJS Backend
IRJET- Website on Restaurant Management System using VUEJS and NODEJS Backend
 
Real Time Project
Real Time ProjectReal Time Project
Real Time Project
 
All-In-One Checkout User Manual for Magento by Aitoc
All-In-One Checkout User Manual for Magento by AitocAll-In-One Checkout User Manual for Magento by Aitoc
All-In-One Checkout User Manual for Magento by Aitoc
 
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applications
 
Checkout Customizations in Magento 2 - MageTitansMCR 2017
Checkout Customizations in Magento 2 - MageTitansMCR 2017Checkout Customizations in Magento 2 - MageTitansMCR 2017
Checkout Customizations in Magento 2 - MageTitansMCR 2017
 

Dernier

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Dernier (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 

Magento 2.1 ee content staging

  • 1. © 2016 Magento, Inc. Page | 1 2.1 EE Content Staging Technical overview
  • 2. © 2016 Magento, Inc. Page | 2 Software Architect at Magento Anton Kaplya
  • 3. © 2016 Magento, Inc. Page | 3 Agenda • What is Content Staging • How Content Staging works • How to work with Content Staging
  • 4. © 2016 Magento, Inc. Page | 4 Magento Staging Scheduling data changes for ecommerce entities
  • 5. © 2016 Magento, Inc. Page | 5 What is Content Staging • Scheduling data changes • Instant Preview • Automatic changes deployment
  • 6. © 2016 Magento, Inc. Page | 6
  • 7. © 2016 Magento, Inc. Page | 7 Magento Content Staging
  • 8. © 2016 Magento, Inc. Page | 8 Magento Content Staging
  • 9. © 2016 Magento, Inc. Page | 9 Magento Staging Dashboard
  • 10. © 2016 Magento, Inc. Page | 10 Magento Content Staging Preview
  • 11. © 2016 Magento, Inc. Page | 11 Supported Entities • Products & Categories • CMS Pages & Blocks • Cart Price Rules • Catalog Rule
  • 12. © 2016 Magento, Inc. Page | 12 How Content Staging works
  • 13. © 2016 Magento, Inc. Page | 13 MVCC • Multiversion Concurrency Control • InnoDB transaction engine is built upon MVCC • Copy on change
  • 14. © 2016 Magento, Inc. Page | 14
  • 15. © 2016 Magento, Inc. Page | 15 MVCC 1 100 150 200 A 50 MAX A' A'' B B' C
  • 16. © 2016 Magento, Inc. Page | 16 How MVCC influences Magento • Entity may have several representations in main table • Creation time • Expiration time
  • 17. © 2016 Magento, Inc. Page | 17 Assumptions & Agreements • We use UNIX_TIMESTAMP as a pointer for versions • Default value for creation time is 1 • Default for value expiration time is MAX INT
  • 18. © 2016 Magento, Inc. Page | 18 Table structure CREATE TABLE entity_table ( row_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, entity_id UNSIGNED NOT NULL, created_in BIGINT UNSIGNED NOT NULL, updated_in BIGINT UNSIGNED NOT NULL, ... PRIMARY KEY ( row_id), KEY ix_entity_id ( entity_id), KEY ix_created_in ( created_in), KEY ix_updated_in ( updated_in) ) ENGINE=InnoDB;
  • 19. © 2016 Magento, Inc. Page | 19 Example SELECT e.row_id, e.entity_id, e.created_in, e.updated_in, v.value FROM catalog_product_entity e JOIN catalog_product_entity_varchar v ON v.row_id = e.row_id AND v.attribute_id = 73 WHERE e.entity_id = 1;
  • 20. © 2016 Magento, Inc. Page | 20 Creation of new entity +--------+-----------+------------+------------+-----------+ | row_id | entity_id | created_in | updated_in | value | +--------+-----------+------------+------------+-----------+ | 1 | 1 | 1 | 2147483647 | Green Car | +--------+-----------+------------+------------+-----------+
  • 21. © 2016 Magento, Inc. Page | 21 Create a new version for entity +--------+-----------+------------+------------+-----------+ | row_id | entity_id | created_in | updated_in | value | +--------+-----------+------------+------------+-----------+ | 1 | 1 | 1 | 1474829340 | Green Car | | 2 | 1 | 1474829340 | 2147483647 | Blue Car | +--------+-----------+------------+------------+-----------+
  • 22. © 2016 Magento, Inc. Page | 22 Create several future versions +--------+-----------+------------+------------+-----------+ | row_id | entity_id | created_in | updated_in | value | +--------+-----------+------------+------------+-----------+ | 1 | 1 | 1 | 1474829340 | Green Car | | 2 | 1 | 1474829340 | 1474988880 | Blue Car | | 3 | 1 | 1474988880 | 1475161680 | Red Car | | 4 | 1 | 1475161680 | 2147483647 | Blue Car | +--------+-----------+------------+------------+-----------+
  • 23. © 2016 Magento, Inc. Page | 23 How select works
  • 24. © 2016 Magento, Inc. Page | 24 How select works WHERE (created_in <= 125 AND updated_in > 125) +--------+-----------+------------+------------+ | row_id | entity_id | created_in | updated_in | +--------+-----------+------------+------------+ | 1 | 1 | 1 | 100 | | 2 | 1 | 100 | 200 | | 3 | 1 | 200 | 2147483647 | | 4 | 2 | 1 | 150 | | 5 | 2 | 150 | 2147483647 | | 6 | 3 | 1 | 2147483647 | +--------+-----------+------------+------------+
  • 25. © 2016 Magento, Inc. Page | 25 How SELECT works (Query) SELECT e.row_id, e.entity_id, e.created_in, e.updated_in, v.value FROM catalog_product_entity e JOIN catalog_product_entity_varchar v ON v.row_id = e.row_id AND v.attribute_id = 73 WHERE e.entity_id = 1 AND (e.created_in <= 1474828140 AND updated_in > 1474828140 );
  • 26. © 2016 Magento, Inc. Page | 26 How SELECT works (Data) +--------+-----------+------------+------------+-----------+ | row_id | entity_id | created_in | updated_in | value | +--------+-----------+------------+------------+-----------+ | 1 | 1 | 1 | 1474829340 | Green Car | +--------+-----------+------------+------------+-----------+ | 2 | 1 | 1474829340 | 2147483647 | Blue Car | +--------+-----------+------------+------------+-----------+
  • 27. © 2016 Magento, Inc. Page | 27 How to work with Content Staging Short notice for extension developers
  • 28. © 2016 Magento, Inc. Page | 28 Content Staging & Code Compatibility • Magento API supports data versioning • Collection API supports data versioning • MagentoDbSelect except case with attribute table join;
  • 29. © 2016 Magento, Inc. Page | 29 How to query values from attribute table • Do not use direct SQLs • If you do not have other choice
  • 30. © 2016 Magento, Inc. Page | 30 Example: how to query attributes from table $metadata = $pool->getMetadata(ProductInterface::class); $linkField = $this->metadata->getLinkField(); $connection->select() ->from(['e' => $entityTable], ['e.entity_id']); ->join( ['a' => $attributeTable], 'a.' . $linkField . ' = e.' . $linkField );
  • 31. © 2016 Magento, Inc. Page | 31 Summary • Scheduling data changes • Instant Preview • Automatic changes deployment
  • 32. © 2016 Magento, Inc. Page | 32 Q&A