Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Data Consistency 
Admin Panel vs Migration scripts
About me 
✓ 8 years of web 
development 
✓ 4 years of magento 
development 
✓ CTO in Speroteck 
company
Context 
✓ Web development 
✓ Magento 
✓ Team development (6m+) 
✓ Quality (automation) 
✓ Project (Not Product) developme...
What is “Application”? 
It’s a Code which receives Input Data, 
produces Output Result and executed on 
particular Environ...
Development (Team) Problems 
Code Consistency - GIT 
Environment Consistency - Vagrant 
Data Consistency - ?
What is Data Consistency? 
Physical meaning. Process of keeping 
information uniform as it moves across a 
network and bet...
Data and application context. 
Significant data. 
✓ Configuration data 
✓ Application data 
✓ Input data
What’s the problem? 
1. How to store and share data changes 
between developers? 
2. How to migrate data changes between 
...
Use Case #1 
Given: I am as a Manager of music store 
should see 20 websites of the Artists I work with 
and each Artist s...
Use Case #2 
Given: I am as a Manager of music store 
When: I go to website of Artist A 
Then: I should see branded design...
Use Case #3 
Given: I am as a Customer of music store 
When: I am on the Product B Page of Artist A website 
Then: I shoul...
Imagine this store 
1. We will use Magento Enterprise 
2. Create 20 websites + 4 store views for 
each website 
3. Create ...
Reality strikes back 
✓ We work in a Team 
✓ Data changes happens very frequent 
✓ Client wants to see the results 
✓ QA n...
Back to problems 
How to Store and Share 
data changes between 
developers?
Ways to share data changes 
✓ Share database 
✓ $ mysqldump 
✓ Migration scripts
Brutal Bad guys use Shared Database
Bad guys use $ mysqldump
$ mysqldump 
− Easy to use 
− Cheap changes 
+ Manual work 
+ Hard to track 
changes
$ mysqldump workflow 
1. Download recent database 
2. Make data changes 
3. Upload database and mark it as recent
Who use Migration scripts? 
+ Consistent data 
+ Easy to track 
changes 
− Hard to use 
− Conflicts between 
versions* 
− ...
The holy grail of the development 
Deploy application on local environment 
with 1 click, make changes and push them 
to t...
Development Center 
Development Center - infrastructure which 
receives changes as an input and produce 
stable applicatio...
Build. Gather Together. 
1. Prepare Environment 
2. Prepare Code 
3. Load Data 
4. Configure Application 
5. Verify Functi...
Best practices of migrations usage 
1. Create Global package 
2. Use to configure store 
3. Use “data” and “sql” folders r...
Global package 
✓ Configure store 
✓ Add application data 
✓ Small code changes, 
patches etc. 
✓ Global elements and 
par...
Use to configure store 
Use possibility to configure 
store with the help of install 
scripts. Once it will save 
your ass...
Use “data” and “sql” folders right 
“Data” folder is used to add 
content data changes and 
configuration changes 
“Sql” f...
Use “data” and “sql” folders right 
Move to Setup scripts as much 
as possible.
Write own API to export/import data 
✓ Don’t afraid to write 
something like “Email 
templates importer” 
✓ Use Magento AP...
Use database profiler to verify data
Be ready to throw migrations away
The End 
Questions? 
vovikha@gmail.com
Upcoming SlideShare
Loading in …5
×

Владимир Дубина - Meet Magento Ukraine - Data consistency

429 views

Published on

