SlideShare a Scribd company logo
1 of 16
Databasics
An Intro to databases
Who Am I?
Adam Martinek - adam.martinek@rackspace.com
● Attended EWU
● Worked at Wolfram Research on Wolfram|Alpha’s data framework
● Now work for Rackspace Monitoring team
● Passion for data storage (Directly because of Martin Fowlers NoSQL Distilled)
Overview
● Relational Databases
● Set Theory/Relational Algebra
● ACID
● CAP theory
● Graph Databases
● Key/Value Stores
● Document Stores
● Column/Family Databases
Relational Databases
Data Modelling Ideology: Set Theory/Relational Algebra
Use Cases: Default
Relevant Databases: MySQL, PostgreSQL, SQL Server, Oracle...
Set Theory/Relational Algebra
Good to understand to get yourself thinking in sets
● Set union: Complete table join
● Set Intersection: Table Join on a specific value
● Set Difference: All values in a table that are not in the other table
Diagrams and sample SQL queries to follow
Set Union
SELECT * FROM a UNION SELECT * FROM b;
U
Set Intersection
SELECT * FROM a JOIN b WHERE a.indexValue = b.indexValue;
Set Difference
SELECT * FROM b WHERE b.indexValue NOT IN (SELECT indexValue FROM a);
Indexes
● Based on B-Trees (Dependent on specific database)
● Is more complex for finding ranges
● Don’t use auto increment integers as primary key
Best Practice
● Find the candidate key(s)
● If no candidate keys then consider UUID (remember that this in incurs write
penalties for generating the UUID)
● If the database doesn’t support UUID’s then you can consider using an auto
Candidate Keys
● Assuming no duplicate rows
● A Candidate Key is a set of columns that based on the data, will be unique
● The previous statement must also be irreducible (it must be the smallest set
of unique columns)
ACID
● Atomicity: All or nothing for a transaction
● Consistency: Bring from one valid state to another valid state
● Isolation: Result of concurrent transactions must be the same as if applied
serially
● Durability: Even in the event of power loss, crashes or errors each transaction
must remain
CAP Theorem
● Consistency: All nodes see the same data at the same time
● Availability: A guarantee that every request receives a response about
whether it succeeded or failed
● Partition Tolerance: The system continues to operate despite arbitrary
partitioning due to network failures
Choose two
Most NoSQL databases get around this by allowing you to choose which you want
at query time
Graph Databases
Data Modelling Ideology: Graph Theory
Use Cases: Recommendation Engine, Search, Network Modelling...
ACID compliance: Dependent (Most are)
Relevant Databases: Neo4j, Sparksee, HypergraphDB…
Gotchas: Nodes are indexed (for finding an entry point into the graph) but edges
attached to a node are not
Key/Value
Data Modelling Ideology: Hash Map
Use Cases: caching, simple applications, Large data values
Relevant Databases: Redis, Riak, memcached...
Gotchas: Can theoretically only query on the key
Document Stores
Data Modelling Ideology: JSON
Use Cases: Hierarchical Data,
Relevant Databases: MongoDB, CouchDB, PostgreSQL, ...
Gotchas: Indexes are difficult to change, Document size limits
Column/Family
Data Modelling Ideology: Hierarchical/key value
Use Cases: Time series, Fraud detection
Relevant Databases: Cassandra, HBase
Gotchas: Purposeful denormalization, limited query capability

More Related Content

What's hot

Java collections
Java collectionsJava collections
Java collectionsSujit Kumar
 
#nosql introduction
#nosql introduction#nosql introduction
#nosql introductionjethrobakker
 
When We Spark and When We Don’t: Developing Data and ML Pipelines
When We Spark and When We Don’t: Developing Data and ML PipelinesWhen We Spark and When We Don’t: Developing Data and ML Pipelines
When We Spark and When We Don’t: Developing Data and ML PipelinesStitch Fix Algorithms
 
Data structures and Alogarithims
Data structures and AlogarithimsData structures and Alogarithims
Data structures and AlogarithimsVictor Palmar
 
GemStone/S Indexed Collection Primer
GemStone/S Indexed Collection PrimerGemStone/S Indexed Collection Primer
GemStone/S Indexed Collection PrimerESUG
 
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Michael Rys
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structureVivek Kumar Sinha
 

What's hot (12)

Java collections
Java collectionsJava collections
Java collections
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Ei u4
Ei u4Ei u4
Ei u4
 
#nosql introduction
#nosql introduction#nosql introduction
#nosql introduction
 
Tracking data lineage at Stitch Fix
Tracking data lineage at Stitch FixTracking data lineage at Stitch Fix
Tracking data lineage at Stitch Fix
 
When We Spark and When We Don’t: Developing Data and ML Pipelines
When We Spark and When We Don’t: Developing Data and ML PipelinesWhen We Spark and When We Don’t: Developing Data and ML Pipelines
When We Spark and When We Don’t: Developing Data and ML Pipelines
 
Data structures and Alogarithims
Data structures and AlogarithimsData structures and Alogarithims
Data structures and Alogarithims
 
