SlideShare une entreprise Scribd logo
1  sur  36
Evolutionary Database Development
Software Development Process is Changing © ThoughtWorks 2009 Fix / Integrate $ Test Code Design Specifications Use Cases /  Functional Specs Requirements Gathering Project Plan/Estimation $ $ $ $ Level Stories Vision & High- Iteration Release
 
Team Collaboration DB Apps BackEnd Traditional Team In Agile team, DBA  ,[object Object],[object Object],[object Object],DEVS I’m responsible for Web design  DBA I’m responsible for Database Domain expert I’m responsible for backend apps DBA Our responsible for business value Our responsible for business value It’s our responsibility DEVS Domain  Expert Agile Team
[object Object],[object Object],[object Object],[object Object],Best Practices
Refactoring “ A disciplined way to make change to your source code to improve its design, making it easier to work with” Martin Folwer
Database Refactoring Before: After: Behavioral  semantics   ,[object Object],A small change to Database schema that improves its design while retaining both its  behavioral  and  informational  semantics ,[object Object],[object Object],Informational  semantics   Customer … Balance Account AccountID(PK) Customer … Account AccountID(PK) Balance
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],What will be changed in DB Refactoring? ,[object Object],[object Object],[object Object],Principles
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Test-Driven is also important for DB design TEST Fail Fast Fail Often
[object Object],[object Object],[object Object],[object Object],Evolutionary Modeling Design
A Story
Background ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Refactoring database schema Introduce transition period for SAFTY
Never get rid of old schema immediately Data sync in real time
What we did in this project Legacy DB NEW DB FlatFile Triger SystemNameID Newvalue OldValue columnName Read Data Near real Time Read Data systemName SystemNameID(PK) SystemLogin … systemName_log SystemNameID(PK) OperDatetime Account AccountID(PK) AccountName SystemNameID Isdelete
Onetime Migration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Person Organisation Person User contact
  The process of database refactoring
[object Object],1.One user Should not have 2 office telephone Select user From user a left join telephone b On a.userid=b.userid Group by a.user Having count(*)>=2 2. A telephone should be assigned to a user Select telephone From telephone  Where userid is null 3. A telehpone shoulde not be assigned to 2 or more user Select officeTele From telephone a left join user Group by officeTele Having count(userid)>=2 …  adding more verification sql User UserID(PK) FirstName LastName … Telephone TeleID(PK) OfficeTele HomeTele UserID(FK)
Sanity Check ,[object Object],[object Object],Don’t make an issue to happen for two times
Put test scripts into CI Put verification scripts into CI  Run verification scripts in production often, be aware of production data
Our workflow Production App Pre-Production App Highly iterative Development System and Acceptance Testing Operations and support Devs’ App DB App Bug Reports Bug Reports Bug Reports Project-level Integration Testing Frequent Deployment Frequent Deployment Highly Controled Deployment CVS ,[object Object],[object Object],Brainstorming Production Users QA Devs Devs
The strategy for migration performance ,[object Object],Migration Update contactNote a Set ContactNote=c1,ContactId=c2 From ContactInfo  where a.messid=b.Messid Too long  ContactInfo Messid(pk) C1 C2 … ContactNote ContactNoteId(pk) ContactNote ContactId MessId
Delcare row_num number:=0; Begin  for c_CN in (select MessId,C1,C2 from contactInfo a left join CI_Mig_log b on a.Messid=b.messid where flag=0) update contactNote set contactNote=c_CN.c1, contactId=c_CN.c2 where Messid=c_CN.Messid update CI_MIG_log f set f.flag=1 where messid=c_Cn.MessId row_num:=row_num+1; if mod(row_num,1000)=0 then commit; end if; End loop; Cancel it if there is no enough resource for migration Migration ContactInfo Messid(pk) C1 C2 … ContactNote ContactNoteId(pk) ContactNote ContactId MessId CI_Mig_log MessID(PK) Flag
Versioning Database ,[object Object],[object Object],Change Date 1_Create_Customer_Table.sql 4-15-07 2_Add_e-mail_address_column.sql 4-17-07 3_Add_fax_number_column.sql 4-18-07 4_Add_transaction_table.sql 4-21-07 5_Add_transaction_status_column.sql 4-24-07 6_Add_customer-transaction_view.sql 4-27-07
Put them under configuration management control CREATE TABLE money ( eek NUMBER ); //Test for… DB DDL Insert into AA(mydata) Values(11); Meta Data Delete from .. DML Create index optimization Merge into Data Migration Tests Installation scripts
Configuration of DB project Database project under version control  Tiny db backup Deltascripts of dbdeploy For defining db objects which depends on schema For data onetime migration For data sync For checking dirty data Tool exclusively for database project other scripts…
Database Deployment An automated process  is needed to make the process of upgrading out-of-date databases
Our Practices ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Management DB deploymnet DB Deploy -  http://dbdeploy.com/
DBDeploy http://dbdeploy.com/documentation/getting-started/rules-for-using-dbdeploy/   ,[object Object],[object Object],[object Object],[object Object],[object Object],CREATE TABLE FOO (  FOO_ID INTEGER NOT NULL,   FOO_VALUE VARCHAR(30) );  ALTER TABLE FOO ADD CONSTRAINT PK_FOO PRIMARY KEY (FOO_ID); --//@UNDO  DROP TABLE FOO;
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Ant
DBDeploy ,[object Object],[object Object],[object Object],[object Object],Output: gen-and-exec-delta-script: [dbdeploy] dbdeploy v2.11 [dbdeploy] Reading change scripts from directory C:rojectsbdeploy-demoqleltas... [dbdeploy] Changes currently applied to database: [dbdeploy] 1, 2 [dbdeploy] Scripts available: [dbdeploy] 1, 2, 3, 4 [dbdeploy] To be applied: [dbdeploy] 3, 4 [sql] Executing file: C:rojectsbdeploy-demouild_outputb-deltas.sql [sql] 8 of 8 SQL statements executed successfully
Automate Tasks  ,[object Object],[object Object],<target name= “-parseDbScxripts” >…</target> … <target name=&quot;-upgradeDB&quot; depends=&quot;-parseDbScripts, -dbdeploy,  -runDeltaScript, -dropDbLogic, -createDbLogic&quot;  description=&quot;Upgrade specified database to latest version&quot; /> <target name=&quot;rebuildDB&quot; depends=&quot; -parseDbScripts, -dropDb,  -createDb, -initialiseDb, -dbdeploy, -runDeltaScript, -createDbLogic&quot;  description=&quot;drop, recreate and initialise the Connect database&quot; />
Batch file: libraryantant.exe –buildfile:evovle.build –D:rebuildDB -logfile:build.txt Shared to devs Do what we want by just One Command
[object Object],[object Object],[object Object],[object Object]
Q&A

