SlideShare a Scribd company logo
Stored Procedure Superpowers
A guide for anyone writing (or considering writing) VoltDB stored procedures
May 19th, 2016 / John Hugg / @johnhugg
Who Am I?
• First developer on the VoltDB project.
• Previously at Vertica and other data
startups.
• Have made so many bad decisions
over the years, that now I almost know
what I'm talking about.
• jhugg@voltdb.com
• @johnhugg
• http://chat.voltdb.com
Today’s Talk
1. Why do people hate stored procedures?
2. It doesn’t matter; you’re going to use them; here’s why.

Subtitle: “Stored Procedures are Awesome!”
3. Given that…

What has VoltDB done to make you hate stored procedures less?

Subtitle: “Practical Stuff!”
Not Today’s Talk
All of the VoltDB stuff we cover in other talks, documentation,
examples, tutorials, Volt University, etc…
This includes:
• How to partition schema and operations (docs, VoltU, examples)
• Why procedures should be deterministic (docs, talks)
• How to use general VoltDB features (docs, examples)
Why Do People
Hate Stored
Procedures?
Stored procedure languages are one-offs
Can’t be debugged in an IDE
Error messages are often unhelpful
Parameters are inflexible
Stored procedures hide business logic
Stored procedures separate logic into two pieces
http://blog.codinghorror.com/who-needs-stored-procedures-anyways/
WhytheHate?
We’re going to
use stored
procedures
anyway.
A Relevant Comparison
Remote Local
10 million packets per second
(10GigE)
500 gigaflops
(one CPU)
500,000 ns
to fetch across a network
80 ns
to fetch from main memory
3-Prong Efficiency Argument
For OLTP workloads, stored procedures mean:
• More throughput and less latency for the same cost
• More complexity and power for the same cost
• Stronger consistency (CAP & ACID) for the same cost
All of the Above
Boring Math Latency Argument
• Latency is not uniform. 

Let’s say 1 of 20 messages takes > 5ms to deliver.

Let’s say 19 of 20 take < 1ms.
• If transaction A requires 1 network round trip, 95% of responses will
be under 1ms.
• If transaction B requires 5 network round trips, 75% of responses will
be under 5ms.
Boring Math Latency Argument 2
• When you replace 10 RTs with 1 RT, your 99% latency percentile
becomes your 99.9% latency percentile (by math).
More boring latency. Ugh.
Stored Proc Client-Side Txn Logic
t0: Grab a Lock 1 µs 1 µs
t1: Send data to logic 250 µs
t2: Do Biz Logic 10 µs 10 µs
t3: Respond over network 250 µs
t4: Make Updates 10 µs 10 µs
t5: Release Lock 1 µs 1 µs
Total 22 µs 522 µs
More boring latency. Ugh.
Stored Proc Client-Side Txn Logic
t0: Grab a Lock 1 µs 1 µs
t1: Send data to logic 250 µs
t2: Do Biz Logic 10 µs 10 µs
t3: Respond over network 250 µs
t4: Make Updates 10 µs 10 µs
t5: Release Lock 1 µs 1 µs
Total 22 µs 522 µs
Holding a lock for 24x longer 

means more contention.
More contention 