GemStone/S Indexed Collection Primer
GemStone/S Indexed Collection PrimerGemStone/S Indexed Collection Primer
GemStone/S Indexed Collection Primer
 
NoSql Brownbag
NoSql BrownbagNoSql Brownbag
NoSql Brownbag
 
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 

Viewers also liked

Viewers also liked (8)

Database intro
Database introDatabase intro
Database intro
 
Course intro
Course introCourse intro
Course intro
 
Oracle Query Optimizer - An Introduction
Oracle Query Optimizer - An IntroductionOracle Query Optimizer - An Introduction
Oracle Query Optimizer - An Introduction
 
Intro to Database Design
Intro to Database DesignIntro to Database Design
Intro to Database Design
 
Database presentation
Database presentationDatabase presentation
Database presentation
 
Access presentation
Access presentationAccess presentation
Access presentation
 
Data Base Management System
Data Base Management SystemData Base Management System
Data Base Management System
 
Freshman WH Intro to Database Searching
Freshman WH Intro to Database SearchingFreshman WH Intro to Database Searching
Freshman WH Intro to Database Searching
 

Similar to Databasics an intro to database systems

No sql bigdata and postgresql
No sql bigdata and postgresqlNo sql bigdata and postgresql
No sql bigdata and postgresqlZaid Shabbir
 
No SQL - A Simple Intro
No SQL - A Simple IntroNo SQL - A Simple Intro
No SQL - A Simple IntroKarthi Keyan
 
Big data technology unit 3
Big data technology unit 3Big data technology unit 3
Big data technology unit 3RojaT4
 
مقدمة عن NoSQL بالعربي
مقدمة عن NoSQL بالعربيمقدمة عن NoSQL بالعربي
مقدمة عن NoSQL بالعربيMohamed Galal
 
SQL/NoSQL How to choose ?
SQL/NoSQL How to choose ?SQL/NoSQL How to choose ?
SQL/NoSQL How to choose ?Venu Anuganti
 
Exploring NoSQL and implementing through Cassandra
Exploring NoSQL and implementing through CassandraExploring NoSQL and implementing through Cassandra
Exploring NoSQL and implementing through CassandraDileep Kalidindi
 
Conquering "big data": An introduction to shard query
Conquering "big data": An introduction to shard queryConquering "big data": An introduction to shard query
Conquering "big data": An introduction to shard queryJustin Swanhart
 
Enterprise NoSQL: Silver Bullet or Poison Pill
Enterprise NoSQL: Silver Bullet or Poison PillEnterprise NoSQL: Silver Bullet or Poison Pill
Enterprise NoSQL: Silver Bullet or Poison PillBilly Newport
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introductionPooyan Mehrparvar
 
Architecting Database by Jony Sugianto (Detik.com)
Architecting Database by Jony Sugianto (Detik.com)Architecting Database by Jony Sugianto (Detik.com)
Architecting Database by Jony Sugianto (Detik.com)Tech in Asia ID
 
NoSQL(NOT ONLY SQL)
NoSQL(NOT ONLY SQL)NoSQL(NOT ONLY SQL)
NoSQL(NOT ONLY SQL)Rahul P
 
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...Felix Gessert
 
Apache Hive for modern DBAs
Apache Hive for modern DBAsApache Hive for modern DBAs
Apache Hive for modern DBAsLuis Marques
 

Similar to Databasics an intro to database systems (20)

No sql bigdata and postgresql
No sql bigdata and postgresqlNo sql bigdata and postgresql
No sql bigdata and postgresql
 
Big data
Big dataBig data
Big data
 
2. Lecture2_NOSQL_KeyValue.ppt
2. Lecture2_NOSQL_KeyValue.ppt2. Lecture2_NOSQL_KeyValue.ppt
2. Lecture2_NOSQL_KeyValue.ppt
 
No SQL - A Simple Intro
No SQL - A Simple IntroNo SQL - A Simple Intro
No SQL - A Simple Intro
 
NoSQL.pptx
NoSQL.pptxNoSQL.pptx
NoSQL.pptx
 
Big data technology unit 3
Big data technology unit 3Big data technology unit 3
Big data technology unit 3
 
مقدمة عن NoSQL بالعربي
مقدمة عن NoSQL بالعربيمقدمة عن NoSQL بالعربي
مقدمة عن NoSQL بالعربي
 
nosql.pptx
nosql.pptxnosql.pptx
nosql.pptx
 
SQL/NoSQL How to choose ?
SQL/NoSQL How to choose ?SQL/NoSQL How to choose ?
SQL/NoSQL How to choose ?
 
Exploring NoSQL and implementing through Cassandra
Exploring NoSQL and implementing through CassandraExploring NoSQL and implementing through Cassandra
Exploring NoSQL and implementing through Cassandra
 
No sq lv2
No sq lv2No sq lv2
No sq lv2
 