Contenu connexe

Tendances

Informatica 5+years of experince
Informatica 5+years of experinceInformatica 5+years of experince
Informatica 5+years of experinceDharma Rao
 
EMC Documenutm xCP 2.2 vs 1.x
EMC Documenutm xCP 2.2 vs 1.xEMC Documenutm xCP 2.2 vs 1.x
EMC Documenutm xCP 2.2 vs 1.xHaytham Ghandour
 
Open ERP Version 7 Functional & Technical Overview
Open ERP Version 7 Functional & Technical OverviewOpen ERP Version 7 Functional & Technical Overview
Open ERP Version 7 Functional & Technical OverviewPragmatic Techsoft
 
EMC Documentum - xCP 2.x Updating Java Services
EMC Documentum - xCP 2.x Updating Java ServicesEMC Documentum - xCP 2.x Updating Java Services
EMC Documentum - xCP 2.x Updating Java ServicesHaytham Ghandour
 
Workflow functional concept on openerp7
Workflow functional concept on openerp7Workflow functional concept on openerp7
Workflow functional concept on openerp7Aziza Mohamed
 
EMC Documentum - xCP 2.x Installation and Deployment
EMC Documentum - xCP 2.x Installation and DeploymentEMC Documentum - xCP 2.x Installation and Deployment
EMC Documentum - xCP 2.x Installation and DeploymentHaytham Ghandour
 
Sap ps module tutorial
Sap ps module tutorialSap ps module tutorial
Sap ps module tutorialachyuth10
 
Swarn Singh_CV_SSE
Swarn Singh_CV_SSESwarn Singh_CV_SSE
Swarn Singh_CV_SSESwarn Singh
 

Tendances (14)

Informatica 5+years of experince
Informatica 5+years of experinceInformatica 5+years of experince
Informatica 5+years of experince
 
EMC Documenutm xCP 2.2 vs 1.x
EMC Documenutm xCP 2.2 vs 1.xEMC Documenutm xCP 2.2 vs 1.x
EMC Documenutm xCP 2.2 vs 1.x
 