means even more latency.
Stored Procedure Performance
• Moving data is harder than
moving logic
• No lock holding during a
network round trip
• Logical representation is
smaller on the wire or disk
Stored procedure languages are one-offs
Can’t be debugged in an IDE
Error messages are often unhelpful
Parameters are inflexible
Stored procedures hide business logic
Stored procedures separate logic into two pieces
http://blog.codinghorror.com/who-needs-stored-procedures-anyways/
WhytheHate?
Stored procedure languages are one-offs
Can’t be debugged in an IDE
Error messages are often unhelpful
Parameters are inflexible
Stored procedures hide business logic
Stored procedures separate logic into two pieces
http://blog.codinghorror.com/who-needs-stored-procedures-anyways/
WhytheHate?
ImplementationLegit
Procedure API
Microservices, Microservices, Microservices
Your App’s
State
Schema
Constraint
User
ConstraintClient
Application
Procs let you enforce more powerful constraints
Unique
Foreign Key
Triggers
No customer has more than 6 open orders.
Only one employee at each company has no boss.
No print job requires more than 10ml of ink.
Use Different Clients With Shared Logic
Procedure API
Your App’s
State
Client
Application
Java
Client
Application
C++
Client
Application
Node.js
ReserveSeat
ReserveSeat
ReserveSeat
Change Logic Centrally
Procedure API
Contains ReserveSeat
1.0 logic
Your App’s
State
Client
Application
Java
Client
Application
C++
Client
Application
Node.js
ReserveSeat
ReserveSeat
ReserveSeat
Change Logic Centrally
Procedure API
Contains ReserveSeat
1.0 logic
Your App’s
State
Client
Application
Java
Client
Application
C++
Client
Application
Node.js
ReserveSeat
ReserveSeat
ReserveSeat
Procedure API
Contains ReserveSeat
2.0 logic
Change Logic Centrally
Your App’s
State
Client
Application
Java
Client
Application
C++
Client
Application
Node.js
ReserveSeat
ReserveSeat
ReserveSeat Procedure API
Contains ReserveSeat
2.0 logic
So…
100% Stored
Procedures Then?
Why you might not care…
Slower Apps
• I run the VoltDB forums on MySQL.
• Peak traffic is about 1 TPS in actual writes.
• It runs on the smallest Linode instance and is mostly idle.
• Optimizing this is pretty dumb.
• This example is clear, but where is the line?
Analytics
• How many purple hats were sold on Tuesdays in March when it was
raining?
• I can answer that with a SQL query. A stored proc won’t buy me
much.
Performance Benefit of Stored Procedures
KV CRUD Complex Transactional Logic
Do it when it pays off
• If you don’t have transactional logic, the argument for stored
procedures becomes much less strong.
• You’re down to saving round trips — though that can be a big
difference for high performance apps.
Optimization Rules Apply
Operation 1 Operation 2
Takes 100ms instead of 1ms Takes 3ms instead of 1ms
Runs once per second Runs 25k times per second
Optimization saves 10% of one CPU Optimization saves 50 CPUs
Stored procedure languages are one-offs
Can’t be debugged in an IDE
Error messages are often unhelpful
Parameters are inflexible
Stored procedures hide business logic
Stored procedures separate logic into two pieces
http://blog.codinghorror.com/who-needs-stored-procedures-anyways/
WhytheHate?
ImplementationLegit
One-OffLanguages?
Use Java
One-OffLanguages?
Why Java
• Familiarity and Popularity
• IDEs
• Safety
• Performance
• Code as Data / Hot Swap Code
• Other JVM Languages
Alternatives:
Lua / Javascript
Example
Understanding the API
RevisionControl
Can’tDebuginIDE
Example
in
Eclipse
Can’tDebuginIDE
UnhelpfulErrors
Stack
Traces!
Custom
Errors
UnhelpfulErrors
InflexibleParameters
Many Types
Arrays
JSON
Blobs
Compression
Avro/Protobufs/etc
InflexibleParameters
Examples!
https://github.com/VoltDB/app-debug-and-test
W
IP
InProcessVoltDBServer API
• InProcessVoltDBServer configPartitionCount(int partitionCount);
• InProcessVoltDBServer configPathToLicense(String path);
• InProcessVoltDBServer start();
• InProcessVoltDBServer runDDLFromPath(String path);
• InProcessVoltDBServer runDDLFromString(String ddl);
• Client getClient();
• void loadRow(String tableName, Object... row);
• void shutdown();
Close Slides Now John.
More?
Partitioning
Async Clients
Understanding 

SQL Plans
Using Indexes Well
http://docs.voltdb.com
http://university.voltdb.com
https://github.com/VoltDB/voltdb/tree/master/examples
Conclusion & Thanks
• Stored procs get a
mostly undeserved
bad rap
• To go fast, they make
tons of sense
• There are advantages
besides speed
jhugg@voltdb.com / @johnhugg / chat.voltdb.com

More Related Content

What's hot

VoltDB and HPE Vertica Present: Building an IoT Architecture for Fast + Big Data
VoltDB and HPE Vertica Present: Building an IoT Architecture for Fast + Big DataVoltDB and HPE Vertica Present: Building an IoT Architecture for Fast + Big Data
VoltDB and HPE Vertica Present: Building an IoT Architecture for Fast + Big Data
VoltDB
 
The Expert Guide to Fast Data
The Expert Guide to Fast Data The Expert Guide to Fast Data
The Expert Guide to Fast Data
VoltDB
 
How to Build Cloud-based Microservice Environments with Docker and VoltDB
How to Build Cloud-based Microservice Environments with Docker and VoltDBHow to Build Cloud-based Microservice Environments with Docker and VoltDB
How to Build Cloud-based Microservice Environments with Docker and VoltDB
VoltDB
 
Fast Data – the New Big Data
Fast Data – the New Big DataFast Data – the New Big Data
Fast Data – the New Big Data
VoltDB
 
Memory Database Technology is Driving a New Cycle of Business Innovation
Memory Database Technology is Driving a New Cycle of Business InnovationMemory Database Technology is Driving a New Cycle of Business Innovation
Memory Database Technology is Driving a New Cycle of Business Innovation
VoltDB
 
Big Data at a Gaming Company: Spil Games
Big Data at a Gaming Company: Spil GamesBig Data at a Gaming Company: Spil Games
Big Data at a Gaming Company: Spil Games
Rob Winters
 
