SlideShare a Scribd company logo
1 of 23
IN-MEMORY NOSQL 
GENERATING NOSQL FROM 
SQL 
TOOLS AND TECHNIQUES 
PETER MILNE 
DIRECTOR OF APPLICATION ENGINEERING 
QCON 
NYC 
JUNE 2014 
Aerospike aer . o . spike [air-oh- spahyk] 
noun, 1. tip of a rocket that enhances speed and stability 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 1
Where is the wisdom we have lost in 
knowledge? Where is the knowledge we 
have lost in information? 
-T.S.Elliot 1934 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 2 
SQL to NoSQL 
Don’t let: 
■ Information oversaturate your Knowledge 
■Knowledge distract you from Wisdom
Structured Query Language - History 
■ IBM - 1970s 
■ Originally called SEQUEL 
■ Relational Software (Oracle) – 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 3 
1979 
■ IBM DB2 - 1983 
…followed by everyone else
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 4 
Learning Databases 
■ C. J. Date 
■ Relational theory 
■ Relation Calculus 
■ Structured Query Language 
■ Rows and Columns
The World is not Rows and Columns 
Some data fits neatly into the relational model, some data does not 
■ Object to Relational Mapping 
■ Graphs 
■ Documents 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 5
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 6 
NoSQL - BigData 
Big Data 
■ NoSQL 
■ Map Reduce 
■ Analytics 
■Batch 
■Real-time 
■ Complex Event Processing 
Finding Signal in Noise
Barriers to learning something new 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 7 
■ Fashions 
■ Ritual 
■ Tradition 
■ Dogma – Right vs Wrong 
■Open systems 
■RISC 
■Normal Form 
■Object Oriented 
■Patterns 
■Java 
■Agile
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 8 
NoSQL myths 
■ NoSQL is new… is it? 
■ There is no schema, that’s bad… are you sure? 
■ No joins, I can’t live without joins… maybe you can. 
■ It uses an API not a query language… does it?
Many NoSQL/Big Data technologies provide query 
languages similar to SQL. These are “familiar” and 
easy to learn 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 9 
NoSQL – Query languages 
■ AQL – Aerospike Query Language 
■ CQL - Cassandra Query Language 
■ N1QL – Couchbase Query language 
Using a query language overcomes the barrier 
to learning NoSQL
What if we could 
Generate NoSQL from SQL 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 10
Generating NoSQL from AQL (SQL) 
Goals 
■ Translate AQL to Aerospike API calls 
■Generate the semantic equivalent API calls in sequence 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 11 
■ Complete code 
■Immediately runnable 
■ Well formed, easily readable code 
■Average developer can use it and learn from it. 
■Avoid complex “framework” hierarchies 
■ Retain the original AQL as a comment 
■ Language independent 
■Easily add new target languages
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 12 
ANTLR 
■ Terence Parr 
■ Grammar DSL 
■ Parser generator 
■ ANTLR runtime 
■ String Templates
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 13 
ANTLR - Grammars 
■ Lexer Grammar 
■ Parser Grammar 
■ Tree Grammar
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 14 
AQL Grammar 
■ Generate a parser from the Grammar 
■ The parser – LL(*) 
■Like a compiler 
■Checks syntax 
■Generates Abstract Syntax Tree 
Grammar rule 
Token 
AST Node
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 15 
Abstract Syntax Tree - AST 
■ Syntax/Grammar checking 
■ Simpler Tree 
■ Only the important semantic elements are retained 
“An abstract syntax tree (AST), or just syntax tree, is 
a tree representation of the abstract syntactic 
structure of source code written in a programming 
language. Each node of the tree denotes a construct 
occurring in the source code. The syntax is "abstract" 
in not representing every detail appearing in the real 
syntax.” 
- WIkipedia
Tree Grammar – for code generation 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 16 
■ Walk the AST 
■ Generate Code 
■String Templates 
AST Node 
String Template 
Function 
Tree Grammar rule
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 17 
String Templates 
■ Template language 
■Fill in the blanks 
■ One template for each language 
■Java 
■C# 
■…etc 
deleteStmt(source, nameSpace, setName, primaryKey) ::= << 
// <source> 
this.client.delete(this.writePolicy, 
new Key("<nameSpace>", "<setName>", 
Value.get(<primaryKey>))); 
>> 
Function name 
Java code 
Value substitution
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 18 
Complete example 
deleteStmt(source, nameSpace, setName, primaryKey) ::= << 
// <source> 
this.client.delete(this.writePolicy, 
new Key("<nameSpace>", "<setName>", Value.get(<primaryKey>))); 
>> 
String Template 
Generated Java 
Original AQL 
AQL Grammar 
Tree Grammar
Eclipse Plugin for Aerospike 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 19
My Brain is Full 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 20
http://pragprog.com/book/tpantlr/the-definitive-antlr-reference 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 21 
Books & Papers 
http://www.aerospike.com/wp-content/uploads/2012/07/VLDB-Paper.pdf 
http://www.informit.com/store/nosql-distilled-a-brief-guide-to-the-emerging-world-9780321826626
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 22 
Software 
■ Aerospike 
■ http://www.aerospike.com/free-aerospike-3-community-edition/ 
■ Tools 
■ Eclipse - http://www.eclipse.org 
■ANTLR- http://www.antlr.org 
■ StringTemplate (ANTLR) http://www.stringtemplate.org 
■Aerospike Plugin - https://github.com/aerospike/eclipse-tools
QUESTIONS? 
© 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 23 
peter@aerospike.com 
www.linkedin.com/pub/peter-milne/1/147/a86/ 
www.aerospike.com