Open ERP Version 7 Functional & Technical Overview
Open ERP Version 7 Functional & Technical OverviewOpen ERP Version 7 Functional & Technical Overview
Open ERP Version 7 Functional & Technical Overview
 
EMC Documentum - xCP 2.x Updating Java Services
EMC Documentum - xCP 2.x Updating Java ServicesEMC Documentum - xCP 2.x Updating Java Services
EMC Documentum - xCP 2.x Updating Java Services
 
Bapi jco[1]
Bapi jco[1]Bapi jco[1]
Bapi jco[1]
 
Chapter09
Chapter09Chapter09
Chapter09
 
Workflow functional concept on openerp7
Workflow functional concept on openerp7Workflow functional concept on openerp7
Workflow functional concept on openerp7
 
EMC Documentum - xCP 2.x Installation and Deployment
EMC Documentum - xCP 2.x Installation and DeploymentEMC Documentum - xCP 2.x Installation and Deployment
EMC Documentum - xCP 2.x Installation and Deployment
 
Sap ps module tutorial
Sap ps module tutorialSap ps module tutorial
Sap ps module tutorial
 
Swarn Singh_CV_SSE
Swarn Singh_CV_SSESwarn Singh_CV_SSE
Swarn Singh_CV_SSE
 
Foundations of programming
Foundations of programmingFoundations of programming
Foundations of programming
 
New Enhancements + Upgrade Path to Oracle EBS R12.1.3
New Enhancements + Upgrade Path to Oracle EBS R12.1.3New Enhancements + Upgrade Path to Oracle EBS R12.1.3
New Enhancements + Upgrade Path to Oracle EBS R12.1.3
 
Advanced Visualforce Webinar
Advanced Visualforce WebinarAdvanced Visualforce Webinar
Advanced Visualforce Webinar
 
Pratk kambe rac
Pratk kambe racPratk kambe rac
Pratk kambe rac
 

En vedette

Liberty Grant.Collection
Liberty Grant.CollectionLiberty Grant.Collection
Liberty Grant.CollectionLiberty Grant
 
Улучшение бизнес-процессов
Улучшение бизнес-процессовУлучшение бизнес-процессов
Улучшение бизнес-процессовLiberty Grant
 
西藏10日游
西藏10日游西藏10日游
西藏10日游Open Party
 
Презентация лучше, чем документ
Презентация лучше, чем документПрезентация лучше, чем документ
Презентация лучше, чем документLiberty Grant
 
Как защитить IT-бюджеты перед бизнесом
Как защитить IT-бюджеты перед бизнесомКак защитить IT-бюджеты перед бизнесом
Как защитить IT-бюджеты перед бизнесомLiberty Grant
 
Liberty Grant Frameworks
Liberty Grant FrameworksLiberty Grant Frameworks
Liberty Grant FrameworksLiberty Grant
 
О компании Liberty Grant
О компании Liberty GrantО компании Liberty Grant
О компании Liberty GrantLiberty Grant
 
Liberty grant.Tariffbenchmarking
Liberty grant.TariffbenchmarkingLiberty grant.Tariffbenchmarking
Liberty grant.TariffbenchmarkingLiberty Grant
 
Дэшборд для мониторинга платежей
Дэшборд для мониторинга платежейДэшборд для мониторинга платежей
Дэшборд для мониторинга платежейLiberty Grant
 
夸父通讯中间件
夸父通讯中间件夸父通讯中间件
夸父通讯中间件Open Party
 
淘宝广告技术部开发流程和Scrum实践
淘宝广告技术部开发流程和Scrum实践淘宝广告技术部开发流程和Scrum实践
淘宝广告技术部开发流程和Scrum实践Open Party
 
Hs java open_party
Hs java open_partyHs java open_party
Hs java open_partyOpen Party
 
Система онлайн-мониторинга Liberty Grant
Система онлайн-мониторинга Liberty GrantСистема онлайн-мониторинга Liberty Grant
Система онлайн-мониторинга Liberty GrantLiberty Grant
 
LibertyGrant.InetMobileBanking
LibertyGrant.InetMobileBankingLibertyGrant.InetMobileBanking
LibertyGrant.InetMobileBankingLiberty Grant
 
Мониторинг розничной сети банка
Мониторинг розничной сети банкаМониторинг розничной сети банка
Мониторинг розничной сети банкаLiberty Grant
 
Liberty grant.Paymentsoptimization
Liberty grant.PaymentsoptimizationLiberty grant.Paymentsoptimization
Liberty grant.PaymentsoptimizationLiberty Grant
 