Transforming Your Business with Fast Data – Five Use Case Examples
Transforming Your Business with Fast Data – Five Use Case ExamplesTransforming Your Business with Fast Data – Five Use Case Examples
Transforming Your Business with Fast Data – Five Use Case Examples
VoltDB
 
Real-time Big Data Analytics in the IBM SoftLayer Cloud with VoltDB
Real-time Big Data Analytics in the IBM SoftLayer Cloud with VoltDBReal-time Big Data Analytics in the IBM SoftLayer Cloud with VoltDB
Real-time Big Data Analytics in the IBM SoftLayer Cloud with VoltDB
VoltDB
 
How to Build Fast Data Applications: Evaluating the Top Contenders
How to Build Fast Data Applications: Evaluating the Top ContendersHow to Build Fast Data Applications: Evaluating the Top Contenders
How to Build Fast Data Applications: Evaluating the Top Contenders
VoltDB
 
DataOps - Lean principles and lean practices
DataOps - Lean principles and lean practicesDataOps - Lean principles and lean practices
DataOps - Lean principles and lean practices
Lars Albertsson
 
VoltDB and Flytxt Present: Building a Single Technology Platform for Real-Tim...
VoltDB and Flytxt Present: Building a Single Technology Platform for Real-Tim...VoltDB and Flytxt Present: Building a Single Technology Platform for Real-Tim...
VoltDB and Flytxt Present: Building a Single Technology Platform for Real-Tim...
VoltDB
 
HP Discover: Real Time Insights from Big Data
HP Discover: Real Time Insights from Big DataHP Discover: Real Time Insights from Big Data
HP Discover: Real Time Insights from Big Data
Rob Winters
 
Billions of Rows, Millions of Insights, Right Now
Billions of Rows, Millions of Insights, Right NowBillions of Rows, Millions of Insights, Right Now
Billions of Rows, Millions of Insights, Right Now
Rob Winters
 
Architecting for Real-Time Big Data Analytics
Architecting for Real-Time Big Data AnalyticsArchitecting for Real-Time Big Data Analytics
Architecting for Real-Time Big Data Analytics
Rob Winters
 
Stream Processing as Game Changer for Big Data and Internet of Things by Kai ...
Stream Processing as Game Changer for Big Data and Internet of Things by Kai ...Stream Processing as Game Changer for Big Data and Internet of Things by Kai ...
Stream Processing as Game Changer for Big Data and Internet of Things by Kai ...
Big Data Spain
 
The right side of speed - learning to shift left
The right side of speed - learning to shift leftThe right side of speed - learning to shift left
The right side of speed - learning to shift left
Lars Albertsson
 
Rapid Data Analytics @ Netflix
Rapid Data Analytics @ NetflixRapid Data Analytics @ Netflix
Rapid Data Analytics @ Netflix
Data Con LA
 
How DataStax Enterprise and Azure Make Your Apps Scale from Day 1
How DataStax Enterprise and Azure Make Your Apps Scale from Day 1How DataStax Enterprise and Azure Make Your Apps Scale from Day 1
How DataStax Enterprise and Azure Make Your Apps Scale from Day 1
DataStax
 
Developing and Implementing a QA Plan During Your Legacy Data to S1000D
Developing and Implementing a QA Plan During Your Legacy Data to S1000DDeveloping and Implementing a QA Plan During Your Legacy Data to S1000D
Developing and Implementing a QA Plan During Your Legacy Data to S1000D
dclsocialmedia
 
MongoDB Days UK: Tales from the Field
MongoDB Days UK: Tales from the FieldMongoDB Days UK: Tales from the Field
MongoDB Days UK: Tales from the Field
MongoDB
 

What's hot (20)

VoltDB and HPE Vertica Present: Building an IoT Architecture for Fast + Big Data
VoltDB and HPE Vertica Present: Building an IoT Architecture for Fast + Big DataVoltDB and HPE Vertica Present: Building an IoT Architecture for Fast + Big Data
VoltDB and HPE Vertica Present: Building an IoT Architecture for Fast + Big Data
 
The Expert Guide to Fast Data
The Expert Guide to Fast Data The Expert Guide to Fast Data
The Expert Guide to Fast Data
 
How to Build Cloud-based Microservice Environments with Docker and VoltDB
How to Build Cloud-based Microservice Environments with Docker and VoltDBHow to Build Cloud-based Microservice Environments with Docker and VoltDB
How to Build Cloud-based Microservice Environments with Docker and VoltDB
 
Fast Data – the New Big Data
Fast Data – the New Big DataFast Data – the New Big Data
Fast Data – the New Big Data
 
Memory Database Technology is Driving a New Cycle of Business Innovation
Memory Database Technology is Driving a New Cycle of Business InnovationMemory Database Technology is Driving a New Cycle of Business Innovation
Memory Database Technology is Driving a New Cycle of Business Innovation
 