Владимир Дубина - Meet Magento Ukraine - Data consistency

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Владимир Дубина - Meet Magento Ukraine - Data consistency

  1. 1. Data Consistency Admin Panel vs Migration scripts
  2. 2. About me ✓ 8 years of web development ✓ 4 years of magento development ✓ CTO in Speroteck company
  3. 3. Context ✓ Web development ✓ Magento ✓ Team development (6m+) ✓ Quality (automation) ✓ Project (Not Product) development ✓ Enterprise level in terms of complexity
  4. 4. What is “Application”? It’s a Code which receives Input Data, produces Output Result and executed on particular Environment.
  5. 5. Development (Team) Problems Code Consistency - GIT Environment Consistency - Vagrant Data Consistency - ?
  6. 6. What is Data Consistency? Physical meaning. Process of keeping information uniform as it moves across a network and between various applications. Semantic meaning. Process of keeping information expected as it moves inside of the application.
  7. 7. Data and application context. Significant data. ✓ Configuration data ✓ Application data ✓ Input data
  8. 8. What’s the problem? 1. How to store and share data changes between developers? 2. How to migrate data changes between application instances? 3. How to bind Code Revision and Application Data?
  9. 9. Use Case #1 Given: I am as a Manager of music store should see 20 websites of the Artists I work with and each Artist should have 4 supported languages and Catalogs should be different for each Artist When: I go to Admin Panel Then: I should be able to manage them
  10. 10. Use Case #2 Given: I am as a Manager of music store When: I go to website of Artist A Then: I should see branded design and see custom pages “Home”, “About Artist”, “Concerts”, “Recent Hits”, “Contacts” and see branded banner in the Header and see social links of Artist A
  11. 11. Use Case #3 Given: I am as a Customer of music store When: I am on the Product B Page of Artist A website Then: I should be able to listen samples and buy artist’s sign on the box and choose free present and choose color of the T-shirt and customize logo on the tea-cup and see special promotions
  12. 12. Imagine this store 1. We will use Magento Enterprise 2. Create 20 websites + 4 store views for each website 3. Create 20 root categories and assign each for own website 4. Add “complex” Product B to Artist A 5. Set branded design
  13. 13. Reality strikes back ✓ We work in a Team ✓ Data changes happens very frequent ✓ Client wants to see the results ✓ QA needs stable data to write tests ✓ . . .
  14. 14. Back to problems How to Store and Share data changes between developers?
  15. 15. Ways to share data changes ✓ Share database ✓ $ mysqldump ✓ Migration scripts
  16. 16. Brutal Bad guys use Shared Database
  17. 17. Bad guys use $ mysqldump
  18. 18. $ mysqldump − Easy to use − Cheap changes + Manual work + Hard to track changes
  19. 19. $ mysqldump workflow 1. Download recent database 2. Make data changes 3. Upload database and mark it as recent
  20. 20. Who use Migration scripts? + Consistent data + Easy to track changes − Hard to use − Conflicts between versions* − No uninstall scripts* − No API for complex data*
  21. 21. The holy grail of the development Deploy application on local environment with 1 click, make changes and push them to the Development Center
  22. 22. Development Center Development Center - infrastructure which receives changes as an input and produce stable application build as an output
  23. 23. Build. Gather Together. 1. Prepare Environment 2. Prepare Code 3. Load Data 4. Configure Application 5. Verify Functionality 6. Generate Artifacts
  24. 24. Best practices of migrations usage 1. Create Global package 2. Use to configure store 3. Use “data” and “sql” folders right 4. Write own API to export/import data 5. Use database profiler to verify data 6. Be ready to stop usage of migrations
  25. 25. Global package ✓ Configure store ✓ Add application data ✓ Small code changes, patches etc. ✓ Global elements and parts Example “social links”
  26. 26. Use to configure store Use possibility to configure store with the help of install scripts. Once it will save your ass.
  27. 27. Use “data” and “sql” folders right “Data” folder is used to add content data changes and configuration changes “Sql” folder is used to add database changes
  28. 28. Use “data” and “sql” folders right Move to Setup scripts as much as possible.
  29. 29. Write own API to export/import data ✓ Don’t afraid to write something like “Email templates importer” ✓ Use Magento API ✓ Don’t afraid raw SQL ✓ Use ready to use solutions. Example Cms Installer
  30. 30. Use database profiler to verify data
  31. 31. Be ready to throw migrations away
  32. 32. The End Questions? vovikha@gmail.com

×