En vedette (18)

Liberty Grant.Collection
Liberty Grant.CollectionLiberty Grant.Collection
Liberty Grant.Collection
 
Улучшение бизнес-процессов
Улучшение бизнес-процессовУлучшение бизнес-процессов
Улучшение бизнес-процессов
 
西藏10日游
西藏10日游西藏10日游
西藏10日游
 
Презентация лучше, чем документ
Презентация лучше, чем документПрезентация лучше, чем документ
Презентация лучше, чем документ
 
Как защитить IT-бюджеты перед бизнесом
Как защитить IT-бюджеты перед бизнесомКак защитить IT-бюджеты перед бизнесом
Как защитить IT-бюджеты перед бизнесом
 
Liberty Grant Frameworks
Liberty Grant FrameworksLiberty Grant Frameworks
Liberty Grant Frameworks
 
О компании Liberty Grant
О компании Liberty GrantО компании Liberty Grant
О компании Liberty Grant
 
Liberty grant.Tariffbenchmarking
Liberty grant.TariffbenchmarkingLiberty grant.Tariffbenchmarking
Liberty grant.Tariffbenchmarking
 
Очереди
ОчередиОчереди
Очереди
 
Дэшборд для мониторинга платежей
Дэшборд для мониторинга платежейДэшборд для мониторинга платежей
Дэшборд для мониторинга платежей
 
Revista dh-unjfsc
Revista dh-unjfscRevista dh-unjfsc
Revista dh-unjfsc
 
夸父通讯中间件
夸父通讯中间件夸父通讯中间件
夸父通讯中间件
 
淘宝广告技术部开发流程和Scrum实践
淘宝广告技术部开发流程和Scrum实践淘宝广告技术部开发流程和Scrum实践
淘宝广告技术部开发流程和Scrum实践
 
Hs java open_party
Hs java open_partyHs java open_party
Hs java open_party
 
Система онлайн-мониторинга Liberty Grant
Система онлайн-мониторинга Liberty GrantСистема онлайн-мониторинга Liberty Grant
Система онлайн-мониторинга Liberty Grant
 
LibertyGrant.InetMobileBanking
LibertyGrant.InetMobileBankingLibertyGrant.InetMobileBanking
LibertyGrant.InetMobileBanking
 
Мониторинг розничной сети банка
Мониторинг розничной сети банкаМониторинг розничной сети банка
Мониторинг розничной сети банка
 
Liberty grant.Paymentsoptimization
Liberty grant.PaymentsoptimizationLiberty grant.Paymentsoptimization
Liberty grant.Paymentsoptimization
 

Similaire à Evolutionary db development

Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsSalesforce Developers
 
Informatica 5+years of experince
Informatica 5+years of experinceInformatica 5+years of experince
Informatica 5+years of experinceDharma Rao
 
Informatica_5+years of experince
Informatica_5+years of experinceInformatica_5+years of experince
Informatica_5+years of experinceDharma Rao
 
Gp Installation Presentation
Gp Installation PresentationGp Installation Presentation
Gp Installation Presentationguest2fc298
 
Gp Installation Presentation
Gp Installation PresentationGp Installation Presentation
Gp Installation Presentationddauphin
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicDavid Solivan
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan
 
Soprex framework on .net in action
Soprex framework on .net in actionSoprex framework on .net in action
Soprex framework on .net in actionMilan Vukoje
 
Prodev Solutions Intro
Prodev Solutions IntroProdev Solutions Intro
Prodev Solutions IntrolarryATprodev
 
Expanding your impact with programmability in the data center
Expanding your impact with programmability in the data centerExpanding your impact with programmability in the data center
Expanding your impact with programmability in the data centerCisco Canada
 
DQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltdDQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltdDigendra Vir Singh (DV)
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availabilityPeter Gfader
 
Crm saturday madrid 2017 3 mosqueteros demian-marco-mario
Crm saturday madrid 2017   3  mosqueteros demian-marco-marioCrm saturday madrid 2017   3  mosqueteros demian-marco-mario
Crm saturday madrid 2017 3 mosqueteros demian-marco-marioDemian Raschkovan
 
Sujit lead plsql
Sujit lead plsqlSujit lead plsql
Sujit lead plsqlSujit Jha
 
Why NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB AtlasWhy NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB AtlasDatavail
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBUniFabric
 

Similaire à Evolutionary db development (20)

Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
 
