VoltDB.NET Unleashed: Post Webinar Wrap-up and VoltDB Studio Introduction
I thought I’d take a quick opportunity to review some of the key highlights form the .NET Webinar, giving out some of the nicer code snippets, and officially introduce our new development tool: VoltDB Studio.
VoltDB.NET in a nutshell
The .NET/C# client library for VoltDB is extremely flexible and allows you to develop WinForms, Console and Web applications and services much as you would do leveraging any other back-end data service or database.
- Connect with a customized connectionstring in your app/web.config.
- Perform Synchronous or Asynchronous data operations using standard .NET design patterns.
- Consume and filter data results using LINQ.
- Leverage native, strongly-typed, data access and type casting, as well as late-bound operations.
- Monitor performance and manage a database cluster.
Useful code snippets
LINQ-able resultsets
// On a strongly-typed VoltDB data table
myTable.Rows.Where(r => r.Column2 == “Books”)
.Select(r => new { Title = r.Column2
, Price = r.Column7
}
)
.OrderBy(p => p.Price);
// On a raw VoltDB data table
raw.Rows.Where(r => r.GetValue<string>(1) == “Books”)
.Select(r => new { Title = r. GetValue<string>(1)
, Price = r. GetValue<double>(6)
}
)
.OrderBy(p => p.Price);
Filling a System.Data.DataTable
Table raw = procedureWrapper.Execute().Result;
DataTable dt = new DataTable("Result");
for(short i = 0; i < raw.ColumnCount; i++)
dt.Columns.Add( raw.GetColumnName(i), raw.GetColumnType(i));
object[] values = new object[raw.ColumnCount];
foreach (Row row in raw.Rows)
{
for (short i = 0; i < raw.ColumnCount; i++)
values[i] = row.GetValue(i);
dt.Rows.Add(values);
}
Filling a System.Windows.Forms.DataGridView
view.Columns.Clear();
view.DataSource = null;
for (short i = 0; i < raw.ColumnCount; i++)
view.Columns.Add(
raw.GetColumnName(i)
, raw.GetColumnName(i)
);
foreach (Row row in raw.Rows)
{
int n = view.Rows.Add();
for (short i = 0; i < row.ColumnCount; i++)
{
view.Rows[n].Cells[i].Value = row.GetValue(i);
view.Rows[n].Cells[i].ValueType = row.GetColumnType(i);
}
}
Key considerations
- All access is thread-safe
- Safe for multi-threaded application
- Safe as shared connections for a website/service
- OK to mix asynchronous and synchronous calls
- OK to have long-running callbacks (they are Thread-Pooled)
- Resilience
- Connect to multiple nodes
- Performance
- Share: multi-threading on a single connection is faster
- Production: No Tracing (ever) or Statistics (unless needed)
- Avoid usage of IAsync WaitHandles: they are slow!
VoltDB Studio: A SQL development environment for Windows users
VoltDB Studio was built as a showcase for what can be accomplished using the .NET client library, as well as a useful tool for users considering deployment of VoltDB in an otherwise Windows-centric environment.
Modelled after SQL Server’s Management Studio, VoltDB Studio provides a familiar user interface with which you can:
- Connect to your VoltDB databases.
- Use the Object Browser to review schema and system objects.
- Run ad-hoc queries and call stored procedures.
- Perform basic database monitoring (Memory usage, Transactions, Latency).
Useful code snippets
VoltDB Studio actually extends the SQL support built into VoltDB to allow you to perform certain operations not natively supported by the server, specifically around stored procedure interactions, traditionally run directly from client code (not in SQL).
Pending core upgrades on the VoltDB engine, you currently have to declare your stored procedures in Studio before you can call them.
Declaring a procedure
declare procedure Vote bigint, tinyint, bigint
or
declare proc Vote bigint, tinyint, bigint
If your procedure has no parameters:
declare proc Results
Remember that procedure names are case sensitive
Executing a procedure
exec Vote 12345678901, 1, 2
Undeclaring a procedure
If you made a mistake in your definition, you can easily remove it by calling:
undeclare proc(edure) Vote
Where can you get ‘VoltDB Studio’?
VoltDB Studio is available free of charge as a tiny binary download on our downloads page. It is a one-click install .NET application compatible with 32 and 64bit versions of Windows. The .NET Framework 4.0 will automatically be installed by the setup program if needed.
Enjoy Studio and happy VoltDB development!



You’re correct, we did make a native .NET version of Studio available for a brief time. This was deprecated when we delivered the browser version. The .NET version of VoltDB Studio is no longer available.
The post states that there is a .Net version. Even the images show a non-browser based version.
VoltDB Studio was built as a showcase for what can be accomplished using the .NET client library, as well as a useful tool for users considering deployment of VoltDB in an otherwise Windows-centric environment.
The windows version of VoltDB Studio doesn’t seem to be available from the download site. Is there an alternate download location or a source code version available?
VoltDB Studio is a browser-based tool, so there’s not a separate Windows version. Studio is bundled with all open source and commercial distributions of VoltDB. If you need to download it separately, it’s available here: http://voltdb.com/products-services/downloads.