Java

Posts Tagged ‘Java’

JSON in VoltDB

VoltDB 3.0 introduces the use of JSON-encoded columns to allow more flexibility in how you structure and interact with your data. New SQL functions and index capabilities let you work more naturally with JSON data while maintaining the efficiency and transactional consistency of a relational database.

How?  A VoltDB JSON Example

Let’s assume that you want to implement a single sign-on (SSO) application using VoltDB.  You wish to store the login session for a set of different online sites under a common username.  Each login session could hold different user state, simple data values or possibly more complex structures. Additionally, … Read more

 

Introducing VoltDB 3.0

The VoltDB engineering team is thrilled to announce that VoltDB 3.0 is now available!  Over the past six months we’ve added a ton of features to VoltDB 3.0. This blog post lists the highlights, but that just scratches the surface. Look for future blog posts to dive into specific areas of version 3 functionality.

So let’s jump into what’s new in VoltDB 3.0…

Even Faster

VoltDB 3.0 has lower latency and more throughput than the VoltDB v2.x release.  We spent much of the past year re-engineering the transaction coordination architecture to minimize the communication between cluster nodes during transaction processing … Read more

 

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

 

VoltDB client for the Go Language

A while ago I published my Go VoltDB driver to github (https://github.com/rbetts/voltdbgo).  I wrote the driver for three reasons: to learn and write a little go; to be able to test and script against VoltDB using go; and to experiment with some different VoltDB client patterns.

We, and the community, have written several production quality drivers for VoltDB (available at http://www.voltdb.com/community/downloads.php). The go driver, however, has not been tested for production use.

With caveats complete, what’s up with voltdbgo?

Firstly, it only supports synchronous clients. VoltDB 3.0 has greatly improved response latency for synchronous interactions and the … Read more

 

Leaderboards: Optimization for Ranking-Related Queries

My name is Xin Jia and I was one of the student interns at VoltDB this summer. For one of my projects, I worked on a feature that greatly improved the performance of ranking-related queries.

Finding the rank of an entry in a sorted list of data is a common operation in a lot of applications. Take a leaderboard within gaming application as an example: it is common to have a scoreboard that keeps track of users’ scores. Questions like, “what are the top-n users and their corresponding scores?”, or “what is the rank of a certain user?” are … 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

 

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

 

Java and Kernal Bugs

Java Concurrency Bug

This is the first bug we found in a system outside VoltDB. We used LinkedBlockingDeque in Java’s concurrent package to maintain concurrent access in VoltDB’s network subsystem. Once in a while, we noticed cluster lockups when the system was under pressure. After looking at the stack traces of the VoltDB instances on the servers, it looked like the threads were waiting for the same lock which nothing seemed to own. This caused the whole system to deadlock.

After creating a small program which could successfully reproduce this problem without VoltDB, we were determined that this was a … Read more

 
Tags: