GithubHelp home page GithubHelp logo

chessydk / hybriddb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from asgerhallas/hybriddb

0.0 1.0 0.0 26.9 MB

It's an O/RM... it's a document store... no it's SQL Server!

Batchfile 0.02% C# 99.31% PowerShell 0.67%

hybriddb's Introduction

Build status

HybridDb

HybridDb makes it easy to store and query semi-structured data and documents in SQL Server (or other relational databases when the time comes).

HybridDb gives you:

  • A unit of work API similar to NHibernate or RavenDB
  • Easy schemaless and mostly mappingless persistance of any .NET object
  • A few simple indexing features that enables querying on document properties
  • A LINQ provider for mentioned queries
  • All the consistency and transactionality of a relational database
  • Migration tools for document changes and index changes
  • A nifty little document viewer

HybridDb aims to be a small and focused library with no magic and no surprises.

So if all you need is to put some JSON to rest - on a single server, in simple manner - HybridDb might be the tool for you.

Why?

We have been happy users of the awesome RavenDB for a quite a while, but we ran into some performance issues that we were not able to dodge (read more here).

With no solution to the problem in sight - and in the lucky situation that we did not rely on any of RavenDB's more advanced features - we decided to write a drop-in replacement to run on top of SQL Server.

HybridDb is the result of this effort and fulfills our modest requirements - and we hope it can be useful for others too.

How?

Like this:

var store = DocumentStore.ForTesting(TableMode.TempTables);
store.Document<Entity>().With(x => x.Property);

using (var session = store.OpenSession())
{
    session.Store(new Entity { Id = Guid.NewGuid(), Property = 2001, Field = "Hello" });
    session.SaveChanges();
}

using (var session = store.OpenSession())
{
    var entity = session.Query<Entity>().Single(x => x.Property > 2000);
    entity.Property++;
    session.SaveChanges();
}

Changelog

0.8.3

  • @afkpost added support for separate document metadata

0.8.4

  • @mookid8000 fixed issue #21

0.8.5

  • Added support for persisting anonynomous types
  • Added support for persisting non-configured types in an always present Document table
  • Added TypeMapper instead of requiring configuration for all concrete type manually

0.9.0

  • Changed the configuration api to accomodate ad hoc document setup. Now you need to call store.Initialize() after configuration to run the migrations.

0.9.1

  • Fixed issue with decimal-columns not having any scale. Now they are set to 28, 14.

0.9.2

  • Fixed issue with deadlocks while migrating schema in parallel test executing using temp tables
  • Made deadlocks less likely for real tables too
  • Changed id uniqueness in session to be table+key instead of type+key.

0.9.3

  • Added overload for DocumentStore.Create with configuration action

0.9.4

  • Added configuration option to set the default key resolver, which is used when trying to obtain an id from an entity in store.
  • The default key resolver (if non other is set) now calls ToString() by default on the automatically resolved id from the stored entity. So if you use a Guid it will ToString it for you when you store.

0.9.5

  • fixes issue #24
  • enforce store initialization before first session is opened

0.10.0

  • changes default nvarchar length to 1024 with support for overriding this default like store.Configuration.Document<Doc>.With(x => x.StringProp, new MaxLength(2048));. Fixes issue #20.

Acknowledgements

HybridDb uses Dapper, Json.NET and Inflector ... all of which are brilliant pieces of open source software.

Code for managing anonymous objects is taken from here

NHibernate and RavenDB has been our role models.

So that's it... HybridDb is standing on the shoulder of giants. And it can't get down.

License

Copyright (C) 2013 Lars Udengaard, Jacob Bach Pedersen and Asger Hallas.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

hybriddb's People

Contributors

asgerhallas avatar mookid8000 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.