SlideShare a Scribd company logo
1 of 25
ATG DB BEST
PRACTICES
BY KATE SEMIZHON
2
ATGOOTBDB
SCHEMAS
3
TABLE TYPES
• ATG OOTB
• New item-descriptors
Primary
• Extending OOTB tables
Auxiliary
• One-to-many
• Many-to-many
Multi
AUXILIARY TABLES
1. In ATG, VARCHAR2 is almost always used as a data type
for primary key column. Auxiliary tables should use the
same data type length for referencing primary table.
2. Auxiliary table MUST reference PRIMARY table but not
any other auxiliary table.
AUXILIARY TABLES
CREATE TABLE PRIMARY (
ID VARCHAR2 (40) NOT NULL,
NAME VARCHAR2 (40) NOT NULL,
CONSTRAINT PRIMARY_PK PRIMARY KEY (ID)
);
CREATE TABLE AUX1(
ID VARCHAR2 (40) NOT NULL,
SOME_PROP VARCHAR2 (400),
CONSTRAINT AUX1_PK PRIMARY KEY (ID),
CONSTRAINT AUX1_FK FOREIGN KEY (ID) REFERENCES PRIMARY (ID)
);
CREATE TABLE AUX2 (
ID VARCHAR2 (40) NOT NULL,
SOME_PROP VARCHAR2 (40),
CONSTRAINT AUX2_PK PRIMARY KEY (ID),
CONSTRAINT AUX2_FK FOREIGN KEY (ID) REFERENCES PRIMARY(ID) -- THIS
IS CORRECT!
);
MULTI TABLES
Confidential
8
Primary table
Primary table
multi
Primary key
Confidential
9
Primary table
Primary table
multi
Primary key
Confidential
10
Primary table
Primary table
multi
Primary key
one-to-many from both sides
CREATE TABLE CONTENT(
CONTENT_ID VARCHAR2 (40) NOT NULL,
DESCRIPTION VARCHAR2 (254) NULL ,
CONSTRAINT CONTENT_IMAGES_PK PRIMARY KEY (CONTENT_ID)
);
CREATE TABLE IMAGES (
IMAGE_ID VARCHAR2 (40) NOT NULL,
URL VARCHAR2 (254) NULL ,
CONSTRAINT CONTENT_IMAGES_PK PRIMARY KEY (IMAGE_ID)
);
CREATE TABLE CONTENT_IMAGES (
CONTENT_ID VARCHAR2 (40) NOT NULL REFERENCES CONTENT(CONTENT_ID),
IMAGE_ID VARCHAR2 (254) NOT NULL REFERENCES IMAGES(IMAGE_ID) ,
CONSTRAINT CONTENT_IMAGES_PK PRIMARY KEY (CONTENT_ID , IMAGE_ID)
);
MANY-TO-MANY RELATIONSHIPS
11
VERSIONED SCHEMA
PRIMARY TABLES
1) The following columns should be added to every table
that represents a primary table for an item descriptor:
Confidential
13
asset_version INTEGER NOT NULL
workspace_id varchar2(254) NULL
branch_id varchar2(254) NULL
is_head number(1) NULL
version_deleted varchar2(254) NULL
version_editable varchar2(254) NULL
pred_version INT NULL
checkin_date DATE NULL
PRIMARY TABLES
2) Primary key
Original Primary Key + ASSET_VERSION
3) Remove from all tables:
• All foreign key references.
• All unique constraints on columns.
• All unique indexes on columns.
PRIMARY TABLES
4) Indexes
all primary tables in the versioned schema have indexes on
workspace_id and checkin_date
create index type_x_workspace_id on type_x
(workspace_id);
create index type_x_checkin_date_id on type_x
(checkin_date);
PRIMARY TABLES.
EXAMPLE
create table type_x (
type_x_id VARCHAR2(16) NOT NULL,
asset_version INT NOT NULL,
branch_id VARCHAR2(40) NULL,
is_head NUMERIC(1) NULL,
version_deleted NUMERIC(1) NULL,
version_editable NUMERIC(1) NULL,
workspace_id VARCHAR(40) NULL,
pred_version INT NULL,
checkin_date TIMESTAMP NULL,
name VARCHAR2(128) NULL,
type_y_ref_id VARCHAR2(16) NULL,
PRIMARY KEY (type_x_id, asset_version)
);
create index type_x_workspace_id on type_x (workspace_id);
create index type_x_checkin_date_id on type_x (checkin_date);
AUXILIARY TABLES
1) The following column should be added to every table that
represents an auxiliary or multi table in an item
descriptor:
asset_version INT NOT NULL
2) Primary key
Original Primary Key + ASSET_VERSION
AUXILIARY TABLES
3) Remove from all tables:
• All foreign key references.
• All unique constraints on columns.
• All unique indexes on columns
AUXILIARY TABLES.
EXAMPLE
Original DDL:
CREATE TABLE dcs_cat_media (
category_id varchar2(254) NOT NULL REFERENCES
dcs_category(category_id),
template_id varchar2(254) NULL REFERENCES dcs_media(media_id),
PRIMARY KEY(category_id)
);
Versioned Schema DDL:
CREATE TABLE dcs_cat_media (
category_id varchar2(254) NOT NULL,
asset_version INTEGER NOT NULL,
template_id varchar2(254) NULL,
PRIMARY KEY(category_id, asset_version)
);
MULTI TABLES
1) The following column should be added to every table that
represents an auxiliary or multi table in an item descriptor:
asset_version INT NOT NULL
sec_asset_version INT NOT NULL
2) Primary key
Original Primary Key + asset_version +
sec_asset_version
MULTI TABLES
3) Remove from all tables:
• All foreign key references.
• All unique constraints on columns.
• All unique indexes on columns
ONE-TO-MANY.
EXAMPLE
Original DDL
CREATE TABLE dcs_cat_chldprd (
category_id varchar2(254) NOT NULL REFERENCES
dcs_category(category_id),
sequence_num INTEGER NOT NULL,
child_prd_id varchar2(254) NULL REFERENCES dcs_product(product_id),
PRIMARY KEY(category_id, sequence_num)
);
Versioned DDL
CREATE TABLE dcs_cat_chldprd (
category_id varchar2(254) NOT NULL,
asset_version INTEGER NOT NULL,
sequence_num INTEGER NOT NULL,
child_prd_id varchar2(254) NULL,
sec_asset_version INTEGER NOT NULL,
PRIMARY KEY(category_id, sequence_num, asset_version, sec_asset_version)
);
MANY-TO-MANY.
EXAMPLE
Original DDL
CREATE TABLE dcs_catfol_chld (
catalog_id varchar2(254) NOT NULL REFERENCES dcs_catalog(catalog_id),
catfol_id varchar2(254) NOT NULL REFERENCES dcs_gen_fol_cat(folder_id),
sequence_num INTEGER NOT NULL,
PRIMARY KEY(catalog_id, catfol_id, sequence_num)
);
Versioned DDL
CREATE TABLE dcs_catfol_chld (
catalog_id varchar2(254) NOT NULL,
sec_asset_version INTEGER NOT NULL,
catfol_id varchar2(254) NOT NULL,
sequence_num INTEGER NOT NULL,
asset_version INTEGER NOT NULL,
PRIMARY KEY(catalog_id, catfol_id, sequence_num, asset_version,
sec_asset_version)
);
THANK YOU!
QUESTIONS?
RESOURCES
ATG
documentation: http://docs.oracle.com/cd/E26180_01/Platfor
m.94/ATGCAProgGuide/ATGCAProgGuide.pdf