Conquering "big data": An introduction to shard query
Conquering "big data": An introduction to shard queryConquering "big data": An introduction to shard query
Conquering "big data": An introduction to shard query
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
Enterprise NoSQL: Silver Bullet or Poison Pill
Enterprise NoSQL: Silver Bullet or Poison PillEnterprise NoSQL: Silver Bullet or Poison Pill
Enterprise NoSQL: Silver Bullet or Poison Pill
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
 
Architecting Database by Jony Sugianto (Detik.com)
Architecting Database by Jony Sugianto (Detik.com)Architecting Database by Jony Sugianto (Detik.com)
Architecting Database by Jony Sugianto (Detik.com)
 
NoSQL(NOT ONLY SQL)
NoSQL(NOT ONLY SQL)NoSQL(NOT ONLY SQL)
NoSQL(NOT ONLY SQL)
 
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
 
Apache Hive for modern DBAs
Apache Hive for modern DBAsApache Hive for modern DBAs
Apache Hive for modern DBAs
 
Revision
RevisionRevision
Revision
 

Recently uploaded

How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
 
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptxNLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptxBoston Institute of Analytics
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一fhwihughh
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queensdataanalyticsqueen03
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...Boston Institute of Analytics
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceSapana Sha
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.natarajan8993
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 

Recently uploaded (20)

How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
 
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptxNLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queens
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts Service
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 

Databasics an intro to database systems

  • 2. Who Am I? Adam Martinek - adam.martinek@rackspace.com ● Attended EWU ● Worked at Wolfram Research on Wolfram|Alpha’s data framework ● Now work for Rackspace Monitoring team ● Passion for data storage (Directly because of Martin Fowlers NoSQL Distilled)
  • 3. Overview ● Relational Databases ● Set Theory/Relational Algebra ● ACID ● CAP theory ● Graph Databases ● Key/Value Stores ● Document Stores ● Column/Family Databases
  • 4. Relational Databases Data Modelling Ideology: Set Theory/Relational Algebra Use Cases: Default Relevant Databases: MySQL, PostgreSQL, SQL Server, Oracle...
  • 5. Set Theory/Relational Algebra Good to understand to get yourself thinking in sets ● Set union: Complete table join ● Set Intersection: Table Join on a specific value ● Set Difference: All values in a table that are not in the other table Diagrams and sample SQL queries to follow
  • 6. Set Union SELECT * FROM a UNION SELECT * FROM b; U
  • 7. Set Intersection SELECT * FROM a JOIN b WHERE a.indexValue = b.indexValue;
  • 8. Set Difference SELECT * FROM b WHERE b.indexValue NOT IN (SELECT indexValue FROM a);
  • 9. Indexes ● Based on B-Trees (Dependent on specific database) ● Is more complex for finding ranges ● Don’t use auto increment integers as primary key Best Practice ● Find the candidate key(s) ● If no candidate keys then consider UUID (remember that this in incurs write penalties for generating the UUID) ● If the database doesn’t support UUID’s then you can consider using an auto
  • 10. Candidate Keys ● Assuming no duplicate rows ● A Candidate Key is a set of columns that based on the data, will be unique ● The previous statement must also be irreducible (it must be the smallest set of unique columns)
  • 11. ACID ● Atomicity: All or nothing for a transaction ● Consistency: Bring from one valid state to another valid state ● Isolation: Result of concurrent transactions must be the same as if applied serially ● Durability: Even in the event of power loss, crashes or errors each transaction must remain
  • 12. CAP Theorem ● Consistency: All nodes see the same data at the same time ● Availability: A guarantee that every request receives a response about whether it succeeded or failed ● Partition Tolerance: The system continues to operate despite arbitrary partitioning due to network failures Choose two Most NoSQL databases get around this by allowing you to choose which you want at query time
  • 13. Graph Databases Data Modelling Ideology: Graph Theory Use Cases: Recommendation Engine, Search, Network Modelling... ACID compliance: Dependent (Most are) Relevant Databases: Neo4j, Sparksee, HypergraphDB… Gotchas: Nodes are indexed (for finding an entry point into the graph) but edges attached to a node are not
  • 14. Key/Value Data Modelling Ideology: Hash Map Use Cases: caching, simple applications, Large data values Relevant Databases: Redis, Riak, memcached... Gotchas: Can theoretically only query on the key
  • 15. Document Stores Data Modelling Ideology: JSON Use Cases: Hierarchical Data, Relevant Databases: MongoDB, CouchDB, PostgreSQL, ... Gotchas: Indexes are difficult to change, Document size limits
  • 16. Column/Family Data Modelling Ideology: Hierarchical/key value Use Cases: Time series, Fraud detection Relevant Databases: Cassandra, HBase Gotchas: Purposeful denormalization, limited query capability

Editor's Notes

  1. For each database system I will also provide a short list of use cases to give you an idea of when and where they should be used
  2. CAP is CP for relational databases
  3. Diagrams might be better
  4. CouchDB fully supports ACID but doesn’t have awareness of different types of documents. All documents in a particular database are in a single table
  5. This is admittedly the type of database that I know the least about.