Big Data at a Gaming Company: Spil Games
Big Data at a Gaming Company: Spil GamesBig Data at a Gaming Company: Spil Games
Big Data at a Gaming Company: Spil Games
 
Transforming Your Business with Fast Data – Five Use Case Examples
Transforming Your Business with Fast Data – Five Use Case ExamplesTransforming Your Business with Fast Data – Five Use Case Examples
Transforming Your Business with Fast Data – Five Use Case Examples
 
Real-time Big Data Analytics in the IBM SoftLayer Cloud with VoltDB
Real-time Big Data Analytics in the IBM SoftLayer Cloud with VoltDBReal-time Big Data Analytics in the IBM SoftLayer Cloud with VoltDB
Real-time Big Data Analytics in the IBM SoftLayer Cloud with VoltDB
 
How to Build Fast Data Applications: Evaluating the Top Contenders
How to Build Fast Data Applications: Evaluating the Top ContendersHow to Build Fast Data Applications: Evaluating the Top Contenders
How to Build Fast Data Applications: Evaluating the Top Contenders
 
DataOps - Lean principles and lean practices
DataOps - Lean principles and lean practicesDataOps - Lean principles and lean practices
DataOps - Lean principles and lean practices
 
VoltDB and Flytxt Present: Building a Single Technology Platform for Real-Tim...
VoltDB and Flytxt Present: Building a Single Technology Platform for Real-Tim...VoltDB and Flytxt Present: Building a Single Technology Platform for Real-Tim...
VoltDB and Flytxt Present: Building a Single Technology Platform for Real-Tim...
 
HP Discover: Real Time Insights from Big Data
HP Discover: Real Time Insights from Big DataHP Discover: Real Time Insights from Big Data
HP Discover: Real Time Insights from Big Data
 
Billions of Rows, Millions of Insights, Right Now
Billions of Rows, Millions of Insights, Right NowBillions of Rows, Millions of Insights, Right Now
Billions of Rows, Millions of Insights, Right Now
 
Architecting for Real-Time Big Data Analytics
Architecting for Real-Time Big Data AnalyticsArchitecting for Real-Time Big Data Analytics
Architecting for Real-Time Big Data Analytics
 
Stream Processing as Game Changer for Big Data and Internet of Things by Kai ...
Stream Processing as Game Changer for Big Data and Internet of Things by Kai ...Stream Processing as Game Changer for Big Data and Internet of Things by Kai ...
Stream Processing as Game Changer for Big Data and Internet of Things by Kai ...
 
The right side of speed - learning to shift left
The right side of speed - learning to shift leftThe right side of speed - learning to shift left
The right side of speed - learning to shift left
 
Rapid Data Analytics @ Netflix
Rapid Data Analytics @ NetflixRapid Data Analytics @ Netflix
Rapid Data Analytics @ Netflix
 
How DataStax Enterprise and Azure Make Your Apps Scale from Day 1
How DataStax Enterprise and Azure Make Your Apps Scale from Day 1How DataStax Enterprise and Azure Make Your Apps Scale from Day 1
How DataStax Enterprise and Azure Make Your Apps Scale from Day 1
 
Developing and Implementing a QA Plan During Your Legacy Data to S1000D
Developing and Implementing a QA Plan During Your Legacy Data to S1000DDeveloping and Implementing a QA Plan During Your Legacy Data to S1000D
Developing and Implementing a QA Plan During Your Legacy Data to S1000D
 
MongoDB Days UK: Tales from the Field
MongoDB Days UK: Tales from the FieldMongoDB Days UK: Tales from the Field
MongoDB Days UK: Tales from the Field
 

Similar to Stored Procedure Superpowers: A Developer’s Guide

E2 evc 3-2-1-rule - mikeresseler
E2 evc   3-2-1-rule - mikeresselerE2 evc   3-2-1-rule - mikeresseler
E2 evc 3-2-1-rule - mikeresseler
Mike Resseler
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the World
jhugg
 
Building Scalable Applications using Pivotal Gemfire/Apache Geode
Building Scalable Applications using Pivotal Gemfire/Apache GeodeBuilding Scalable Applications using Pivotal Gemfire/Apache Geode
Building Scalable Applications using Pivotal Gemfire/Apache Geode
imcpune
 
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Databricks
 
Azure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesAzure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challenges
Ivo Andreev
 
Choosing the right parallel compute architecture
Choosing the right parallel compute architecture Choosing the right parallel compute architecture
Choosing the right parallel compute architecture
corehard_by
 
Managing the Complexities of Conversion to S1000D
Managing the Complexities of Conversion to S1000DManaging the Complexities of Conversion to S1000D
Managing the Complexities of Conversion to S1000D
dclsocialmedia
 