More Related Content

What's hot

Oracle Endeca Commerce - Installation Guide
Oracle Endeca Commerce - Installation GuideOracle Endeca Commerce - Installation Guide
Oracle Endeca Commerce - Installation GuideKeyur Shah
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web servicesNeil Ghosh
 
ATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your FigertipsATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your FigertipsKeyur Shah
 
HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)Daniel Friedman
 
Dom date and objects and event handling
Dom date and objects and event handlingDom date and objects and event handling
Dom date and objects and event handlingsmitha273566
 
RESTful API – How to Consume, Extract, Store and Visualize Data with InfluxDB...
RESTful API – How to Consume, Extract, Store and Visualize Data with InfluxDB...RESTful API – How to Consume, Extract, Store and Visualize Data with InfluxDB...
RESTful API – How to Consume, Extract, Store and Visualize Data with InfluxDB...InfluxData
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3Doris Chen
 
Html 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally ChohanHtml 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally Chohanballychohanuk
 
Swagger / Quick Start Guide
Swagger / Quick Start GuideSwagger / Quick Start Guide
Swagger / Quick Start GuideAndrii Gakhov
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introductionapnwebdev
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.jsEmanuele DelBono
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introductionRasheed Waraich
 

What's hot (20)

Oracle Endeca Commerce - Installation Guide
Oracle Endeca Commerce - Installation GuideOracle Endeca Commerce - Installation Guide
Oracle Endeca Commerce - Installation Guide
 