Informatica 5+years of experince
Informatica 5+years of experinceInformatica 5+years of experince
Informatica 5+years of experince
 
Informatica_5+years of experince
Informatica_5+years of experinceInformatica_5+years of experince
Informatica_5+years of experince
 
Gp Installation Presentation
Gp Installation PresentationGp Installation Presentation
Gp Installation Presentation
 
Gp Installation Presentation
Gp Installation PresentationGp Installation Presentation
Gp Installation Presentation
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs Public
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
 
Soprex framework on .net in action
Soprex framework on .net in actionSoprex framework on .net in action
Soprex framework on .net in action
 
Prodev Solutions Intro
Prodev Solutions IntroProdev Solutions Intro
Prodev Solutions Intro
 
Expanding your impact with programmability in the data center
Expanding your impact with programmability in the data centerExpanding your impact with programmability in the data center
Expanding your impact with programmability in the data center
 
Isset Presentation @ EECI2009
Isset Presentation @ EECI2009Isset Presentation @ EECI2009
Isset Presentation @ EECI2009
 
DQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltdDQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltd
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 
CV Chandrajit Samanta
CV Chandrajit SamantaCV Chandrajit Samanta
CV Chandrajit Samanta
 
Crm saturday madrid 2017 3 mosqueteros demian-marco-mario
Crm saturday madrid 2017   3  mosqueteros demian-marco-marioCrm saturday madrid 2017   3  mosqueteros demian-marco-mario
Crm saturday madrid 2017 3 mosqueteros demian-marco-mario
 
Sujit lead plsql
Sujit lead plsqlSujit lead plsql
Sujit lead plsql
 
Why NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB AtlasWhy NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB Atlas
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DB
 
Mstr meetup
Mstr meetupMstr meetup
Mstr meetup
 
Resume
ResumeResume
Resume
 

Plus de Open Party

Sunshine library introduction
Sunshine library introductionSunshine library introduction
Sunshine library introductionOpen Party
 
食品安全与生态农业──小毛驴市民农园项目介绍
食品安全与生态农业──小毛驴市民农园项目介绍食品安全与生态农业──小毛驴市民农园项目介绍
食品安全与生态农业──小毛驴市民农园项目介绍Open Party
 
网站优化实践
网站优化实践网站优化实践
网站优化实践Open Party
 
Introduction to scientific visualization
Introduction to scientific visualizationIntroduction to scientific visualization
Introduction to scientific visualizationOpen Party
 
Applying BDD in refactoring
Applying BDD in refactoringApplying BDD in refactoring
Applying BDD in refactoringOpen Party
 
移动广告不是网盟
移动广告不是网盟移动广告不是网盟
移动广告不是网盟Open Party
 
Android 开源社区,10年后的再思考
Android 开源社区,10年后的再思考Android 开源社区,10年后的再思考
Android 开源社区,10年后的再思考Open Party
 
企业创业融资之路
企业创业融资之路企业创业融资之路
企业创业融资之路Open Party
 
Java mobile 移动应用开发
Java mobile 移动应用开发Java mobile 移动应用开发
Java mobile 移动应用开发Open Party
 
如何做演讲
如何做演讲如何做演讲
如何做演讲Open Party
 
Positive psychology
Positive psychologyPositive psychology
Positive psychologyOpen Party
 
价值驱动的组织转型-王晓明
价值驱动的组织转型-王晓明价值驱动的组织转型-王晓明
价值驱动的组织转型-王晓明Open Party
 
对云计算的理解
对云计算的理解对云计算的理解
对云计算的理解Open Party
 
Web前端标准在各浏览器中的实现差异
Web前端标准在各浏览器中的实现差异Web前端标准在各浏览器中的实现差异
Web前端标准在各浏览器中的实现差异Open Party
 

Plus de Open Party (17)

Sunshine library introduction
Sunshine library introductionSunshine library introduction
Sunshine library introduction
 
食品安全与生态农业──小毛驴市民农园项目介绍
食品安全与生态农业──小毛驴市民农园项目介绍食品安全与生态农业──小毛驴市民农园项目介绍
食品安全与生态农业──小毛驴市民农园项目介绍
 
Cs open-party
Cs open-partyCs open-party
Cs open-party
 
网站优化实践
网站优化实践网站优化实践
网站优化实践
 
Introduction to scientific visualization
Introduction to scientific visualizationIntroduction to scientific visualization
Introduction to scientific visualization
 