More Related Content

Similar to Generating NoSQL from SQL

Developing on OpenStack Startup Edmonton
Developing on OpenStack Startup EdmontonDeveloping on OpenStack Startup Edmonton
Developing on OpenStack Startup Edmontonserverascode
 
Introducing ASP.NET vNext - A tour of the new ASP.NET platform
Introducing ASP.NET vNext - A tour of the new ASP.NET platformIntroducing ASP.NET vNext - A tour of the new ASP.NET platform
Introducing ASP.NET vNext - A tour of the new ASP.NET platformJeffrey T. Fritz
 
ELUNA2014: Developing and Testing an open source web application
ELUNA2014: Developing and Testing an open source web applicationELUNA2014: Developing and Testing an open source web application
ELUNA2014: Developing and Testing an open source web applicationMichael Cummings
 
Low-Cost ICS Network Performance Testing
Low-Cost ICS Network Performance TestingLow-Cost ICS Network Performance Testing
Low-Cost ICS Network Performance TestingJim Gilsinn
 
Easy applications deployment on OpenStack clouds
Easy applications deployment on OpenStack cloudsEasy applications deployment on OpenStack clouds
Easy applications deployment on OpenStack cloudsGiovanni Toraldo
 
201708 OpenStack Seminar in Myanmar
201708 OpenStack Seminar in Myanmar201708 OpenStack Seminar in Myanmar
201708 OpenStack Seminar in MyanmarTakashi Torii
 
ACID & CAP: Clearing CAP Confusion and Why C In CAP ≠ C in ACID
ACID & CAP:  Clearing CAP Confusion and Why C In CAP ≠ C in ACIDACID & CAP:  Clearing CAP Confusion and Why C In CAP ≠ C in ACID
ACID & CAP: Clearing CAP Confusion and Why C In CAP ≠ C in ACIDAerospike, Inc.
 
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...mfrancis
 
Presentation - We live in a reactive world - TechForumIberia2016
Presentation - We live in a reactive world - TechForumIberia2016Presentation - We live in a reactive world - TechForumIberia2016
Presentation - We live in a reactive world - TechForumIberia2016Sergi Castillo Malpesa
 
My EclipseCon 2014 keynote
My EclipseCon 2014 keynoteMy EclipseCon 2014 keynote
My EclipseCon 2014 keynoteMike Milinkovich
 
One-click Hadoop Cluster Deployment on OpenPOWER Systems
One-click Hadoop Cluster Deployment on OpenPOWER SystemsOne-click Hadoop Cluster Deployment on OpenPOWER Systems
One-click Hadoop Cluster Deployment on OpenPOWER SystemsPradeep Kumar
 