Javascript
JavascriptJavascript
Javascript
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
Introduction to DOM
Introduction to DOMIntroduction to DOM
Introduction to DOM
 
ATG Best Practices
ATG Best Practices ATG Best Practices
ATG Best Practices
 
ATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your FigertipsATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your Figertips
 
WebSockets with Spring 4
WebSockets with Spring 4WebSockets with Spring 4
WebSockets with Spring 4
 
HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)
 
Dom date and objects and event handling
Dom date and objects and event handlingDom date and objects and event handling
Dom date and objects and event handling
 
Angular 2
Angular 2Angular 2
Angular 2
 
RESTful API – How to Consume, Extract, Store and Visualize Data with InfluxDB...
RESTful API – How to Consume, Extract, Store and Visualize Data with InfluxDB...RESTful API – How to Consume, Extract, Store and Visualize Data with InfluxDB...
RESTful API – How to Consume, Extract, Store and Visualize Data with InfluxDB...
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Html 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally ChohanHtml 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally Chohan
 
OData Fundamental
OData FundamentalOData Fundamental
OData Fundamental
 
Swagger / Quick Start Guide
Swagger / Quick Start GuideSwagger / Quick Start Guide
Swagger / Quick Start Guide
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
 
Swagger UI
Swagger UISwagger UI
Swagger UI
 
Angular 9
Angular 9 Angular 9
Angular 9
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
 

Viewers also liked

Oracle endeca information discovery architecture
Oracle endeca information discovery architectureOracle endeca information discovery architecture
Oracle endeca information discovery architectureAorta business intelligence
 
Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers Kate Semizhon
 
Oracle Commerce Using ATG & Endeca - Do It Yourself Series
Oracle Commerce Using ATG & Endeca - Do It Yourself SeriesOracle Commerce Using ATG & Endeca - Do It Yourself Series
Oracle Commerce Using ATG & Endeca - Do It Yourself SeriesKeyur Shah
 
ATG Commerce: Full Capabilities Overview
ATG Commerce: Full Capabilities OverviewATG Commerce: Full Capabilities Overview
ATG Commerce: Full Capabilities Overviewsobrien15
 
Common mistakes for ATG applications that affect performance
Common mistakes for ATG applications that affect performanceCommon mistakes for ATG applications that affect performance
Common mistakes for ATG applications that affect performanceKate Semizhon
 
ATG Advanced Profile Management
ATG Advanced Profile ManagementATG Advanced Profile Management
ATG Advanced Profile ManagementKate Semizhon
 
Oracle Endeca 101 Developer Introduction High Level Overview
Oracle Endeca 101 Developer Introduction High Level OverviewOracle Endeca 101 Developer Introduction High Level Overview
Oracle Endeca 101 Developer Introduction High Level OverviewGordon Kiser
 
ATG Tutorials - Promotion.
ATG Tutorials - Promotion.ATG Tutorials - Promotion.
ATG Tutorials - Promotion.Sanju Thomas
 