Applying BDD in refactoring
Applying BDD in refactoringApplying BDD in refactoring
Applying BDD in refactoring
 
移动广告不是网盟
移动广告不是网盟移动广告不是网盟
移动广告不是网盟
 
Android 开源社区,10年后的再思考
Android 开源社区,10年后的再思考Android 开源社区,10年后的再思考
Android 开源社区,10年后的再思考
 
企业创业融资之路
企业创业融资之路企业创业融资之路
企业创业融资之路
 
Java mobile 移动应用开发
Java mobile 移动应用开发Java mobile 移动应用开发
Java mobile 移动应用开发
 
如何做演讲
如何做演讲如何做演讲
如何做演讲
 
爬虫点滴
爬虫点滴爬虫点滴
爬虫点滴
 
Positive psychology
Positive psychologyPositive psychology
Positive psychology
 
价值驱动的组织转型-王晓明
价值驱动的组织转型-王晓明价值驱动的组织转型-王晓明
价值驱动的组织转型-王晓明
 
对云计算的理解
对云计算的理解对云计算的理解
对云计算的理解
 
Web前端标准在各浏览器中的实现差异
Web前端标准在各浏览器中的实现差异Web前端标准在各浏览器中的实现差异
Web前端标准在各浏览器中的实现差异
 
Douban pulse
Douban pulseDouban pulse
Douban pulse
 

Evolutionary db development

  • 2. Software Development Process is Changing © ThoughtWorks 2009 Fix / Integrate $ Test Code Design Specifications Use Cases / Functional Specs Requirements Gathering Project Plan/Estimation $ $ $ $ Level Stories Vision & High- Iteration Release
  • 3.  
  • 4.
  • 5.
  • 6. Refactoring “ A disciplined way to make change to your source code to improve its design, making it easier to work with” Martin Folwer
  • 7.
  • 8.
  • 9.
  • 10.
  • 12.
  • 13. Refactoring database schema Introduce transition period for SAFTY
  • 14. Never get rid of old schema immediately Data sync in real time
  • 15. What we did in this project Legacy DB NEW DB FlatFile Triger SystemNameID Newvalue OldValue columnName Read Data Near real Time Read Data systemName SystemNameID(PK) SystemLogin … systemName_log SystemNameID(PK) OperDatetime Account AccountID(PK) AccountName SystemNameID Isdelete
  • 16.
  • 17.   The process of database refactoring
  • 18.
  • 19.
  • 20. Put test scripts into CI Put verification scripts into CI Run verification scripts in production often, be aware of production data
  • 21.
  • 22.
  • 23. Delcare row_num number:=0; Begin for c_CN in (select MessId,C1,C2 from contactInfo a left join CI_Mig_log b on a.Messid=b.messid where flag=0) update contactNote set contactNote=c_CN.c1, contactId=c_CN.c2 where Messid=c_CN.Messid update CI_MIG_log f set f.flag=1 where messid=c_Cn.MessId row_num:=row_num+1; if mod(row_num,1000)=0 then commit; end if; End loop; Cancel it if there is no enough resource for migration Migration ContactInfo Messid(pk) C1 C2 … ContactNote ContactNoteId(pk) ContactNote ContactId MessId CI_Mig_log MessID(PK) Flag
  • 24.
  • 25. Put them under configuration management control CREATE TABLE money ( eek NUMBER ); //Test for… DB DDL Insert into AA(mydata) Values(11); Meta Data Delete from .. DML Create index optimization Merge into Data Migration Tests Installation scripts
  • 26. Configuration of DB project Database project under version control Tiny db backup Deltascripts of dbdeploy For defining db objects which depends on schema For data onetime migration For data sync For checking dirty data Tool exclusively for database project other scripts…
  • 27. Database Deployment An automated process is needed to make the process of upgrading out-of-date databases
  • 28.
  • 29. Management DB deploymnet DB Deploy - http://dbdeploy.com/
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. Batch file: libraryantant.exe –buildfile:evovle.build –D:rebuildDB -logfile:build.txt Shared to devs Do what we want by just One Command
  • 35.
  • 36. Q&A

Notes de l'éditeur

  1. Changing from waterfall to Agile At an early stage identify requirements , reconcile , design , begin coding minimize changes due extensive preliminary work
  2. automation
  3. explain
  4. Classify and Prioritize data Client list the most important data Try to figure out Data pattern( Data cleaning) Only working on meaningful data Verify data by system logics ( data referencing, records number…) Check it randomly