SlideShare une entreprise Scribd logo
1  sur  38
Yes, SQL! Uri Cohen
> SELECT * FROM qcon2010.speakers WHERE name=‘Uri Cohen’ +-----------------------------------------------------+ | Name      | Company    | Role            | Twitter  | +-----------------------------------------------------+ | Uri Cohen | GigaSpaces | Product Manager | @uri1803 | +-----------------------------------------------------+ 2 > db.speakers.find({name:”Uri Cohen”}) {   “name”:”Uri Cohen”,    “company”: {                 name:”GigaSpaces”,                  products:[“XAP”, “IMDG”]                 domain: “In memory data grids”              }   “role”:”product manager”,    “twitter”:”@uri1803” }
Agenda 3 SQL What it is and isn’t good for  NoSQL Motivation & Main Concepts of Modern Distributed Data Stores  Common interaction models Key/Value, Column, Document NOT consistency and distribution algorithms  One Data Store, Multiple APIs Brief intro to GigaSpaces  Key/Value challenges  SQL challenges: Add-hoc querying, Relationships (JPA)
A Few (more) Words About SQL 4
SQL (Usually) Centralized  Transactional, consistent Hard to Scale  5
SQL Static, normalized data schema Don’t duplicate, use FKs 6
SQL Add hoc query support   Model first, query later 7
SQL Standard   Well known   Rich ecosystem  8
(Brief) NOSql Recap 9
NoSql (or a Naive Attempt to Define It) A loosely coupled collection of non-relational data stores 10
NoSql (or a Naive Attempt to Define It) (Mostly)  d   i   s   t   r   i   b   u   t   e   d  11
NoSql (or a Naive Attempt to Define It) scalable (Up & Out) 12
NoSql (or a Naive Attempt to Define It) Not (always) ACID  BASE anyone? 13
Why Now? Timing is everything… Exponential Increase in data & throughput  Non or semi structured data that changes frequently  14
A Universe of Data Models  15 Key / Value Column Document {   “name”:”uri”,   “ssn”:”213445”,   “hobbies”:[”…”,“…”],   “…”: {       “…”:”…”       “…”:”…”    }  } {   { ... } } {   { ... } }
Key/Value  Have the key? Get the value That’s about it when it comes to querying  Map/Reduce (sometimes) Good for cache aside (e.g. Hibernate 2nd level cache) Simple, id based interactions (e.g. user profiles)  In most cases, values are Opaque 16
Key/Value  Scaling out is relatively easy  (just hash the keys) Some will do that automatically for you  Fixed vs. consistent hashing  17
Key/Value  Implementations:  Memcached, Redis, Riak In memory data grids (mostly Java-based) started this way  GigaSpaces, Oracle Coherence, WebSphere XS, JBoss Infinispan, etc. 18
Column Based  19
Column Based  Mostly derived from Google’s BigTable / Amazon Dynamo papers  One giant table of rows and columns Column == pair (name and a value, sometimes timestamp) Each row can have a different number of columns Table is sparse:  (#rows) × (#columns) ≥ (#values) 20
Column Based  Query on row key  Or column value (aka secondary index) Good for a constantly changing, (albeit flat) domain model  21
Document  Think JSON (or BSON, or XML) {   “name”:”Lady Gaga”,   “ssn”:”213445”,   “hobbies”:[”Dressing up”,“Singing”],   “albums”:      [{“name”:”The fame”        “release_year”:”2008”},       {“name”:”Born this way”        “release_year”:”2011”}]  } {   { ... } } {   { ... } } 22
Document  Model is not flat, data store is aware of it  Arrays, nested documents  Better support for ad hoc queries MongoDB  excels at this  Very intuitive model  Flexible schema
What if you didn’t have to choose? 24 JPA JDBC
A Brief Intro to GigaSpaces  In Memory Data Grid  With optional write behind to a secondary storage  25
A Brief Intro to GigaSpaces  Tuple based ,[object Object],Document like  ,[object Object],26
A Brief Intro to GigaSpaces  Transparent partitioning & HA Fixed hashing based on a chosen property  27
A Brief Intro to GigaSpaces  Transactional (Like, ACID) Local (single partition) Distributed (multiple partitions) 28
Use the Right API for the Job 29 Even for the same data… POJO & JPA for Java apps with complex domain model Document for a more dynamic view Memcached for simple, language neutral data access JDBC for: Interaction with legacy apps  Flexible ad-hoc querying (e.g. projections)
Memcached (the Daemon is in the Details) MemcachedClient
Memcached (the Daemon is in the Details) MemcachedClient
SQL/JDBC – Query Them All 32 Query may involve Map/Reduce Reduce phase includes merging and sorting
SQL/JDBC – Things to Consider  Unique and FK constraints are not practically enforceable  Sorting and aggregation may be expensive  Distributed transactions are evil  Stay local… 33
JPA  It’s all about relationships… 34
JPA Relationships  To embed or not to embed, that is the question…. ,[object Object]
Easy to query: user.accounts[*].type = ‘checking’ ,[object Object],[object Object]
Partitioning is hard
Querying involves joining,[object Object]

Contenu connexe

Tendances

Introducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible API
Introducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible APIIntroducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible API
Introducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible API
ScyllaDB
 

Tendances (20)

Scylla Summit 2018: Scaling your time series data with Newts
Scylla Summit 2018: Scaling your time series data with NewtsScylla Summit 2018: Scaling your time series data with Newts
Scylla Summit 2018: Scaling your time series data with Newts
 
Mux loves Clickhouse. By Adam Brown, Mux founder
Mux loves Clickhouse. By Adam Brown, Mux founderMux loves Clickhouse. By Adam Brown, Mux founder
Mux loves Clickhouse. By Adam Brown, Mux founder
 
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
 
Web analytics at scale with Druid at naver.com
Web analytics at scale with Druid at naver.comWeb analytics at scale with Druid at naver.com
Web analytics at scale with Druid at naver.com
 
NoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
NoSQL on MySQL - MySQL Document Store by Vadim TkachenkoNoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
NoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
 
MongoDB .local Bengaluru 2019: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local Bengaluru 2019: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local Bengaluru 2019: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local Bengaluru 2019: MongoDB Atlas Data Lake Technical Deep Dive
 
NoSQL meets Microservices - Michael Hackstein
NoSQL meets Microservices -  Michael HacksteinNoSQL meets Microservices -  Michael Hackstein
NoSQL meets Microservices - Michael Hackstein
 
Google Cloud Spanner Preview
Google Cloud Spanner PreviewGoogle Cloud Spanner Preview
Google Cloud Spanner Preview
 
Powering a Graph Data System with Scylla + JanusGraph
Powering a Graph Data System with Scylla + JanusGraphPowering a Graph Data System with Scylla + JanusGraph
Powering a Graph Data System with Scylla + JanusGraph
 
What and Why and How: Apache Drill ! - Tugdual Grall
What and Why and How: Apache Drill ! - Tugdual GrallWhat and Why and How: Apache Drill ! - Tugdual Grall
What and Why and How: Apache Drill ! - Tugdual Grall
 
Distributed Caching in Kubernetes with Hazelcast
Distributed Caching in Kubernetes with HazelcastDistributed Caching in Kubernetes with Hazelcast
Distributed Caching in Kubernetes with Hazelcast
 
Introducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible API
Introducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible APIIntroducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible API
Introducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible API
 
SASI: Cassandra on the Full Text Search Ride (DuyHai DOAN, DataStax) | C* Sum...
SASI: Cassandra on the Full Text Search Ride (DuyHai DOAN, DataStax) | C* Sum...SASI: Cassandra on the Full Text Search Ride (DuyHai DOAN, DataStax) | C* Sum...
SASI: Cassandra on the Full Text Search Ride (DuyHai DOAN, DataStax) | C* Sum...
 
Exoscale: Pithos: your personal S3 object store on cassandra
Exoscale: Pithos: your personal S3 object store on cassandraExoscale: Pithos: your personal S3 object store on cassandra
Exoscale: Pithos: your personal S3 object store on cassandra
 
Cassandra + Hadoop = Brisk
Cassandra + Hadoop = BriskCassandra + Hadoop = Brisk
Cassandra + Hadoop = Brisk
 
ManetoDB: Key/Value storage, BigData in Open Stack_Сергей Ковалев, Илья Свиридов
ManetoDB: Key/Value storage, BigData in Open Stack_Сергей Ковалев, Илья СвиридовManetoDB: Key/Value storage, BigData in Open Stack_Сергей Ковалев, Илья Свиридов
ManetoDB: Key/Value storage, BigData in Open Stack_Сергей Ковалев, Илья Свиридов
 
ClickHouse Analytical DBMS. Introduction and usage, by Alexander Zaitsev
ClickHouse Analytical DBMS. Introduction and usage, by Alexander ZaitsevClickHouse Analytical DBMS. Introduction and usage, by Alexander Zaitsev
ClickHouse Analytical DBMS. Introduction and usage, by Alexander Zaitsev
 
NoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
NoSQL and NewSQL: Tradeoffs between Scalable Performance & ConsistencyNoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
NoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
 
MongoDB .local Bengaluru 2019: The Journey of Migration from Oracle to MongoD...
MongoDB .local Bengaluru 2019: The Journey of Migration from Oracle to MongoD...MongoDB .local Bengaluru 2019: The Journey of Migration from Oracle to MongoD...
MongoDB .local Bengaluru 2019: The Journey of Migration from Oracle to MongoD...
 
Critical Attributes for a High-Performance, Low-Latency Database
Critical Attributes for a High-Performance, Low-Latency DatabaseCritical Attributes for a High-Performance, Low-Latency Database
Critical Attributes for a High-Performance, Low-Latency Database
 

En vedette

Oscon 2013 - Lessons from building an open source community
Oscon 2013 - Lessons from building an open source community Oscon 2013 - Lessons from building an open source community
Oscon 2013 - Lessons from building an open source community
Uri Cohen
 

En vedette (6)

Oscon 2013 - Lessons from building an open source community
Oscon 2013 - Lessons from building an open source community Oscon 2013 - Lessons from building an open source community
Oscon 2013 - Lessons from building an open source community
 
DevOps Meets PaaS - NY Meetup with Chef (OpsCode)
DevOps Meets PaaS - NY Meetup with Chef (OpsCode)DevOps Meets PaaS - NY Meetup with Chef (OpsCode)
DevOps Meets PaaS - NY Meetup with Chef (OpsCode)
 
Oscon 2013 -Your OSS Project Is now served
Oscon 2013 -Your OSS Project Is now servedOscon 2013 -Your OSS Project Is now served
Oscon 2013 -Your OSS Project Is now served
 
GigaSpaces Cloudify - The PaaS Jailbreaker
GigaSpaces Cloudify - The PaaS Jailbreaker GigaSpaces Cloudify - The PaaS Jailbreaker
GigaSpaces Cloudify - The PaaS Jailbreaker
 
Whats New In GigaSpaces Xap 7.0
Whats New In GigaSpaces Xap 7.0Whats New In GigaSpaces Xap 7.0
Whats New In GigaSpaces Xap 7.0
 
One Does Not Simply Walk Into Devops
One Does Not Simply Walk Into Devops One Does Not Simply Walk Into Devops
One Does Not Simply Walk Into Devops
 

Similaire à Yes, Sql!

NoSQL: Why, When, and How
NoSQL: Why, When, and HowNoSQL: Why, When, and How
NoSQL: Why, When, and How
BigBlueHat
 
DMDW Extra Lesson - NoSql and MongoDB
DMDW  Extra Lesson - NoSql and MongoDBDMDW  Extra Lesson - NoSql and MongoDB
DMDW Extra Lesson - NoSql and MongoDB
Johannes Hoppe
 

Similaire à Yes, Sql! (20)

To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...
To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...
To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...
 
NoSQL: Why, When, and How
NoSQL: Why, When, and HowNoSQL: Why, When, and How
NoSQL: Why, When, and How
 
DMDW Extra Lesson - NoSql and MongoDB
DMDW  Extra Lesson - NoSql and MongoDBDMDW  Extra Lesson - NoSql and MongoDB
DMDW Extra Lesson - NoSql and MongoDB
 
SQL on Hadoop for the Oracle Professional
SQL on Hadoop for the Oracle ProfessionalSQL on Hadoop for the Oracle Professional
SQL on Hadoop for the Oracle Professional
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
2011 Mongo FR - MongoDB introduction
2011 Mongo FR - MongoDB introduction2011 Mongo FR - MongoDB introduction
2011 Mongo FR - MongoDB introduction
 
Next Top Data Model by Ian Plosker
Next Top Data Model by Ian PloskerNext Top Data Model by Ian Plosker
Next Top Data Model by Ian Plosker
 
Intro to Spark and Spark SQL
Intro to Spark and Spark SQLIntro to Spark and Spark SQL
Intro to Spark and Spark SQL
 
MySQL 5.7 Tutorial Dutch PHP Conference 2015
MySQL 5.7 Tutorial Dutch PHP Conference 2015MySQL 5.7 Tutorial Dutch PHP Conference 2015
MySQL 5.7 Tutorial Dutch PHP Conference 2015
 
MySQL 5.7. Tutorial - Dutch PHP Conference 2015
MySQL 5.7. Tutorial - Dutch PHP Conference 2015MySQL 5.7. Tutorial - Dutch PHP Conference 2015
MySQL 5.7. Tutorial - Dutch PHP Conference 2015
 
Introduction to Apache Tajo: Data Warehouse for Big Data
Introduction to Apache Tajo: Data Warehouse for Big DataIntroduction to Apache Tajo: Data Warehouse for Big Data
Introduction to Apache Tajo: Data Warehouse for Big Data
 
2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamsky2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamsky
 
Tutorial On Database Management System
Tutorial On Database Management SystemTutorial On Database Management System
Tutorial On Database Management System
 
Databases for Data Science
Databases for Data ScienceDatabases for Data Science
Databases for Data Science
 
Polyalgebra
PolyalgebraPolyalgebra
Polyalgebra
 
Planning with Polyalgebra: Bringing Together Relational, Complex and Machine ...
Planning with Polyalgebra: Bringing Together Relational, Complex and Machine ...Planning with Polyalgebra: Bringing Together Relational, Complex and Machine ...
Planning with Polyalgebra: Bringing Together Relational, Complex and Machine ...
 
MySQL Without the SQL -- Oh My! Longhorn PHP Conference
MySQL Without the SQL -- Oh My!  Longhorn PHP ConferenceMySQL Without the SQL -- Oh My!  Longhorn PHP Conference
MySQL Without the SQL -- Oh My! Longhorn PHP Conference
 
NoSQL Introduction
NoSQL IntroductionNoSQL Introduction
NoSQL Introduction
 
NoSQL Introduction
NoSQL IntroductionNoSQL Introduction
NoSQL Introduction
 
Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015
 

Plus de Uri Cohen

Alef event - going open source
Alef event - going open source Alef event - going open source
Alef event - going open source
Uri Cohen
 
Cassandra summit - Big Data Apps on the cloud
Cassandra summit - Big Data Apps on the cloud Cassandra summit - Big Data Apps on the cloud
Cassandra summit - Big Data Apps on the cloud
Uri Cohen
 

Plus de Uri Cohen (20)

Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014
 
SSDs, IMDGs and All the Rest - Jax London
SSDs, IMDGs and All the Rest - Jax LondonSSDs, IMDGs and All the Rest - Jax London
SSDs, IMDGs and All the Rest - Jax London
 
Alef event - going open source
Alef event - going open source Alef event - going open source
Alef event - going open source
 
GigaSpaces XAP for Financial Services
GigaSpaces XAP for Financial Services GigaSpaces XAP for Financial Services
GigaSpaces XAP for Financial Services
 
In Memory Data Grids, Demystified!
In Memory Data Grids, Demystified! In Memory Data Grids, Demystified!
In Memory Data Grids, Demystified!
 
App Centric Devops - CloudStack 2014 Collaboration Conference #CCNA14
App Centric Devops - CloudStack 2014 Collaboration Conference #CCNA14App Centric Devops - CloudStack 2014 Collaboration Conference #CCNA14
App Centric Devops - CloudStack 2014 Collaboration Conference #CCNA14
 
Its the app stupid - CloudStack 2014 Collaboration Conference #CCNA14
Its the app stupid - CloudStack 2014 Collaboration Conference #CCNA14 Its the app stupid - CloudStack 2014 Collaboration Conference #CCNA14
Its the app stupid - CloudStack 2014 Collaboration Conference #CCNA14
 
Deployment Automation on OpenStack with TOSCA and Cloudify
Deployment Automation on OpenStack with TOSCA and CloudifyDeployment Automation on OpenStack with TOSCA and Cloudify
Deployment Automation on OpenStack with TOSCA and Cloudify
 
Cloud stack collabiration conference - It's the app, stupid!
Cloud stack collabiration conference - It's the app, stupid!Cloud stack collabiration conference - It's the app, stupid!
Cloud stack collabiration conference - It's the app, stupid!
 
Changing organizational culture - a sweaty usecase
Changing organizational culture - a sweaty usecaseChanging organizational culture - a sweaty usecase
Changing organizational culture - a sweaty usecase
 
GigaSpaces XAP - Don't Call Me Cache!
GigaSpaces XAP - Don't Call Me Cache!GigaSpaces XAP - Don't Call Me Cache!
GigaSpaces XAP - Don't Call Me Cache!
 
OpenStack Israel Summit 2013 - It’s the App, Stupid!
OpenStack Israel Summit 2013 - It’s the App, Stupid! OpenStack Israel Summit 2013 - It’s the App, Stupid!
OpenStack Israel Summit 2013 - It’s the App, Stupid!
 
MongoDB in the Clouds
MongoDB in the CloudsMongoDB in the Clouds
MongoDB in the Clouds
 
Your Apps on the Cloud - What it really takes
Your Apps on the Cloud - What it really takes Your Apps on the Cloud - What it really takes
Your Apps on the Cloud - What it really takes
 
Cassandra summit - Big Data Apps on the cloud
Cassandra summit - Big Data Apps on the cloud Cassandra summit - Big Data Apps on the cloud
Cassandra summit - Big Data Apps on the cloud
 
Trade and Event Processing at a Massive Scale - QCon NY 2012
Trade and Event Processing at a Massive Scale - QCon NY 2012Trade and Event Processing at a Massive Scale - QCon NY 2012
Trade and Event Processing at a Massive Scale - QCon NY 2012
 
Big Data Apps on OpenStack
Big Data Apps on OpenStackBig Data Apps on OpenStack
Big Data Apps on OpenStack
 
Building a kick-ass community web site in less than a month
Building a kick-ass community web site in less than a monthBuilding a kick-ass community web site in less than a month
Building a kick-ass community web site in less than a month
 
Real Time Analytics for Big Data - A twitter inspired case study
Real Time Analytics for Big Data - A twitter inspired case studyReal Time Analytics for Big Data - A twitter inspired case study
Real Time Analytics for Big Data - A twitter inspired case study
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Yes, Sql!

  • 2. > SELECT * FROM qcon2010.speakers WHERE name=‘Uri Cohen’ +-----------------------------------------------------+ | Name | Company | Role | Twitter | +-----------------------------------------------------+ | Uri Cohen | GigaSpaces | Product Manager | @uri1803 | +-----------------------------------------------------+ 2 > db.speakers.find({name:”Uri Cohen”}) { “name”:”Uri Cohen”, “company”: { name:”GigaSpaces”, products:[“XAP”, “IMDG”] domain: “In memory data grids” } “role”:”product manager”, “twitter”:”@uri1803” }
  • 3. Agenda 3 SQL What it is and isn’t good for NoSQL Motivation & Main Concepts of Modern Distributed Data Stores Common interaction models Key/Value, Column, Document NOT consistency and distribution algorithms One Data Store, Multiple APIs Brief intro to GigaSpaces Key/Value challenges SQL challenges: Add-hoc querying, Relationships (JPA)
  • 4. A Few (more) Words About SQL 4
  • 5. SQL (Usually) Centralized  Transactional, consistent Hard to Scale 5
  • 6. SQL Static, normalized data schema Don’t duplicate, use FKs 6
  • 7. SQL Add hoc query support  Model first, query later 7
  • 8. SQL Standard  Well known  Rich ecosystem 8
  • 10. NoSql (or a Naive Attempt to Define It) A loosely coupled collection of non-relational data stores 10
  • 11. NoSql (or a Naive Attempt to Define It) (Mostly) d i s t r i b u t e d 11
  • 12. NoSql (or a Naive Attempt to Define It) scalable (Up & Out) 12
  • 13. NoSql (or a Naive Attempt to Define It) Not (always) ACID BASE anyone? 13
  • 14. Why Now? Timing is everything… Exponential Increase in data & throughput Non or semi structured data that changes frequently 14
  • 15. A Universe of Data Models 15 Key / Value Column Document { “name”:”uri”, “ssn”:”213445”, “hobbies”:[”…”,“…”], “…”: { “…”:”…” “…”:”…” } } { { ... } } { { ... } }
  • 16. Key/Value Have the key? Get the value That’s about it when it comes to querying Map/Reduce (sometimes) Good for cache aside (e.g. Hibernate 2nd level cache) Simple, id based interactions (e.g. user profiles) In most cases, values are Opaque 16
  • 17. Key/Value Scaling out is relatively easy (just hash the keys) Some will do that automatically for you Fixed vs. consistent hashing 17
  • 18. Key/Value Implementations: Memcached, Redis, Riak In memory data grids (mostly Java-based) started this way GigaSpaces, Oracle Coherence, WebSphere XS, JBoss Infinispan, etc. 18
  • 20. Column Based Mostly derived from Google’s BigTable / Amazon Dynamo papers One giant table of rows and columns Column == pair (name and a value, sometimes timestamp) Each row can have a different number of columns Table is sparse: (#rows) × (#columns) ≥ (#values) 20
  • 21. Column Based Query on row key Or column value (aka secondary index) Good for a constantly changing, (albeit flat) domain model 21
  • 22. Document Think JSON (or BSON, or XML) { “name”:”Lady Gaga”, “ssn”:”213445”, “hobbies”:[”Dressing up”,“Singing”], “albums”: [{“name”:”The fame” “release_year”:”2008”}, {“name”:”Born this way” “release_year”:”2011”}] } { { ... } } { { ... } } 22
  • 23. Document Model is not flat, data store is aware of it Arrays, nested documents Better support for ad hoc queries MongoDB excels at this Very intuitive model Flexible schema
  • 24. What if you didn’t have to choose? 24 JPA JDBC
  • 25. A Brief Intro to GigaSpaces In Memory Data Grid With optional write behind to a secondary storage 25
  • 26.
  • 27. A Brief Intro to GigaSpaces Transparent partitioning & HA Fixed hashing based on a chosen property 27
  • 28. A Brief Intro to GigaSpaces Transactional (Like, ACID) Local (single partition) Distributed (multiple partitions) 28
  • 29. Use the Right API for the Job 29 Even for the same data… POJO & JPA for Java apps with complex domain model Document for a more dynamic view Memcached for simple, language neutral data access JDBC for: Interaction with legacy apps Flexible ad-hoc querying (e.g. projections)
  • 30. Memcached (the Daemon is in the Details) MemcachedClient
  • 31. Memcached (the Daemon is in the Details) MemcachedClient
  • 32. SQL/JDBC – Query Them All 32 Query may involve Map/Reduce Reduce phase includes merging and sorting
  • 33. SQL/JDBC – Things to Consider Unique and FK constraints are not practically enforceable Sorting and aggregation may be expensive Distributed transactions are evil Stay local… 33
  • 34. JPA It’s all about relationships… 34
  • 35.
  • 36.
  • 38.