Viewers also liked (9)

Oracle endeca information discovery architecture
Oracle endeca information discovery architectureOracle endeca information discovery architecture
Oracle endeca information discovery architecture
 
Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers
 
Oracle Commerce Using ATG & Endeca - Do It Yourself Series
Oracle Commerce Using ATG & Endeca - Do It Yourself SeriesOracle Commerce Using ATG & Endeca - Do It Yourself Series
Oracle Commerce Using ATG & Endeca - Do It Yourself Series
 
ATG Commerce: Full Capabilities Overview
ATG Commerce: Full Capabilities OverviewATG Commerce: Full Capabilities Overview
ATG Commerce: Full Capabilities Overview
 
Common mistakes for ATG applications that affect performance
Common mistakes for ATG applications that affect performanceCommon mistakes for ATG applications that affect performance
Common mistakes for ATG applications that affect performance
 
ATG Advanced Profile Management
ATG Advanced Profile ManagementATG Advanced Profile Management
ATG Advanced Profile Management
 
Endeca
EndecaEndeca
Endeca
 
Oracle Endeca 101 Developer Introduction High Level Overview
Oracle Endeca 101 Developer Introduction High Level OverviewOracle Endeca 101 Developer Introduction High Level Overview
Oracle Endeca 101 Developer Introduction High Level Overview
 
ATG Tutorials - Promotion.
ATG Tutorials - Promotion.ATG Tutorials - Promotion.
ATG Tutorials - Promotion.
 

Similar to Oracle eCommerce (ATG) Database Best Practices

Lecture 4 sql {basics keys and constraints}
Lecture 4 sql {basics  keys and constraints}Lecture 4 sql {basics  keys and constraints}
Lecture 4 sql {basics keys and constraints}Shubham Shukla
 
Sql practise for beginners
Sql practise for beginnersSql practise for beginners
Sql practise for beginnersISsoft
 
Oracle sql developer essentials
Oracle sql developer essentialsOracle sql developer essentials
Oracle sql developer essentialsAlok Vishwakarma
 
SESI 2 DATA DEFINITION LANGUAGE.pdf
SESI 2 DATA DEFINITION LANGUAGE.pdfSESI 2 DATA DEFINITION LANGUAGE.pdf
SESI 2 DATA DEFINITION LANGUAGE.pdfbudiman
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Achmad Solichin
 
Using ddl statements to create and manage tables
Using ddl statements to create and manage tablesUsing ddl statements to create and manage tables
Using ddl statements to create and manage tablesSyed Zaid Irshad
 
Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01sagaroceanic11
 
MySQL Database System Hiep Dinh
MySQL Database System Hiep DinhMySQL Database System Hiep Dinh
MySQL Database System Hiep Dinhwebhostingguy
 
Discover the power of Recursive SQL and query transformation with Informix da...
Discover the power of Recursive SQL and query transformation with Informix da...Discover the power of Recursive SQL and query transformation with Informix da...
Discover the power of Recursive SQL and query transformation with Informix da...Ajay Gupte
 

Similar to Oracle eCommerce (ATG) Database Best Practices (20)

Lecture 4 sql {basics keys and constraints}
Lecture 4 sql {basics  keys and constraints}Lecture 4 sql {basics  keys and constraints}
Lecture 4 sql {basics keys and constraints}
 
MY SQL
MY SQLMY SQL
MY SQL
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Les10 Creating And Managing Tables
 
Sql practise for beginners
Sql practise for beginnersSql practise for beginners
Sql practise for beginners
 
Physical Design and Development
Physical Design and DevelopmentPhysical Design and Development
Physical Design and Development
 
Oracle sql developer essentials
Oracle sql developer essentialsOracle sql developer essentials
Oracle sql developer essentials
 
Oraclesql
OraclesqlOraclesql
Oraclesql
 
Les02
Les02Les02
Les02
 
