Author Archive

Posts by Andrew Wilson 

Simplify Your Stored Procedure Logic with Expectations

John Hugg was talking with me today about a way to reduce the complexity of error checking in a stored procedure and how rarely it is used. VoltDB’s stored procedures let you set “expectations” on each SQL statement. Those expectations can eliminate several lines of code leading to shorter, readable and more reliable stored procedures.

Consider the following sample:

Example.DDL

LoginProc1.java

LoginProc2.java

LoginProc1 checks for a row count and returns either a 0 or a 1 if the username and password combination could not be found. LoginProc2 sets an expectation that the results of voltExecuteSQL() will return exactly one … Read more

 

Upserts in VoltDB

Upserts in VoltDB

The idea behind an upsert is that you try an update or an insert query first and if it fails, you then do the other query.
Why do an upsert? Upserts tend to be very fast in traditional databases because they can execute in as little as one query or as many as two. Consequently, a good upsert strategy has only two defined queries (insert and update) rather than three (insert, update and select). More importantly, “upsert” itself can be a keyword in which the database understands that it is responsible for figuring out whether to update … Read more

 

Writing VoltDB Apps in Java Q & A

NewSQL and NoSQL databases present developers with a new and interesting programming model where there are fewer connections to the database, query parallelism, partitions and an easy model for supporting new clusters. Last month I presented a webinar introducing the basics of application development using VoltDB. We had a lot of great questions and I thought it would be handy to write them up and share the answers with everyone.

Q: Can you address how you would handle joining tables that have different partition keys?  Would you not partition the tables in that case?
A:  For multi-partition queries you join … Read more

 

MySQL to VoltDB: Experiences from the field

Francis Pelland is the Technical Lead for Social Game Universe developing the next generation of The Lightning Platform. The Lightning Platform lets developers build high performance, scalable data platform and provides the management, analytics and the tools to promote and grow social games. He wrote a short guide to help his team get through the transition for PHP developers moving from MySQL to VoltDB.   Here’s an excerpt:

Is there PhpMyAdmin or similar?

Yes there is!  This tool is called Web Studio.  This will allow you to navigate the tables (but not browse its content).  You can see in real … Read more

 

686K TPS with Spring Framework Web App and VoltDB

We’ve recently put up a series of blog posts describing the components of a Spring-MVC web application, including VoltDB as the database, that saves votes being called in for talent show contestants. Today I’ll talk about what happened when we benchmarked the Voter application on Amazon’s cloud platform.  The short story – running on a suitable EC2 configuration (see details below), we achieved 686,000 TPS for a Spring-enabled application using VoltDB.

The Benchmark Application

I’ll start by summarizing the aforementioned blog posts, but you are welcome to read them:

Using the Spring @Schedule Annotation, Using the Spring Converter API Read more

 

Building A High Throughput Web App with Spring-MVC and VoltDB

My last few posts have discussed parts of a web application that integrate VoltDB into a Spring web application. Today I will show how all the pieces are put together to build a low latency, high throughput Spring-MVC application. Much of my focus will be on the data layer where VoltDB resides, but I will go all the way up to the browser too.

Spring LogoThe application is simple. It has two main parts. The first is a scheduled process that casts votes into VoltDB. Those votes simulate people calling in and voting for their favorite contestant in a talent show. … Read more

 

Using the Spring Converter API with VoltDB Data Objects

Mapping one type to another is a pretty common task. Hibernate and other ORM’s map a result from a data source’s native representation to an application specific representation. In English, I want to convert a JDBC result set, or data objects, into a collection of POJOs (plain old Java objects) using some kind of data mapping tool or API. Spring exposes a low level service provider interface that makes it very easy to convert one data type to another with either built-in converters or customer converters, allowing a developer to support just about any conversion one can think of. Today … Read more

 

Using the Spring @Schedule Annotation

In a previous life I had a requirement that a web application scanned the expiration date of purchased content and sent one of three emails letting the user know that the item would expire soon, was going to expire very soon and that the item has expired. It fired up at early in the morning when the server had the lowest utilization. Later, I had to write a similar feature that would run every couple of minutes. It wasn’t terribly hard to implement the logic, but the scheduler was an external component that required much more work to configure than … Read more

 

Great Evening with the TriangleJS Meet-up Group

Last night I gave a talk and had an engaging conversation with the TriangleJS meet-up group in Raleigh, NC.  I’d like to thank my hosts at WebAssign for providing such a nice facility, Lucas Myers for managing the logistics of the meet-up and, most of all, the group members who invested an evening to learn more about VoltDB.

Although my talk was somewhat geared toward recent work we’ve done with Node.js, the follow-on discussion covered a wide range of technical topics ranging from database partitioning, single- and multi-part queries, query routing, site execution and database high availability.  It was interesting … Read more

 

Using Node.js with VoltDB

We recently released the first supported version of a VoltDB client driver for Node.js applications. It was able to execute over 695K transactions per second. Since then we have been working on building a better driver and sought out help from the Node community and made a series of improvements.

Today I’m going to write about how to access VoltDB from a Node application. A sample application is included with the driver, the latest version of which can be downloaded from http://www.voltdb.com/tao-volt/downloads-home.php.

The integration process is short and straightforward. All VoltDB applications have a set of stored procedures that are … Read more