London SDET Meetup main presentation - How SDET can transform your organisati...
London SDET Meetup main presentation - How SDET can transform your organisati...London SDET Meetup main presentation - How SDET can transform your organisati...
London SDET Meetup main presentation - How SDET can transform your organisati...Sriram Angajala
 
BelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the BrowserBelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the BrowserEamonn Boyle
 
Big Data Certifications Workshop - 201711 - Introduction and Linux Essentials
Big Data Certifications Workshop - 201711 - Introduction and Linux EssentialsBig Data Certifications Workshop - 201711 - Introduction and Linux Essentials
Big Data Certifications Workshop - 201711 - Introduction and Linux EssentialsDurga Gadiraju
 
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014FalafelSoftware
 
Asp.net Training at NCrypted Learning Center
Asp.net Training at NCrypted Learning CenterAsp.net Training at NCrypted Learning Center
Asp.net Training at NCrypted Learning CenterNCrypted Learning Center
 

Similar to Generating NoSQL from SQL (20)

Developing on OpenStack Startup Edmonton
Developing on OpenStack Startup EdmontonDeveloping on OpenStack Startup Edmonton
Developing on OpenStack Startup Edmonton
 
Introducing ASP.NET vNext - A tour of the new ASP.NET platform
Introducing ASP.NET vNext - A tour of the new ASP.NET platformIntroducing ASP.NET vNext - A tour of the new ASP.NET platform
Introducing ASP.NET vNext - A tour of the new ASP.NET platform
 
ELUNA2014: Developing and Testing an open source web application
ELUNA2014: Developing and Testing an open source web applicationELUNA2014: Developing and Testing an open source web application
ELUNA2014: Developing and Testing an open source web application
 
Low-Cost ICS Network Performance Testing
Low-Cost ICS Network Performance TestingLow-Cost ICS Network Performance Testing
Low-Cost ICS Network Performance Testing
 
Easy applications deployment on OpenStack clouds
Easy applications deployment on OpenStack cloudsEasy applications deployment on OpenStack clouds
Easy applications deployment on OpenStack clouds
 
201708 OpenStack Seminar in Myanmar
201708 OpenStack Seminar in Myanmar201708 OpenStack Seminar in Myanmar
201708 OpenStack Seminar in Myanmar
 
ACID & CAP: Clearing CAP Confusion and Why C In CAP ≠ C in ACID
ACID & CAP:  Clearing CAP Confusion and Why C In CAP ≠ C in ACIDACID & CAP:  Clearing CAP Confusion and Why C In CAP ≠ C in ACID
ACID & CAP: Clearing CAP Confusion and Why C In CAP ≠ C in ACID
 
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
 
OISF - AppSec Presentation
OISF - AppSec PresentationOISF - AppSec Presentation
OISF - AppSec Presentation
 
OpenStack for Rookies @ IPN
OpenStack for Rookies @ IPNOpenStack for Rookies @ IPN
OpenStack for Rookies @ IPN
 
Presentation - We live in a reactive world - TechForumIberia2016
Presentation - We live in a reactive world - TechForumIberia2016Presentation - We live in a reactive world - TechForumIberia2016
Presentation - We live in a reactive world - TechForumIberia2016
 
My EclipseCon 2014 keynote
My EclipseCon 2014 keynoteMy EclipseCon 2014 keynote
My EclipseCon 2014 keynote
 
One-click Hadoop Cluster Deployment on OpenPOWER Systems
One-click Hadoop Cluster Deployment on OpenPOWER SystemsOne-click Hadoop Cluster Deployment on OpenPOWER Systems
One-click Hadoop Cluster Deployment on OpenPOWER Systems
 
London SDET Meetup main presentation - How SDET can transform your organisati...
London SDET Meetup main presentation - How SDET can transform your organisati...London SDET Meetup main presentation - How SDET can transform your organisati...
London SDET Meetup main presentation - How SDET can transform your organisati...
 
Spark Uber Development Kit
Spark Uber Development KitSpark Uber Development Kit
Spark Uber Development Kit
 
BelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the BrowserBelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the Browser
 