SESI 2 DATA DEFINITION LANGUAGE.pdf
SESI 2 DATA DEFINITION LANGUAGE.pdfSESI 2 DATA DEFINITION LANGUAGE.pdf
SESI 2 DATA DEFINITION LANGUAGE.pdf
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
 
Using ddl statements to create and manage tables
Using ddl statements to create and manage tablesUsing ddl statements to create and manage tables
Using ddl statements to create and manage tables
 
Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01
 
MySQL Database System Hiep Dinh
MySQL Database System Hiep DinhMySQL Database System Hiep Dinh
MySQL Database System Hiep Dinh
 
mysqlHiep.ppt
mysqlHiep.pptmysqlHiep.ppt
mysqlHiep.ppt
 
Les09
Les09Les09
Les09
 
Discover the power of Recursive SQL and query transformation with Informix da...
Discover the power of Recursive SQL and query transformation with Informix da...Discover the power of Recursive SQL and query transformation with Informix da...
Discover the power of Recursive SQL and query transformation with Informix da...
 
Indexing
IndexingIndexing
Indexing
 
Database
Database Database
Database
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
Les10
Les10Les10
Les10
 

More from Kate Semizhon

Seven Facts about Belarus
Seven Facts about BelarusSeven Facts about Belarus
Seven Facts about BelarusKate Semizhon
 
How to improve code quality for iOS apps?
How to improve code quality for iOS apps?How to improve code quality for iOS apps?
How to improve code quality for iOS apps?Kate Semizhon
 
Database Change Management
Database Change ManagementDatabase Change Management
Database Change ManagementKate Semizhon
 
How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase Kate Semizhon
 
Code Review Tool Evaluation
Code Review Tool EvaluationCode Review Tool Evaluation
Code Review Tool EvaluationKate Semizhon
 
SEO Instruments in ATG
SEO Instruments in ATGSEO Instruments in ATG
SEO Instruments in ATGKate Semizhon
 

More from Kate Semizhon (12)

Cracking 1-on-1s
Cracking 1-on-1sCracking 1-on-1s
Cracking 1-on-1s
 
Serverless Pitfalls
Serverless PitfallsServerless Pitfalls
Serverless Pitfalls
 
Seven Facts about Belarus
Seven Facts about BelarusSeven Facts about Belarus
Seven Facts about Belarus
 
Git 101
Git 101Git 101
Git 101
 
How to improve code quality for iOS apps?
How to improve code quality for iOS apps?How to improve code quality for iOS apps?
How to improve code quality for iOS apps?
 
Database Change Management
Database Change ManagementDatabase Change Management
Database Change Management
 
Ecommerce in 2018
Ecommerce in 2018Ecommerce in 2018
Ecommerce in 2018
 
How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase
 
Code Review Tool Evaluation
Code Review Tool EvaluationCode Review Tool Evaluation
Code Review Tool Evaluation
 
Sonar Review
Sonar ReviewSonar Review
Sonar Review
 
Unit tests benefits
Unit tests benefitsUnit tests benefits
Unit tests benefits
 
SEO Instruments in ATG
SEO Instruments in ATGSEO Instruments in ATG
SEO Instruments in ATG
 

Recently uploaded

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 insideshinachiaurasa2
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%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 Bahrainmasabamasaba
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
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 2024VictoriaMetrics
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%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 Stilfonteinmasabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
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...WSO2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
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 TransformationWSO2
 
%+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
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
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...WSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 

Recently uploaded (20)

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
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%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
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
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
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%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 Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
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...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
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
 
%+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...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
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...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 

