SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
NoSQL By Perry Hoekstra Technical Consultant Perficient, Inc. [email_address]
Why this topic? ,[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
History of the World, Part 1 ,[object Object],[object Object],[object Object],[object Object]
Scaling Up ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scaling RDBMS – Master/Slave ,[object Object],[object Object],[object Object],[object Object]
Scaling RDBMS - Sharding ,[object Object],[object Object],[object Object],[object Object],[object Object]
Other ways to scale RDBMS ,[object Object],[object Object],[object Object],[object Object],[object Object]
What is NoSQL? ,[object Object],[object Object],[object Object],[object Object]
Why NoSQL? ,[object Object],[object Object],[object Object],[object Object]
How did we get here? ,[object Object],[object Object],[object Object],[object Object]
Dynamo and BigTable ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Perfect Storm ,[object Object],[object Object],[object Object]
CAP Theorem ,[object Object],[object Object],[object Object],[object Object]
Availability ,[object Object],[object Object],[object Object]
Consistency Model ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Eventual Consistency ,[object Object],[object Object],[object Object]
What kinds of NoSQL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Key/Value ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Schema-Less ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Common Advantages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What am I giving up? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Cassandra ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thrift ,[object Object],[object Object],[object Object],[object Object]
Searching ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Typical NoSQL API ,[object Object],[object Object],[object Object],[object Object],[object Object]
Data Model ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data Model Continued ,[object Object],[object Object],[object Object],[object Object]
Cassandra and Consistency ,[object Object],[object Object],[object Object],[object Object],[object Object]
Cassandra and Consistency ,[object Object],[object Object],[object Object],[object Object],[object Object]
Consistent Hashing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Domain Model ,[object Object],[object Object],<Keyspace Name=&quot; Acme &quot;>     <ColumnFamily CompareWith=&quot; UTF8Type &quot; Name=&quot; Rockets &quot; />      <ColumnFamily CompareWith=&quot; UTF8Type &quot; Name=&quot; OtherProducts &quot; />      <ColumnFamily CompareWith=&quot; UTF8Type &quot; Name=&quot; Explosives &quot; />     … </Keyspace>
Data Model ColumnFamily: Rockets Key Value 1 2 3 name name name Name Value toon inventoryQty brakes Rocket-Powered Roller Skates Ready, Set, Zoom 5 false Name Value toon inventoryQty brakes Little Giant Do-It-Yourself Rocket-Sled Kit Beep Prepared 4 false Name Value toon inventoryQty wheels Acme Jet Propelled Unicycle Hot Rod and Reel 1 1
Data Model Continued ,[object Object],[object Object],[object Object],[object Object],[object Object]
Data Model Continued ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Hector ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Hector and JMX
Code Examples: Tomcat Configuration Tomcat context.xml <Resource name=&quot;cassandra/CassandraClientFactory&quot;  auth=&quot;Container&quot;  type=&quot;me.prettyprint.cassandra.service.CassandraHostConfigurator&quot;  factory=&quot;org.apache.naming.factory.BeanFactory&quot;  hosts=&quot;localhost:9160&quot;  maxActive=&quot;150&quot;  maxIdle=&quot;75&quot; /> J2EE web.xml <resource-env-ref> <description>Object factory for Cassandra clients.</description> <resource-env-ref-name>cassandra/CassandraClientFactory</resource-env-ref-name> <resource-env-ref-type>org.apache.naming.factory.BeanFactory</resource-env-ref-type> </resource-env-ref>
Code Examples: Spring Configuration Spring applicationContext.xml <bean id=&quot;cassandraHostConfigurator“ class=&quot;org.springframework.jndi.JndiObjectFactoryBean&quot;> <property name=&quot;jndiName&quot;> <value>cassandra/CassandraClientFactory</value></property> <property name=&quot;resourceRef&quot;><value>true</value></property> </bean> <bean id=&quot;inventoryDao“ class=&quot;com.acme.erp.inventory.dao.InventoryDaoImpl&quot;> <property name=&quot;cassandraHostConfigurator“ ref=&quot;cassandraHostConfigurator&quot; /> <property name=&quot;keyspace&quot; value=&quot;Acme&quot; /> </bean>
Code Examples: Cassandra Get Operation try  { cassandraClient = cassandraClientPool.borrowClient(); // keyspace is Acme Keyspace keyspace = cassandraClient.getKeyspace(getKeyspace());  // inventoryType is Rockets List<Column> result = keyspace.getSlice(Long.toString(inventoryId),  new  ColumnParent(inventoryType), getSlicePredicate());  inventoryItem.setInventoryItemId(inventoryId); inventoryItem.setInventoryType(inventoryType);  loadInventory(inventoryItem, result); }  catch  (Exception exception) { logger.error(&quot;An Exception occurred retrieving an inventory item&quot;, exception); }  finally  { try  { cassandraClientPool.releaseClient(cassandraClient); }  catch  (Exception exception) { logger.warn(&quot;An Exception occurred returning a Cassandra client to the pool&quot;, exception); } }
Code Examples: Cassandra Update Operation try  { cassandraClient = cassandraClientPool.borrowClient();  Map<String, List<ColumnOrSuperColumn>> data =  new  HashMap<String, List<ColumnOrSuperColumn>>(); List<ColumnOrSuperColumn> columns =  new  ArrayList<ColumnOrSuperColumn>(); // Create the inventoryId column. ColumnOrSuperColumn column =  new  ColumnOrSuperColumn(); columns.add(column.setColumn( new  Column(&quot;inventoryItemId&quot;.getBytes(&quot;utf-8&quot;), Long.toString(inventoryItem.getInventoryItemId()).getBytes(&quot;utf-8&quot;), timestamp))); column =  new  ColumnOrSuperColumn(); columns.add(column.setColumn( new  Column(&quot;inventoryType&quot;.getBytes(&quot;utf-8&quot;), inventoryItem.getInventoryType().getBytes(&quot;utf-8&quot;), timestamp))); … .  data.put(inventoryItem.getInventoryType(), columns);  cassandraClient.getCassandra().batch_insert(getKeyspace(), Long.toString(inventoryItem.getInventoryItemId()), data, ConsistencyLevel.ANY); }  catch  (Exception exception) { … }
Some Statistics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some things to think about ,[object Object],[object Object],[object Object],[object Object],[object Object]
Some more things to think about ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Don’t forget about the DBA ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Where would I use it? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary ,[object Object],[object Object],[object Object]
Questions
Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Contenu connexe

Tendances

Sap integration with_j_boss_technologies
Sap integration with_j_boss_technologiesSap integration with_j_boss_technologies
Sap integration with_j_boss_technologiesSerge Pagop
 
Oracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsOracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsJeff Smith
 
BPMN, BPEL, ESB or maybe Java? What should I use to implement my project?
BPMN, BPEL, ESB or maybe Java? What should I use to implement my project?BPMN, BPEL, ESB or maybe Java? What should I use to implement my project?
BPMN, BPEL, ESB or maybe Java? What should I use to implement my project?Guido Schmutz
 
Silverlight development
Silverlight developmentSilverlight development
Silverlight developmentAnurag Gupta
 
Clean coding in plsql and sql, v2
Clean coding in plsql and sql, v2Clean coding in plsql and sql, v2
Clean coding in plsql and sql, v2Brendan Furey
 
Oracle soa suite 11g introduction slide share
Oracle soa suite 11g introduction slide shareOracle soa suite 11g introduction slide share
Oracle soa suite 11g introduction slide shareSrinivasarao Mataboyina
 
Himansu-Java&BigdataDeveloper
Himansu-Java&BigdataDeveloperHimansu-Java&BigdataDeveloper
Himansu-Java&BigdataDeveloperHimansu Behera
 
WSO2Con2011: Using WSO2 ESB with SAP ERP (Retail)
WSO2Con2011: Using WSO2 ESB with SAP ERP (Retail)WSO2Con2011: Using WSO2 ESB with SAP ERP (Retail)
WSO2Con2011: Using WSO2 ESB with SAP ERP (Retail)WSO2
 
Life above the_service_tier_v1.1
Life above the_service_tier_v1.1Life above the_service_tier_v1.1
Life above the_service_tier_v1.1Ganesh Prasad
 
A-Team Mobile Persistence Accelerator Overview
A-Team Mobile Persistence Accelerator OverviewA-Team Mobile Persistence Accelerator Overview
A-Team Mobile Persistence Accelerator OverviewSteven Davelaar
 
RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7
RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7
RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7CA API Management
 
SOFEA: Service Oriented Front End Architecture, Next Gen Web Architecture for...
SOFEA: Service Oriented Front End Architecture, Next Gen Web Architecture for...SOFEA: Service Oriented Front End Architecture, Next Gen Web Architecture for...
SOFEA: Service Oriented Front End Architecture, Next Gen Web Architecture for...Kunal Ashar
 

Tendances (20)

Noonan_resume
Noonan_resumeNoonan_resume
Noonan_resume
 
Devjyotippt
DevjyotipptDevjyotippt
Devjyotippt
 
Sap integration with_j_boss_technologies
Sap integration with_j_boss_technologiesSap integration with_j_boss_technologies
Sap integration with_j_boss_technologies
 
Oracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsOracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your Designs
 
BPMN, BPEL, ESB or maybe Java? What should I use to implement my project?
BPMN, BPEL, ESB or maybe Java? What should I use to implement my project?BPMN, BPEL, ESB or maybe Java? What should I use to implement my project?
BPMN, BPEL, ESB or maybe Java? What should I use to implement my project?
 
Java ee introduction
Java ee introductionJava ee introduction
Java ee introduction
 
Silverlight development
Silverlight developmentSilverlight development
Silverlight development
 
Silverlight development
Silverlight developmentSilverlight development
Silverlight development
 
Clean coding in plsql and sql, v2
Clean coding in plsql and sql, v2Clean coding in plsql and sql, v2
Clean coding in plsql and sql, v2
 
Oracle soa suite 11g introduction slide share
Oracle soa suite 11g introduction slide shareOracle soa suite 11g introduction slide share
Oracle soa suite 11g introduction slide share
 
GAJENDRA_JAVA_J2EE_Profile
GAJENDRA_JAVA_J2EE_ProfileGAJENDRA_JAVA_J2EE_Profile
GAJENDRA_JAVA_J2EE_Profile
 
Himansu-Java&BigdataDeveloper
Himansu-Java&BigdataDeveloperHimansu-Java&BigdataDeveloper
Himansu-Java&BigdataDeveloper
 
Ravi Kiran Resume
Ravi Kiran ResumeRavi Kiran Resume
Ravi Kiran Resume
 
WSO2Con2011: Using WSO2 ESB with SAP ERP (Retail)
WSO2Con2011: Using WSO2 ESB with SAP ERP (Retail)WSO2Con2011: Using WSO2 ESB with SAP ERP (Retail)
WSO2Con2011: Using WSO2 ESB with SAP ERP (Retail)
 
Life above the_service_tier_v1.1
Life above the_service_tier_v1.1Life above the_service_tier_v1.1
Life above the_service_tier_v1.1
 
Venkata
VenkataVenkata
Venkata
 
A-Team Mobile Persistence Accelerator Overview
A-Team Mobile Persistence Accelerator OverviewA-Team Mobile Persistence Accelerator Overview
A-Team Mobile Persistence Accelerator Overview
 
RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7
RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7
RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7
 
SOFEA: Service Oriented Front End Architecture, Next Gen Web Architecture for...
SOFEA: Service Oriented Front End Architecture, Next Gen Web Architecture for...SOFEA: Service Oriented Front End Architecture, Next Gen Web Architecture for...
SOFEA: Service Oriented Front End Architecture, Next Gen Web Architecture for...
 
Day1
Day1Day1
Day1
 

Similaire à No sql

Data SLA in the public cloud
Data SLA in the public cloudData SLA in the public cloud
Data SLA in the public cloudLiran Zelkha
 
Schemaless Databases
Schemaless DatabasesSchemaless Databases
Schemaless DatabasesDan Gunter
 
Using Cassandra with your Web Application
Using Cassandra with your Web ApplicationUsing Cassandra with your Web Application
Using Cassandra with your Web Applicationsupertom
 
NoSQL, Hadoop, Cascading June 2010
NoSQL, Hadoop, Cascading June 2010NoSQL, Hadoop, Cascading June 2010
NoSQL, Hadoop, Cascading June 2010Christopher Curtin
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupesh Bansal
 
Storage cassandra
Storage   cassandraStorage   cassandra
Storage cassandraPL dream
 
NoSQL Options Compared
NoSQL Options ComparedNoSQL Options Compared
NoSQL Options ComparedSergey Bushik
 
Nonrelational Databases
Nonrelational DatabasesNonrelational Databases
Nonrelational DatabasesUdi Bauman
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesJon Meredith
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandrazznate
 
Big data vahidamiri-tabriz-13960226-datastack.ir
Big data vahidamiri-tabriz-13960226-datastack.irBig data vahidamiri-tabriz-13960226-datastack.ir
Big data vahidamiri-tabriz-13960226-datastack.irdatastack
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)zznate
 

Similaire à No sql (20)

NoSql Database
NoSql DatabaseNoSql Database
NoSql Database
 
No sql
No sqlNo sql
No sql
 
Data SLA in the public cloud
Data SLA in the public cloudData SLA in the public cloud
Data SLA in the public cloud
 
Schemaless Databases
Schemaless DatabasesSchemaless Databases
Schemaless Databases
 
No sql (1)
No sql (1)No sql (1)
No sql (1)
 
Using Cassandra with your Web Application
Using Cassandra with your Web ApplicationUsing Cassandra with your Web Application
Using Cassandra with your Web Application
 
NoSQL, Hadoop, Cascading June 2010
NoSQL, Hadoop, Cascading June 2010NoSQL, Hadoop, Cascading June 2010
NoSQL, Hadoop, Cascading June 2010
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata
 
Storage cassandra
Storage   cassandraStorage   cassandra
Storage cassandra
 
NoSQL Options Compared
NoSQL Options ComparedNoSQL Options Compared
NoSQL Options Compared
 
Nosql seminar
Nosql seminarNosql seminar
Nosql seminar
 
No sql
No sqlNo sql
No sql
 
Nonrelational Databases
Nonrelational DatabasesNonrelational Databases
Nonrelational Databases
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL Databases
 
NoSQL Basics - A Quick Tour
NoSQL Basics - A Quick TourNoSQL Basics - A Quick Tour
NoSQL Basics - A Quick Tour
 
NoSQL
NoSQLNoSQL
NoSQL
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandra
 
No sq lv2
No sq lv2No sq lv2
No sq lv2
 
Big data vahidamiri-tabriz-13960226-datastack.ir
Big data vahidamiri-tabriz-13960226-datastack.irBig data vahidamiri-tabriz-13960226-datastack.ir
Big data vahidamiri-tabriz-13960226-datastack.ir
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)
 

Dernier

Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?SANGHEE SHIN
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxYounusS2
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.francesco barbera
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServiceRenan Moreira de Oliveira
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
GenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncGenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncObject Automation
 

Dernier (20)

Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptx
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
GenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncGenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation Inc
 

No sql

  • 1. NoSQL By Perry Hoekstra Technical Consultant Perficient, Inc. [email_address]
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. Data Model ColumnFamily: Rockets Key Value 1 2 3 name name name Name Value toon inventoryQty brakes Rocket-Powered Roller Skates Ready, Set, Zoom 5 false Name Value toon inventoryQty brakes Little Giant Do-It-Yourself Rocket-Sled Kit Beep Prepared 4 false Name Value toon inventoryQty wheels Acme Jet Propelled Unicycle Hot Rod and Reel 1 1
  • 34.
  • 35.
  • 36.
  • 38. Code Examples: Tomcat Configuration Tomcat context.xml <Resource name=&quot;cassandra/CassandraClientFactory&quot; auth=&quot;Container&quot; type=&quot;me.prettyprint.cassandra.service.CassandraHostConfigurator&quot; factory=&quot;org.apache.naming.factory.BeanFactory&quot; hosts=&quot;localhost:9160&quot; maxActive=&quot;150&quot; maxIdle=&quot;75&quot; /> J2EE web.xml <resource-env-ref> <description>Object factory for Cassandra clients.</description> <resource-env-ref-name>cassandra/CassandraClientFactory</resource-env-ref-name> <resource-env-ref-type>org.apache.naming.factory.BeanFactory</resource-env-ref-type> </resource-env-ref>
  • 39. Code Examples: Spring Configuration Spring applicationContext.xml <bean id=&quot;cassandraHostConfigurator“ class=&quot;org.springframework.jndi.JndiObjectFactoryBean&quot;> <property name=&quot;jndiName&quot;> <value>cassandra/CassandraClientFactory</value></property> <property name=&quot;resourceRef&quot;><value>true</value></property> </bean> <bean id=&quot;inventoryDao“ class=&quot;com.acme.erp.inventory.dao.InventoryDaoImpl&quot;> <property name=&quot;cassandraHostConfigurator“ ref=&quot;cassandraHostConfigurator&quot; /> <property name=&quot;keyspace&quot; value=&quot;Acme&quot; /> </bean>
  • 40. Code Examples: Cassandra Get Operation try { cassandraClient = cassandraClientPool.borrowClient(); // keyspace is Acme Keyspace keyspace = cassandraClient.getKeyspace(getKeyspace()); // inventoryType is Rockets List<Column> result = keyspace.getSlice(Long.toString(inventoryId), new ColumnParent(inventoryType), getSlicePredicate()); inventoryItem.setInventoryItemId(inventoryId); inventoryItem.setInventoryType(inventoryType); loadInventory(inventoryItem, result); } catch (Exception exception) { logger.error(&quot;An Exception occurred retrieving an inventory item&quot;, exception); } finally { try { cassandraClientPool.releaseClient(cassandraClient); } catch (Exception exception) { logger.warn(&quot;An Exception occurred returning a Cassandra client to the pool&quot;, exception); } }
  • 41. Code Examples: Cassandra Update Operation try { cassandraClient = cassandraClientPool.borrowClient(); Map<String, List<ColumnOrSuperColumn>> data = new HashMap<String, List<ColumnOrSuperColumn>>(); List<ColumnOrSuperColumn> columns = new ArrayList<ColumnOrSuperColumn>(); // Create the inventoryId column. ColumnOrSuperColumn column = new ColumnOrSuperColumn(); columns.add(column.setColumn( new Column(&quot;inventoryItemId&quot;.getBytes(&quot;utf-8&quot;), Long.toString(inventoryItem.getInventoryItemId()).getBytes(&quot;utf-8&quot;), timestamp))); column = new ColumnOrSuperColumn(); columns.add(column.setColumn( new Column(&quot;inventoryType&quot;.getBytes(&quot;utf-8&quot;), inventoryItem.getInventoryType().getBytes(&quot;utf-8&quot;), timestamp))); … . data.put(inventoryItem.getInventoryType(), columns); cassandraClient.getCassandra().batch_insert(getKeyspace(), Long.toString(inventoryItem.getInventoryItemId()), data, ConsistencyLevel.ANY); } catch (Exception exception) { … }
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 49.

Notes de l'éditeur

  1. -&gt; Read an article how the NYT used Hadoop/MapReduce, Amazon S3, and Amazon EC2 to convert 4TB of TIFF images into PDFs (http://open.blogs.nytimes.com/tag/mapreduce) -&gt; Had just read a client’s Application Roadmap where one of the listed benefits was to reduce the document intake process. -&gt; These two processes may be completely different and not applicable but it would be nice to have enough knowledge to know that Hadoop/MapReduce would not work in this situation or know enough to say ‘Eureka!’
  2. -&gt; For the longest time (and still true today), the big relational database vendors such as Oracle, IBM, Sybase, and a lesser extent Microsoft were the mainstay of how data was stored. -&gt; During the Internet boom, startups looking for low-cost RDBMS alternatives turned to MySQL and PostgreSQL. -&gt; The ‘Slashdot Effect’ occurs when a popular website links to a smaller site, causing a massive increase in traffic. -&gt; Hooking your RDBMS to a web-based application was a recipe for headaches, they are OLTP in nature. Could have hundreds of thousands of visitors in a short-time span. -&gt; To mitigate, began to front the RDBMS with a read-only cache such as memcache to offload a considerable amount of the read traffic. -&gt; As datasets grew, the simple memcache/MySQL model (for lower-cost startups) started to become problematic.
  3. -&gt; Best way to provide ACID and a rich query model is to have the dataset on a single machine. -&gt; However, there are limits to scaling up (Vertical Scaling). -&gt; Past a certain point, an organization will find it is cheaper and more feasible to scale out (horizontal scaling) by adding smaller, more inexpensive (relatively) servers rather than investing in a single larger server. -&gt; A number of different approaches to scaling out (Horizontal Scaling). -&gt; DBAs began to look at master-slave and sharding as a strategy to overcome some of these issues.
  4. -&gt; Different sharding approaches: -&gt; Vertical Partitioning: Have tables related to a specific feature sit on their own server. May have to rebalance or reshard if tables outgrow server. -&gt; Range-Based Partitioning: When single table cannot sit on a server, split table onto multiple servers. Split table based on some critical value range. -&gt; Key or Hash-Based partitioning: Use a key value in a hash and use the resulting value as entry into multiple servers. -&gt; Directory-Based Partitioning: Have a lookup service that has knowledge of the partitioning scheme . This allows for the adding of servers or changing the partition scheme without changing the application. -&gt; http://adam.heroku.com/past/2009/7/6/sql_databases_dont_scale
  5. -&gt; The multi-master replication system is responsible for propagating data modifications made by each member to the rest of the group, and resolving any conflicts that might arise between concurrent changes made by different members. -&gt; For INSERT-only, data is versioned upon update. -&gt; Data is never DELETED, only inactivated. -&gt; JOINs are expensive with large volumes and don’t work across partitions. -&gt; Denormalization leads to even larger databases, reduces query time. -&gt; Consistency is the responsibility of the application. -&gt; In-memory databases have not caught on mainstream and regular RDBMS are more disk-intensive that memory-intensive. Vendors looking to fix this.
  6. -&gt; NoSQL was a term coined by Eric Evans. He states that ‘… but the whole point of seeking alternatives is that you need to solve a problem that relational databases are a bad fit for. … -&gt; This is why people are continually interpreting nosql to be anti-RDBMS , it&apos;s the only rational conclusion when the only thing some of these projects share in common is that they are not relational databases .’ -&gt; Emil Elfrem stated it is not a ‘NO’ SQL but more of a ‘Not Only” SQL.
  7. -&gt; Too often as consultants, when we talk about data storage, we immediately reach for a relational database. -&gt; Relational databases offer a very good general purpose solution to many different data storage needs. -&gt; In other words, it is the safe choice and will work in many situations. -&gt; Need to have some knowledge of alternatives, if nothing else to know when a NoSQL solution needs further investigation.
  8. -&gt; However, the people with the largest datasets (terrabyte/petabyte) began to realize that sharding was putting a bandage on their issues. The more aggressive thought leaders (Google, Facebook, Twitter) began to explore alternative ways to store data. This became especially true in 2008/2009. -&gt; These datasets have high read/write rates. -&gt; With the advent of Amazon S3, a large respected vendor made the statement that maybe is was okay to look at alternative storage solutions other that relational. -&gt; All of the NoSQL options with the exception of Amazon S3 (Amazon Dynamo) are open-source solutions. This provides a low-cost entry point to ‘kick the tires’.
  9. -&gt; BigTable: http://labs.google.com/papers/bigtable.html -&gt; Dynamo: http://www.allthingsdistributed.com/2007/10/amazons_dynamo.html and  http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf -&gt; Amazon and consistency * http://www.allthingsdistributed.com/2010/02 * http://www.allthingsdistributed.com/2008/12
  10. -&gt; So you have reached a point where a read-only cache and write-based RDBMS isn’t delivering the throughput necessary to support a particular application. -&gt; You need to examine alternatives and what alternatives are out there. -&gt; The NoSQL databases are a pragmatic response to growing scale of databases and the falling prices of commodity hardware. -&gt; Most likely, 10 years from now, the majority of data is still stored in RDBMS.
  11. -&gt; Proposed by Eric Brewer (talk on Principles of Distributed Computing July 2000). -&gt; Partitionability: divide nodes into small groups that can see other groups, but they can&apos;t see everyone. -&gt; Consistency: write a value and then you read the value you get the same value back. In a partitioned system there are windows where that&apos;s not true. -&gt; Availability: may not always be able to write or read. The system will say you can&apos;t write because it wants to keep the system consistent. -&gt; To scale you have to partition, so you are left with choosing either high consistency or high availability for a particular system. You must find the right overlap of availability and consistency. -&gt; Choose a specific approach based on the needs of the service. -&gt; For the checkout process you always want to honor requests to add items to a shopping cart because it&apos;s revenue producing. In this case you choose high availability. Errors are hidden from the customer and sorted out later. -&gt; When a customer submits an order you favor consistency because several services--credit card processing, shipping and handling, reporting— are simultaneously accessing the data.
  12. -&gt; http://cloudera-todd.s3.amazonaws.com/nosql.pdf
  13. -&gt; http://en.wikipedia.org/wiki/Eventual_consistency -&gt; http://www.allthingsdistributed.com/2008/12/eventually_consistent.html The types of large systems based on CAP aren&apos;t ACID they are BASE (http://queue.acm.org/detail.cfm?id=1394128): * Basically Available - system seems to work all the time * Soft State - it doesn&apos;t have to be consistent all the time * Eventually Consistent - becomes consistent at some later time Everyone who builds big applications builds them on CAP and BASE: Google, Yahoo, Facebook, Amazon, eBay, etc
  14. -&gt; Not an exhaustive list, just some of the more well-known. -&gt; HBase is the data storage solution for Hadoop. -&gt; Graph: is a network database that uses edges and nodes to represent and store data. -&gt; Document: views are stored as rows which are kept sorted by key. Can adapt to variations in document structure.
  15. -&gt; http://chariotsolutions.blogspot.com/2010/01/why-you-need-nosql-in-your-toolbox.html
  16. -&gt; As the data is written, the latest version is on at least one node. The data is then versioned/replicated to other nodes within the system. -&gt; Eventually, the same version is on all nodes.
  17. -&gt; No JDBC -&gt; Data integrity at the application layer
  18. -&gt; http://incubator.apache.org/thrift/static/thrift-20070401.pdf -&gt; http://incubator.apache.org/thrift/ -&gt; Thrift also created by Facebook engineers and donated to Apache
  19. -&gt; http://horicky.blogspot.com/2009/11/nosql-patterns.html
  20. -&gt; Have heard it referred to as a 4 or 5 dimensional hash table.
  21. -&gt; Keys have different numbers of columns, so the database can scale in an irregular way. -&gt; Simple and Super: super columns are columns within columns. -&gt; Refer to date by keyspace , a column family , a key , an optional super column , and a column .
  22. -&gt; http://www.slideshare.net/julesbravo/cassandra-3125809 -&gt; Have a good simple benchmark to show to demonstrate difference between Cassandra and MySQL
  23. -&gt; http://senguptas.org/Documents/cassandra_cs349c_presentation.pdf
  24. -&gt; http://home.roadrunner.com/~tuco/looney/acme.html
  25. -&gt; Open-source at GitHub -&gt; Lead developer is Ran Tavoy
  26. -&gt; Using JConsole
  27. -&gt; The purpose of these two slides is not to teach how to do Cassandra/Hector programming but to show how much programming needs to be done versus Hibernate -&gt; Back in the good old days of JDBC programming
  28. -&gt; http://static.last.fm/johan/nosql-20090611/cassandra_nosql.ppt
  29. -&gt; http://github.com/PedroGomes/datanucleus-cassandra (JDO) -&gt; http://github.com/wolpert/grails-cassandra
  30. -&gt; Taken from: http://www.claassen.net/geek/blog/2010/02/nosql-is-new-arcadia.html
  31. -&gt; Need to educate the DBA rather than going around them.
  32. http://www.infoq.com/articles/nosql-in-the-enterprise
  33. NoSQL has taken a field that was &amp;quot;dead&amp;quot; (database development) and suddenly brought it back to life.
  34. Books: -&gt; CouchDB (O’Reilly) -&gt; Hadoop (O’Reilly) -&gt; MongoDB (O’Reilly Forthcoming) -&gt; Hadoop in Action (Manning Forthcoming) -&gt; CouchDB in Action (Manning Forthcoming)