Sterling NoSQL OODB is a lightweight object NoSQL database designed for use in .NET 4.0, Silverlight 4/5, and Windows Phone 7 projects.
Opportunities
Work with complex objects (which include other simple or complex objects, which may include more objects - and so on without limit). Objects can be both classes and structures.
Works with both fields and properties.
The ability to prohibit saving a certain type, property or field.
Possibilities for detecting circular references.
"In memory" db.
Support for working in local file systems of trusted Silverlight applications.
Isolated data warehouse support for Silverlight and Windows Phone.
Support for standard file systems for common desktop applications.
The structure of the tables is created dynamically on the fly.
Simple configuration: you specify the type of the table, the type of the key and the lambda expression to select the key - and you can fully work.
Preservation of specific types when specifying the structure of their basic interfaces or abstract classes in the description of the structure.
Full support for foreign keys - child objects are stored in separate tables.
A binary serializer that generates smaller objects on disk than JSON, XML, and so on.
Encryption support.
Compression support.
Support for all CRUD operations: loading, saving (asynchronous for collections), deleting, aligning and completely zeroing.
Multiple database support per partitioning and / or versioning application.
Built-in support for the following types: base, Nullable, strings, byte arrays, DateTime, TimeSpan, Guid, enums (Enum), Decimal, lists, dictionaries, arrays, WritableBitmap.
Support for custom type processing by writing your own serializers.
Linq to Objects query support on indexes and keys.
Delayed (lazy) loading of objects in requests.
Built-in caching.
Built-in backup and recovery.
The possibility of hanging triggers on events "before saving", "after saving" and "deleting".
The ability to generate a key using the trigger.
The ability to implement relationships through triggers.
DLL weighs less than 100 kb.
Usage example
Suppose we need to store a database by species. Here we describe such entities:
class Feeding { public FeedingType Type { get ; set ; } public TimeSpan DefaultInterval { get ; set ; } }
class Animal { public Guid Key { get ; set ; } public string Name { get ; set ; } public TimeSpan LifeExpectancy { get ; set ; } public Feeding Supply { get ; set ; } }
* This source code was highlighted with Source Code Highlighter .
Accordingly, we will store in the database objects like Animal. Now we need to describe the structure of our database:
class BiologyDatabaseInstance: BaseDatabaseInstance { public const string INDEX_ANIMAL_NAME = "idx_animal_name" ;
public override string Name { get { return "BiologyDb" ; } }
* This source code was highlighted with Source Code Highlighter .
In the database there will be one table with a key like Guid and an index for the name of the species. Now we need to actually activate the database:
var engine = new SterlingEngine (); engine.Activate(); var databaseInstance = engine.SterlingDatabase.RegisterDatabase<BiologyDatabaseInstance> ( new FileSystemDriver ( "C:/Temp/Animals/" ));
* This source code was highlighted with Source Code Highlighter .
That's all. Can be used. All work is done through a copy, which was provided to us during registration. For example:
var catId = databaseInstance.Save ( new Animal { Key = Guid .NewGuid (), LifeExpectancy = TimeSpan .FromDays (365 * 15), Name = "Cat" , Supply = new Feeding { Type = FeedingType.Carnivore, DefaultInterval = TimeSpan .FromHours (12) } });