Oracle eCommerce (ATG) Database Best Practices

  • 1. ATG DB BEST PRACTICES BY KATE SEMIZHON
  • 2. 2
  • 4. TABLE TYPES • ATG OOTB • New item-descriptors Primary • Extending OOTB tables Auxiliary • One-to-many • Many-to-many Multi
  • 5. AUXILIARY TABLES 1. In ATG, VARCHAR2 is almost always used as a data type for primary key column. Auxiliary tables should use the same data type length for referencing primary table. 2. Auxiliary table MUST reference PRIMARY table but not any other auxiliary table.
  • 6. AUXILIARY TABLES CREATE TABLE PRIMARY ( ID VARCHAR2 (40) NOT NULL, NAME VARCHAR2 (40) NOT NULL, CONSTRAINT PRIMARY_PK PRIMARY KEY (ID) ); CREATE TABLE AUX1( ID VARCHAR2 (40) NOT NULL, SOME_PROP VARCHAR2 (400), CONSTRAINT AUX1_PK PRIMARY KEY (ID), CONSTRAINT AUX1_FK FOREIGN KEY (ID) REFERENCES PRIMARY (ID) ); CREATE TABLE AUX2 ( ID VARCHAR2 (40) NOT NULL, SOME_PROP VARCHAR2 (40), CONSTRAINT AUX2_PK PRIMARY KEY (ID), CONSTRAINT AUX2_FK FOREIGN KEY (ID) REFERENCES PRIMARY(ID) -- THIS IS CORRECT! );
  • 11. one-to-many from both sides CREATE TABLE CONTENT( CONTENT_ID VARCHAR2 (40) NOT NULL, DESCRIPTION VARCHAR2 (254) NULL , CONSTRAINT CONTENT_IMAGES_PK PRIMARY KEY (CONTENT_ID) ); CREATE TABLE IMAGES ( IMAGE_ID VARCHAR2 (40) NOT NULL, URL VARCHAR2 (254) NULL , CONSTRAINT CONTENT_IMAGES_PK PRIMARY KEY (IMAGE_ID) ); CREATE TABLE CONTENT_IMAGES ( CONTENT_ID VARCHAR2 (40) NOT NULL REFERENCES CONTENT(CONTENT_ID), IMAGE_ID VARCHAR2 (254) NOT NULL REFERENCES IMAGES(IMAGE_ID) , CONSTRAINT CONTENT_IMAGES_PK PRIMARY KEY (CONTENT_ID , IMAGE_ID) ); MANY-TO-MANY RELATIONSHIPS 11
  • 13. PRIMARY TABLES 1) The following columns should be added to every table that represents a primary table for an item descriptor: Confidential 13 asset_version INTEGER NOT NULL workspace_id varchar2(254) NULL branch_id varchar2(254) NULL is_head number(1) NULL version_deleted varchar2(254) NULL version_editable varchar2(254) NULL pred_version INT NULL checkin_date DATE NULL
  • 14. PRIMARY TABLES 2) Primary key Original Primary Key + ASSET_VERSION 3) Remove from all tables: • All foreign key references. • All unique constraints on columns. • All unique indexes on columns.
  • 15. PRIMARY TABLES 4) Indexes all primary tables in the versioned schema have indexes on workspace_id and checkin_date create index type_x_workspace_id on type_x (workspace_id); create index type_x_checkin_date_id on type_x (checkin_date);
  • 16. PRIMARY TABLES. EXAMPLE create table type_x ( type_x_id VARCHAR2(16) NOT NULL, asset_version INT NOT NULL, branch_id VARCHAR2(40) NULL, is_head NUMERIC(1) NULL, version_deleted NUMERIC(1) NULL, version_editable NUMERIC(1) NULL, workspace_id VARCHAR(40) NULL, pred_version INT NULL, checkin_date TIMESTAMP NULL, name VARCHAR2(128) NULL, type_y_ref_id VARCHAR2(16) NULL, PRIMARY KEY (type_x_id, asset_version) ); create index type_x_workspace_id on type_x (workspace_id); create index type_x_checkin_date_id on type_x (checkin_date);
  • 17. AUXILIARY TABLES 1) The following column should be added to every table that represents an auxiliary or multi table in an item descriptor: asset_version INT NOT NULL 2) Primary key Original Primary Key + ASSET_VERSION
  • 18. AUXILIARY TABLES 3) Remove from all tables: • All foreign key references. • All unique constraints on columns. • All unique indexes on columns
  • 19. AUXILIARY TABLES. EXAMPLE Original DDL: CREATE TABLE dcs_cat_media ( category_id varchar2(254) NOT NULL REFERENCES dcs_category(category_id), template_id varchar2(254) NULL REFERENCES dcs_media(media_id), PRIMARY KEY(category_id) ); Versioned Schema DDL: CREATE TABLE dcs_cat_media ( category_id varchar2(254) NOT NULL, asset_version INTEGER NOT NULL, template_id varchar2(254) NULL, PRIMARY KEY(category_id, asset_version) );
  • 20. MULTI TABLES 1) The following column should be added to every table that represents an auxiliary or multi table in an item descriptor: asset_version INT NOT NULL sec_asset_version INT NOT NULL 2) Primary key Original Primary Key + asset_version + sec_asset_version
  • 21. MULTI TABLES 3) Remove from all tables: • All foreign key references. • All unique constraints on columns. • All unique indexes on columns
  • 22. ONE-TO-MANY. EXAMPLE Original DDL CREATE TABLE dcs_cat_chldprd ( category_id varchar2(254) NOT NULL REFERENCES dcs_category(category_id), sequence_num INTEGER NOT NULL, child_prd_id varchar2(254) NULL REFERENCES dcs_product(product_id), PRIMARY KEY(category_id, sequence_num) ); Versioned DDL CREATE TABLE dcs_cat_chldprd ( category_id varchar2(254) NOT NULL, asset_version INTEGER NOT NULL, sequence_num INTEGER NOT NULL, child_prd_id varchar2(254) NULL, sec_asset_version INTEGER NOT NULL, PRIMARY KEY(category_id, sequence_num, asset_version, sec_asset_version) );
  • 23. MANY-TO-MANY. EXAMPLE Original DDL CREATE TABLE dcs_catfol_chld ( catalog_id varchar2(254) NOT NULL REFERENCES dcs_catalog(catalog_id), catfol_id varchar2(254) NOT NULL REFERENCES dcs_gen_fol_cat(folder_id), sequence_num INTEGER NOT NULL, PRIMARY KEY(catalog_id, catfol_id, sequence_num) ); Versioned DDL CREATE TABLE dcs_catfol_chld ( catalog_id varchar2(254) NOT NULL, sec_asset_version INTEGER NOT NULL, catfol_id varchar2(254) NOT NULL, sequence_num INTEGER NOT NULL, asset_version INTEGER NOT NULL, PRIMARY KEY(catalog_id, catfol_id, sequence_num, asset_version, sec_asset_version) );

