VelocityDB & VelocityGraph

Object and Graph Database - ask us, share & let us know what you need.

VelocityDB Version 3.17 Release Notes

[AutoIncrement] field attribute added. Use it to automatically get a unique number (sequence from 1 normally) generated for every instance of a class to be stored in a field within a class, such as in:

  public class Person : OptimizedPersistable
  {
    string firstName;
    string lastName;
    ushort age;
    UInt64 idNumber;
    Person bestFriend;
    [AutoIncrement]
    UInt64 autoIncrement;
    SortedSetAny<Person> friends;

VelocityDB Version 3.16 Release Notes

For ServerClientSession, only invalidate pages updated by another transaction instead of invalidating an entire Database. Updated session constructor parameter.

VelocityDB Version 3.15.4 Release Notes

Make strong object references cache default in SessionNoServer constructor and switch to weak object reference cache when memory available is low, switch back to strong references when more memory is available.

Rerun benchmark on a slightly faster PC, looks great! This time with compression turned on.


VelocityDB Version 3.15.3 Release Notes

Enable strong object reference cache with ServerClientSession constructor.

By default, strong references are now used instead of weak references.

A client test case ran more 1000 times faster with this option. Caching is improved.



ServerClientSession - caching and multithreading.

1) Where does it cache data? In memory on server side or client side? If I am using such code

var session = getCachedSession();
session.BeginRead();
var data = GetData();
session.Commit();
return data;

then next GetData() always opens objects from server disk (even with CacheEnum.Yes).

If the code just like that:

var session = getCachedSession(); //long read transaction
return GetData();

then GetData() immediately gets data from client memory. I don't want to store data in client's memory. How can I cache data only in the memory of the server till first update of related pages? What about caching of system databases (schema, locations etc)?

2) What is proper usage of ServerClientSession in multiple threads (in one process)? I see, the class itself is not thread-safe, and creation of an instance is expensive. Is there any way to make its singleton instance thread-safe (without lock(session) )? In the moment I am manually maintaining a pool of several initialized ServerClientSession using ConcurrentStack; each thread pops (creates if needed) and pushes back own instance with separate transaction block (BeginRead/Update - Commit block). Maybe is there better approach that we could use?

Autoincrementing fields

Can you provide autoincrementing fields of numeric types in persistent objects by implementing a field attribute like [AutoIncrement] ? One will be able to add that attribute to field with

 [Index][UniqueConstraint]

but the field value is automatically incremented when object is persisted.

It must be retroactive if there are objects with such fields persisted already. For example if we had imported the objects with specified fields values with compiled class without that attribute, then next time after we put that attribute and compile it, Session must get the last value in indexed fields and increment it for new object.

VelocityDB Version 3.14 Release Notes

Add databasePerType parameter (default == true) to SessionBase.AllObjects for faster lookups

foreach (var obj in session.AllObjects<DomainObject>().Take(10))

Console.WriteLine("id: {0}, products: {1}, likes: {2}, comments: {3}", obj.Id, obj.Products.Count, obj.Likes.Count, obj.Comments.Count);

If you have a lot of different types of objects and many of each, this option will make it fast to find a certain type of object. Otherwise we have to examine each page in every database in order to find all objects of a certain type. If you use this option (on by default) you must persist your objects using the recommended Persist API, i.e.

var look = new DomainObject(session, i);

session.Persist(look);




ServerClientSession slow performance.

We have the issues with slow usage of ServerClientSession in local network. Version of VelocityDb is 3.13.1. Toggled TcpClient.NoDelay does not help.

First of all, let me to show some benchmarks made by Database Benchmark 2.0.3 . I've just added benchmark for ClientServerSession leading to localhost (same PC with client) and second one leading to remote host (in same network as client).

Write speed

Read speed

Secondary read speed

As you can see, result of ServerClientSession connecting to remote host is very slow. Do you have any benchmark results for ServerClientSession?

There is the source code of an example, the usage of session and classes in it are similar to my models in web application. The program also runs very slow on the network (especially for read of 10 objects on wire). There are the profiler results. You can see that the huge bottleneck occurs in network code (like Socket.Receive). Elapsed time in hundreds milliseconds is not so acceptable.

What can you suggest? Or maybe is there some bottleneck in requests loop in VelocityDbServer or something like that?

A few highlights from recent releases

  • Updated Benchmark project includes a few new databases, see here
  • Version 3.3 released Dec 26, 2013. Release notes: Added support for Windows 8 Phone (beta) – see User’s Guide. Added sample DatabaseLocking and WindowsPhoneSDCard.
  • Version 3.2 released Dec 7, 2013. Release notes: BTree, placement fixes and performance improvements. Fix of BTree string compare. Added BTree API AddFast (for large ingest/batch/bulk cases).
  • Added VelocityWeb sample web application using VelocityDB. It includes managing users and IssueTracker. User’s Guide updated to describe installation to a hosting server.
  • A performance comparison with MongoDB has been added here.
  • Version 2.7.0 released June 29, 2013. Release notes: Database Verify application added to sample solution, use it to verify that your objects and references can be opened without any error. Some bug fixes.
  • Event subscription and notification added to the client/server api. EventSubscriber sample showing usage of this new api is also included. Now available for download.
  • VelocityGraph preview, build on top of VelocityDB, is provided in the download with complete source code. We believe it is or will be the best performing and most scalable graph database in the world, see for yourself in VelocityGraphSample sample added in version 2.4. Now available for download and here.
  • In addition to our normal .NET 4.0 based download, we now provide a download build for .NET 3.5. All samples are included in the .NET 3.5 version except a few that are not compatible (Indexes, TextIndexer, TriangleCounter).
  • Swap from one VelocityDbServer host to another without data loss, see for yourself in High Availability sample added in release version 2.3
  • Much simplified persistence API added in release version 2.1
  • Indexing support added in release version 2.0. Sample code using indexing in download and here.
  • Download page now includes VelocityDB.dll assembly custom build for Mono and Mono for Andoid. Develop using Xamarin.
  • Kevin Bacon Numbers, calculating degree of seperation to all other actors and actresses!

    Social network graph data, finding connections forming triangles!

    World Cities sample: Now with an associative click interface

    VelocityDB Version 3.13 Release Notes

    Optimize IEnumerable Skip by overriding extension method for AllObjects.

    Sample:

    AllObjects<NotSharingPage> all = db.AllObjects<NotSharingPage>();

    List<NotSharingPage> notSharingPageList = all.Skip(100).ToList();

    Download it.

    VelocityDB Questions and Anwers

    We are starting with baby steps...posts any questions or answers you have here! Press Login button and create a user name for yourself then you are ready to comment/post, upload code/videos, whatever you need to do.

    Go back to VelocityDB or VelocityGraph when you are done/bored.