Magento Live UK Nexcess Performance & Security Session
Magento Live UK Nexcess Performance & Security SessionMagento Live UK Nexcess Performance & Security Session
Magento Live UK Nexcess Performance & Security Session
Nexcess.net LLC
 
High Frequency Trading and NoSQL database
High Frequency Trading and NoSQL databaseHigh Frequency Trading and NoSQL database
High Frequency Trading and NoSQL database
Peter Lawrey
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
Łukasz Sowa
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
Alex Moskvin
 
Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
Databricks
 
Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...
Sergey Platonov
 
Natural Laws of Software Performance
Natural Laws of Software PerformanceNatural Laws of Software Performance
Natural Laws of Software Performance
Gibraltar Software
 
Scaling apps for the big time
Scaling apps for the big timeScaling apps for the big time
Scaling apps for the big time
proitconsult
 
PLNOG 6: Piotr Modzelewski, Bartłomiej Rymarski - Product Catalogue - Case Study
PLNOG 6: Piotr Modzelewski, Bartłomiej Rymarski - Product Catalogue - Case StudyPLNOG 6: Piotr Modzelewski, Bartłomiej Rymarski - Product Catalogue - Case Study
PLNOG 6: Piotr Modzelewski, Bartłomiej Rymarski - Product Catalogue - Case Study
PROIDEA
 
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACLPerformance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
TriNimbus
 
Scaling Systems: Architectures that grow
Scaling Systems: Architectures that growScaling Systems: Architectures that grow
Scaling Systems: Architectures that grow
Gibraltar Software
 
MagentoLive Australia 2014 - The Importance of Performance & Security and Sim...
MagentoLive Australia 2014 - The Importance of Performance & Security and Sim...MagentoLive Australia 2014 - The Importance of Performance & Security and Sim...
MagentoLive Australia 2014 - The Importance of Performance & Security and Sim...
Nexcess.net LLC
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
Ryusuke Kajiyama
 

Similar to Stored Procedure Superpowers: A Developer’s Guide (20)

E2 evc 3-2-1-rule - mikeresseler
E2 evc   3-2-1-rule - mikeresselerE2 evc   3-2-1-rule - mikeresseler
E2 evc 3-2-1-rule - mikeresseler
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the World
 
Building Scalable Applications using Pivotal Gemfire/Apache Geode
Building Scalable Applications using Pivotal Gemfire/Apache GeodeBuilding Scalable Applications using Pivotal Gemfire/Apache Geode
Building Scalable Applications using Pivotal Gemfire/Apache Geode
 
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
 
Azure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesAzure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challenges
 
Choosing the right parallel compute architecture
Choosing the right parallel compute architecture Choosing the right parallel compute architecture
Choosing the right parallel compute architecture
 
Managing the Complexities of Conversion to S1000D
Managing the Complexities of Conversion to S1000DManaging the Complexities of Conversion to S1000D
Managing the Complexities of Conversion to S1000D
 
Magento Live UK Nexcess Performance & Security Session
Magento Live UK Nexcess Performance & Security SessionMagento Live UK Nexcess Performance & Security Session
Magento Live UK Nexcess Performance & Security Session
 
High Frequency Trading and NoSQL database
High Frequency Trading and NoSQL databaseHigh Frequency Trading and NoSQL database
High Frequency Trading and NoSQL database
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
 
Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
 
Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...
 
Natural Laws of Software Performance
Natural Laws of Software PerformanceNatural Laws of Software Performance
Natural Laws of Software Performance
 
Scaling apps for the big time
Scaling apps for the big timeScaling apps for the big time
Scaling apps for the big time
 
PLNOG 6: Piotr Modzelewski, Bartłomiej Rymarski - Product Catalogue - Case Study
PLNOG 6: Piotr Modzelewski, Bartłomiej Rymarski - Product Catalogue - Case StudyPLNOG 6: Piotr Modzelewski, Bartłomiej Rymarski - Product Catalogue - Case Study
PLNOG 6: Piotr Modzelewski, Bartłomiej Rymarski - Product Catalogue - Case Study
 
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACLPerformance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
 
Scaling Systems: Architectures that grow
Scaling Systems: Architectures that growScaling Systems: Architectures that grow
Scaling Systems: Architectures that grow
 
MagentoLive Australia 2014 - The Importance of Performance & Security and Sim...
MagentoLive Australia 2014 - The Importance of Performance & Security and Sim...MagentoLive Australia 2014 - The Importance of Performance & Security and Sim...
MagentoLive Australia 2014 - The Importance of Performance & Security and Sim...
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
 

More from VoltDB

TripleLift: Preparing for a New Programmatic Ad-Tech World
TripleLift: Preparing for a New Programmatic Ad-Tech WorldTripleLift: Preparing for a New Programmatic Ad-Tech World
TripleLift: Preparing for a New Programmatic Ad-Tech World
VoltDB
 