Big Data Certifications Workshop - 201711 - Introduction and Linux Essentials
Big Data Certifications Workshop - 201711 - Introduction and Linux EssentialsBig Data Certifications Workshop - 201711 - Introduction and Linux Essentials
Big Data Certifications Workshop - 201711 - Introduction and Linux Essentials
 
Intro to ES6 / ES2015
Intro to ES6 / ES2015Intro to ES6 / ES2015
Intro to ES6 / ES2015
 
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014
 
Asp.net Training at NCrypted Learning Center
Asp.net Training at NCrypted Learning CenterAsp.net Training at NCrypted Learning Center
Asp.net Training at NCrypted Learning Center
 

More from Peter Milne

Achieving High Load in Advertising Technology
Achieving High Load in Advertising TechnologyAchieving High Load in Advertising Technology
Achieving High Load in Advertising TechnologyPeter Milne
 
Glue con denver may 2015 sql to nosql
Glue con denver may 2015 sql to nosqlGlue con denver may 2015 sql to nosql
Glue con denver may 2015 sql to nosqlPeter Milne
 
Principles of High Load - Vilnius January 2015
Principles of High Load - Vilnius January 2015Principles of High Load - Vilnius January 2015
Principles of High Load - Vilnius January 2015Peter Milne
 
Aerospike Architecture
Aerospike ArchitectureAerospike Architecture
Aerospike ArchitecturePeter Milne
 
Real Time Analytics
Real Time AnalyticsReal Time Analytics
Real Time AnalyticsPeter Milne
 
Aerospike Architecture
Aerospike ArchitectureAerospike Architecture
Aerospike ArchitecturePeter Milne
 

More from Peter Milne (6)

Achieving High Load in Advertising Technology
Achieving High Load in Advertising TechnologyAchieving High Load in Advertising Technology
Achieving High Load in Advertising Technology
 
Glue con denver may 2015 sql to nosql
Glue con denver may 2015 sql to nosqlGlue con denver may 2015 sql to nosql
Glue con denver may 2015 sql to nosql
 
Principles of High Load - Vilnius January 2015
Principles of High Load - Vilnius January 2015Principles of High Load - Vilnius January 2015
Principles of High Load - Vilnius January 2015
 
Aerospike Architecture
Aerospike ArchitectureAerospike Architecture
Aerospike Architecture
 
Real Time Analytics
Real Time AnalyticsReal Time Analytics
Real Time Analytics
 
Aerospike Architecture
Aerospike ArchitectureAerospike Architecture
Aerospike Architecture
 