Editor's Notes

  1. We review DB changes often This presentation is only about ATG(!) DB best practice
  2. Configuring a Repository connection to a SQL database or an LDAP directory requires no Java coding at all. This course will focus specifically on the most common type of repository: a SQL repository. But the principles covered apply to repositories that connect to LDAP and other data sources as well. Note that ATG supplies support for SQL and LDAP. You can add custom support for other data sources. The relationship between ATG repository components and databases is not necessarily one-to-one. Administrators can choose to model several repositories from one schema of one database (which is what Dynamusic is doing -- the Songs, Events, and Profile repositories are all accessing the same schema in Solid). Alternatively, a single repository item can be made up of data from multiple databases using a composite repository. In fact, these databases don't even need to be the same type -- one could be SQL, and one LDAP. ATG's repository layer does all the necessary assembling and splitting of queries and commands to the various data sources. For more on composite repositories, see the “Composite Repositories” chapter of the Repository Guide.
  3. Column Name Description asset_version Counter that specifies the version of the asset. branch_id ID used to persist the branch of a version. is_head Flag that determines whether a version is the head of a branch. checkin_date Stores the check-in date of a version. Null for working versions of assets. version_deleted Flag that indicates whether the asset version is a deleted version. version_editable Flag that indicates whether the asset version is an editable version. That is, the version is a working version in a workspace, where modifications to it can be made. pred_version The asset version upon which this version was based. For example, if you create version 2 by checking out version 1, version 2’s predecessor version is version 1. workspace_id The ID of the workspace where the asset version was initially created.