Understanding the Top Four Use Cases for IoT
Understanding the Top Four Use Cases for IoTUnderstanding the Top Four Use Cases for IoT
Understanding the Top Four Use Cases for IoT
VoltDB
 
Moving Beyond Batch: Transactional Databases for Real-time Data
Moving Beyond Batch: Transactional Databases for Real-time DataMoving Beyond Batch: Transactional Databases for Real-time Data
Moving Beyond Batch: Transactional Databases for Real-time Data
VoltDB
 
Why you really want SQL in a Real-Time Enterprise Environment
Why you really want SQL in a Real-Time Enterprise EnvironmentWhy you really want SQL in a Real-Time Enterprise Environment
Why you really want SQL in a Real-Time Enterprise Environment
VoltDB
 
How First to Value Beats First to Market: Case Studies of Fast Data Success
How First to Value Beats First to Market: Case Studies of Fast Data SuccessHow First to Value Beats First to Market: Case Studies of Fast Data Success
How First to Value Beats First to Market: Case Studies of Fast Data Success
VoltDB
 
Lessons Learned: The Impact of Fast Data for Personalization
Lessons Learned: The Impact of Fast Data for PersonalizationLessons Learned: The Impact of Fast Data for Personalization
Lessons Learned: The Impact of Fast Data for Personalization
VoltDB
 
Fast Data for Competitive Advantage: 4 Steps to Expand your Window of Opportu...
Fast Data for Competitive Advantage: 4 Steps to Expand your Window of Opportu...Fast Data for Competitive Advantage: 4 Steps to Expand your Window of Opportu...
Fast Data for Competitive Advantage: 4 Steps to Expand your Window of Opportu...
VoltDB
 
Understanding the Operational Database Infrastructure for IoT and Fast Data
Understanding the Operational Database Infrastructure for IoT and Fast DataUnderstanding the Operational Database Infrastructure for IoT and Fast Data
Understanding the Operational Database Infrastructure for IoT and Fast Data
VoltDB
 
The Two Generals Problem
The Two Generals ProblemThe Two Generals Problem
The Two Generals Problem
VoltDB
 
The 10 MS Rule: Getting to 'Yes' with Fast Data & Hadoop
The 10 MS Rule: Getting to 'Yes' with Fast Data & HadoopThe 10 MS Rule: Getting to 'Yes' with Fast Data & Hadoop
The 10 MS Rule: Getting to 'Yes' with Fast Data & Hadoop
VoltDB
 
The State of Streaming Analytics: The Need for Speed and Scale
The State of Streaming Analytics: The Need for Speed and ScaleThe State of Streaming Analytics: The Need for Speed and Scale
The State of Streaming Analytics: The Need for Speed and Scale
VoltDB
 
Fast Data: Achieving Real-Time Data Analysis Across the Financial Data Continuum
Fast Data: Achieving Real-Time Data Analysis Across the Financial Data ContinuumFast Data: Achieving Real-Time Data Analysis Across the Financial Data Continuum
Fast Data: Achieving Real-Time Data Analysis Across the Financial Data Continuum
VoltDB
 
How to Build Real-Time Streaming Analytics with an In-memory, Scale-out SQL D...
How to Build Real-Time Streaming Analytics with an In-memory, Scale-out SQL D...How to Build Real-Time Streaming Analytics with an In-memory, Scale-out SQL D...
How to Build Real-Time Streaming Analytics with an In-memory, Scale-out SQL D...
VoltDB
 

More from VoltDB (13)

TripleLift: Preparing for a New Programmatic Ad-Tech World
TripleLift: Preparing for a New Programmatic Ad-Tech WorldTripleLift: Preparing for a New Programmatic Ad-Tech World
TripleLift: Preparing for a New Programmatic Ad-Tech World
 
Understanding the Top Four Use Cases for IoT
Understanding the Top Four Use Cases for IoTUnderstanding the Top Four Use Cases for IoT
Understanding the Top Four Use Cases for IoT
 
Moving Beyond Batch: Transactional Databases for Real-time Data
Moving Beyond Batch: Transactional Databases for Real-time DataMoving Beyond Batch: Transactional Databases for Real-time Data
Moving Beyond Batch: Transactional Databases for Real-time Data
 
Why you really want SQL in a Real-Time Enterprise Environment
Why you really want SQL in a Real-Time Enterprise EnvironmentWhy you really want SQL in a Real-Time Enterprise Environment
Why you really want SQL in a Real-Time Enterprise Environment
 
How First to Value Beats First to Market: Case Studies of Fast Data Success
How First to Value Beats First to Market: Case Studies of Fast Data SuccessHow First to Value Beats First to Market: Case Studies of Fast Data Success
How First to Value Beats First to Market: Case Studies of Fast Data Success
 