Recently uploaded

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)wesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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 CVKhem
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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 RobisonAnna Loughnan Colquhoun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

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)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Generating NoSQL from SQL

  • 1. IN-MEMORY NOSQL GENERATING NOSQL FROM SQL TOOLS AND TECHNIQUES PETER MILNE DIRECTOR OF APPLICATION ENGINEERING QCON NYC JUNE 2014 Aerospike aer . o . spike [air-oh- spahyk] noun, 1. tip of a rocket that enhances speed and stability © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 1
  • 2. Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information? -T.S.Elliot 1934 © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 2 SQL to NoSQL Don’t let: ■ Information oversaturate your Knowledge ■Knowledge distract you from Wisdom
  • 3. Structured Query Language - History ■ IBM - 1970s ■ Originally called SEQUEL ■ Relational Software (Oracle) – © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 3 1979 ■ IBM DB2 - 1983 …followed by everyone else
  • 4. © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 4 Learning Databases ■ C. J. Date ■ Relational theory ■ Relation Calculus ■ Structured Query Language ■ Rows and Columns
  • 5. The World is not Rows and Columns Some data fits neatly into the relational model, some data does not ■ Object to Relational Mapping ■ Graphs ■ Documents © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 5
  • 6. © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 6 NoSQL - BigData Big Data ■ NoSQL ■ Map Reduce ■ Analytics ■Batch ■Real-time ■ Complex Event Processing Finding Signal in Noise
  • 7. Barriers to learning something new © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 7 ■ Fashions ■ Ritual ■ Tradition ■ Dogma – Right vs Wrong ■Open systems ■RISC ■Normal Form ■Object Oriented ■Patterns ■Java ■Agile
  • 8. © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 8 NoSQL myths ■ NoSQL is new… is it? ■ There is no schema, that’s bad… are you sure? ■ No joins, I can’t live without joins… maybe you can. ■ It uses an API not a query language… does it?
  • 9. Many NoSQL/Big Data technologies provide query languages similar to SQL. These are “familiar” and easy to learn © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 9 NoSQL – Query languages ■ AQL – Aerospike Query Language ■ CQL - Cassandra Query Language ■ N1QL – Couchbase Query language Using a query language overcomes the barrier to learning NoSQL
  • 10. What if we could Generate NoSQL from SQL © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 10
  • 11. Generating NoSQL from AQL (SQL) Goals ■ Translate AQL to Aerospike API calls ■Generate the semantic equivalent API calls in sequence © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 11 ■ Complete code ■Immediately runnable ■ Well formed, easily readable code ■Average developer can use it and learn from it. ■Avoid complex “framework” hierarchies ■ Retain the original AQL as a comment ■ Language independent ■Easily add new target languages
  • 12. © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 12 ANTLR ■ Terence Parr ■ Grammar DSL ■ Parser generator ■ ANTLR runtime ■ String Templates
  • 13. © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 13 ANTLR - Grammars ■ Lexer Grammar ■ Parser Grammar ■ Tree Grammar
  • 14. © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 14 AQL Grammar ■ Generate a parser from the Grammar ■ The parser – LL(*) ■Like a compiler ■Checks syntax ■Generates Abstract Syntax Tree Grammar rule Token AST Node
  • 15. © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 15 Abstract Syntax Tree - AST ■ Syntax/Grammar checking ■ Simpler Tree ■ Only the important semantic elements are retained “An abstract syntax tree (AST), or just syntax tree, is a tree representation of the abstract syntactic structure of source code written in a programming language. Each node of the tree denotes a construct occurring in the source code. The syntax is "abstract" in not representing every detail appearing in the real syntax.” - WIkipedia
  • 16. Tree Grammar – for code generation © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 16 ■ Walk the AST ■ Generate Code ■String Templates AST Node String Template Function Tree Grammar rule
  • 17. © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 17 String Templates ■ Template language ■Fill in the blanks ■ One template for each language ■Java ■C# ■…etc deleteStmt(source, nameSpace, setName, primaryKey) ::= << // <source> this.client.delete(this.writePolicy, new Key("<nameSpace>", "<setName>", Value.get(<primaryKey>))); >> Function name Java code Value substitution
  • 18. © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 18 Complete example deleteStmt(source, nameSpace, setName, primaryKey) ::= << // <source> this.client.delete(this.writePolicy, new Key("<nameSpace>", "<setName>", Value.get(<primaryKey>))); >> String Template Generated Java Original AQL AQL Grammar Tree Grammar
  • 19. Eclipse Plugin for Aerospike © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 19
  • 20. My Brain is Full © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 20
  • 21. http://pragprog.com/book/tpantlr/the-definitive-antlr-reference © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 21 Books & Papers http://www.aerospike.com/wp-content/uploads/2012/07/VLDB-Paper.pdf http://www.informit.com/store/nosql-distilled-a-brief-guide-to-the-emerging-world-9780321826626
  • 22. © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 22 Software ■ Aerospike ■ http://www.aerospike.com/free-aerospike-3-community-edition/ ■ Tools ■ Eclipse - http://www.eclipse.org ■ANTLR- http://www.antlr.org ■ StringTemplate (ANTLR) http://www.stringtemplate.org ■Aerospike Plugin - https://github.com/aerospike/eclipse-tools
  • 23. QUESTIONS? © 2014 Aerospike, Inc. All rights reserved. Confidential. | QCon NYC – June 2014 | 23 peter@aerospike.com www.linkedin.com/pub/peter-milne/1/147/a86/ www.aerospike.com

Editor's Notes

  1. SEQUEL (Structured English Query Language)1
  2. Anecdote: Rational ClearCase at NAB
  3. LL parser is a top-down parser for a subset of context-free languages. It parses the input from Left to right, performing Leftmost derivation of the sentence.