Lessons Learned: The Impact of Fast Data for Personalization
Lessons Learned: The Impact of Fast Data for PersonalizationLessons Learned: The Impact of Fast Data for Personalization
Lessons Learned: The Impact of Fast Data for Personalization
 
Fast Data for Competitive Advantage: 4 Steps to Expand your Window of Opportu...
Fast Data for Competitive Advantage: 4 Steps to Expand your Window of Opportu...Fast Data for Competitive Advantage: 4 Steps to Expand your Window of Opportu...
Fast Data for Competitive Advantage: 4 Steps to Expand your Window of Opportu...
 
Understanding the Operational Database Infrastructure for IoT and Fast Data
Understanding the Operational Database Infrastructure for IoT and Fast DataUnderstanding the Operational Database Infrastructure for IoT and Fast Data
Understanding the Operational Database Infrastructure for IoT and Fast Data
 
The Two Generals Problem
The Two Generals ProblemThe Two Generals Problem
The Two Generals Problem
 
The 10 MS Rule: Getting to 'Yes' with Fast Data & Hadoop
The 10 MS Rule: Getting to 'Yes' with Fast Data & HadoopThe 10 MS Rule: Getting to 'Yes' with Fast Data & Hadoop
The 10 MS Rule: Getting to 'Yes' with Fast Data & Hadoop
 
The State of Streaming Analytics: The Need for Speed and Scale
The State of Streaming Analytics: The Need for Speed and ScaleThe State of Streaming Analytics: The Need for Speed and Scale
The State of Streaming Analytics: The Need for Speed and Scale
 
Fast Data: Achieving Real-Time Data Analysis Across the Financial Data Continuum
Fast Data: Achieving Real-Time Data Analysis Across the Financial Data ContinuumFast Data: Achieving Real-Time Data Analysis Across the Financial Data Continuum
Fast Data: Achieving Real-Time Data Analysis Across the Financial Data Continuum
 
How to Build Real-Time Streaming Analytics with an In-memory, Scale-out SQL D...
How to Build Real-Time Streaming Analytics with an In-memory, Scale-out SQL D...How to Build Real-Time Streaming Analytics with an In-memory, Scale-out SQL D...
How to Build Real-Time Streaming Analytics with an In-memory, Scale-out SQL D...
 

Recently uploaded

Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 

Recently uploaded (20)

Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 

Stored Procedure Superpowers: A Developer’s Guide

  • 1. Stored Procedure Superpowers A guide for anyone writing (or considering writing) VoltDB stored procedures May 19th, 2016 / John Hugg / @johnhugg
  • 2. Who Am I? • First developer on the VoltDB project. • Previously at Vertica and other data startups. • Have made so many bad decisions over the years, that now I almost know what I'm talking about. • jhugg@voltdb.com • @johnhugg • http://chat.voltdb.com
  • 3. Today’s Talk 1. Why do people hate stored procedures? 2. It doesn’t matter; you’re going to use them; here’s why.
 Subtitle: “Stored Procedures are Awesome!” 3. Given that…
 What has VoltDB done to make you hate stored procedures less?
 Subtitle: “Practical Stuff!”
  • 4. Not Today’s Talk All of the VoltDB stuff we cover in other talks, documentation, examples, tutorials, Volt University, etc… This includes: • How to partition schema and operations (docs, VoltU, examples) • Why procedures should be deterministic (docs, talks) • How to use general VoltDB features (docs, examples)
  • 5. Why Do People Hate Stored Procedures?
  • 6. Stored procedure languages are one-offs Can’t be debugged in an IDE Error messages are often unhelpful Parameters are inflexible Stored procedures hide business logic Stored procedures separate logic into two pieces http://blog.codinghorror.com/who-needs-stored-procedures-anyways/ WhytheHate?
  • 7. We’re going to use stored procedures anyway.
  • 8.
  • 9. A Relevant Comparison Remote Local 10 million packets per second (10GigE) 500 gigaflops (one CPU) 500,000 ns to fetch across a network 80 ns to fetch from main memory
  • 10. 3-Prong Efficiency Argument For OLTP workloads, stored procedures mean: • More throughput and less latency for the same cost • More complexity and power for the same cost • Stronger consistency (CAP & ACID) for the same cost All of the Above
  • 11. Boring Math Latency Argument • Latency is not uniform. 
 Let’s say 1 of 20 messages takes > 5ms to deliver.
 Let’s say 19 of 20 take < 1ms. • If transaction A requires 1 network round trip, 95% of responses will be under 1ms. • If transaction B requires 5 network round trips, 75% of responses will be under 5ms.
  • 12. Boring Math Latency Argument 2 • When you replace 10 RTs with 1 RT, your 99% latency percentile becomes your 99.9% latency percentile (by math).
  • 13. More boring latency. Ugh. Stored Proc Client-Side Txn Logic t0: Grab a Lock 1 µs 1 µs t1: Send data to logic 250 µs t2: Do Biz Logic 10 µs 10 µs t3: Respond over network 250 µs t4: Make Updates 10 µs 10 µs t5: Release Lock 1 µs 1 µs Total 22 µs 522 µs
  • 14. More boring latency. Ugh. Stored Proc Client-Side Txn Logic t0: Grab a Lock 1 µs 1 µs t1: Send data to logic 250 µs t2: Do Biz Logic 10 µs 10 µs t3: Respond over network 250 µs t4: Make Updates 10 µs 10 µs t5: Release Lock 1 µs 1 µs Total 22 µs 522 µs Holding a lock for 24x longer 
 means more contention. More contention 
 means even more latency.
  • 15. Stored Procedure Performance • Moving data is harder than moving logic • No lock holding during a network round trip • Logical representation is smaller on the wire or disk
  • 16. Stored procedure languages are one-offs Can’t be debugged in an IDE Error messages are often unhelpful Parameters are inflexible Stored procedures hide business logic Stored procedures separate logic into two pieces http://blog.codinghorror.com/who-needs-stored-procedures-anyways/ WhytheHate?
  • 17. Stored procedure languages are one-offs Can’t be debugged in an IDE Error messages are often unhelpful Parameters are inflexible Stored procedures hide business logic Stored procedures separate logic into two pieces http://blog.codinghorror.com/who-needs-stored-procedures-anyways/ WhytheHate? ImplementationLegit
  • 18. Procedure API Microservices, Microservices, Microservices Your App’s State Schema Constraint User ConstraintClient Application Procs let you enforce more powerful constraints Unique Foreign Key Triggers No customer has more than 6 open orders. Only one employee at each company has no boss. No print job requires more than 10ml of ink.
  • 19. Use Different Clients With Shared Logic Procedure API Your App’s State Client Application Java Client Application C++ Client Application Node.js ReserveSeat ReserveSeat ReserveSeat
  • 20. Change Logic Centrally Procedure API Contains ReserveSeat 1.0 logic Your App’s State Client Application Java Client Application C++ Client Application Node.js ReserveSeat ReserveSeat ReserveSeat
  • 21. Change Logic Centrally Procedure API Contains ReserveSeat 1.0 logic Your App’s State Client Application Java Client Application C++ Client Application Node.js ReserveSeat ReserveSeat ReserveSeat Procedure API Contains ReserveSeat 2.0 logic
  • 22. Change Logic Centrally Your App’s State Client Application Java Client Application C++ Client Application Node.js ReserveSeat ReserveSeat ReserveSeat Procedure API Contains ReserveSeat 2.0 logic
  • 24. Why you might not care…
  • 25. Slower Apps • I run the VoltDB forums on MySQL. • Peak traffic is about 1 TPS in actual writes. • It runs on the smallest Linode instance and is mostly idle. • Optimizing this is pretty dumb. • This example is clear, but where is the line?
  • 26. Analytics • How many purple hats were sold on Tuesdays in March when it was raining? • I can answer that with a SQL query. A stored proc won’t buy me much.
  • 27. Performance Benefit of Stored Procedures KV CRUD Complex Transactional Logic
  • 28. Do it when it pays off • If you don’t have transactional logic, the argument for stored procedures becomes much less strong. • You’re down to saving round trips — though that can be a big difference for high performance apps.
  • 29. Optimization Rules Apply Operation 1 Operation 2 Takes 100ms instead of 1ms Takes 3ms instead of 1ms Runs once per second Runs 25k times per second Optimization saves 10% of one CPU Optimization saves 50 CPUs
  • 30. Stored procedure languages are one-offs Can’t be debugged in an IDE Error messages are often unhelpful Parameters are inflexible Stored procedures hide business logic Stored procedures separate logic into two pieces http://blog.codinghorror.com/who-needs-stored-procedures-anyways/ WhytheHate? ImplementationLegit
  • 33. Why Java • Familiarity and Popularity • IDEs • Safety • Performance • Code as Data / Hot Swap Code • Other JVM Languages Alternatives: Lua / Javascript
  • 36.
  • 46. InProcessVoltDBServer API • InProcessVoltDBServer configPartitionCount(int partitionCount); • InProcessVoltDBServer configPathToLicense(String path); • InProcessVoltDBServer start(); • InProcessVoltDBServer runDDLFromPath(String path); • InProcessVoltDBServer runDDLFromString(String ddl); • Client getClient(); • void loadRow(String tableName, Object... row); • void shutdown();
  • 48. More?
  • 49. Partitioning Async Clients Understanding 
 SQL Plans Using Indexes Well http://docs.voltdb.com
  • 52. Conclusion & Thanks • Stored procs get a mostly undeserved bad rap • To go fast, they make tons of sense • There are advantages besides speed jhugg@voltdb.com / @johnhugg / chat.voltdb.com