Object-oriented network database

Hi, All!

I am Ukrainian scientific researcher and developer. I am developing object-oriented network knowledge database which is based on object-oriented database engine. I already implemented .NET 1.1 support. It's very cool that MS devolops declarative object query language for C#. I hope I'll be able to integrate LINQ features into my engine.
Now I have to use three fields to store object soft pointers. One for object handle; One for wrapper instance to pin the object instance in memory; and One for instance of user object. I want to hide implementation details from end user. To make this I need some kind of custom proxy. I need auto generate my proxy class which will emulate user class and intercept all calls from another object to persistent instance. I have a question to MS. Does MS have a plan to make in .NET 3.0 support for object-related database engines

You can visit  http://www.shuklin.com/ai/ht/en/cerebrum  and evaluate my OODB.

WBR,
Dmitry Shuklin
www.shuklin.com




Answer this question

Object-oriented network database

  • murr

    Hello Carl,

    I am interested in Your project. Do You support server side virtual methods and server side interface inheritance for persistent C# objects How do You implemented transactions

    I have already done these features in my own open project Cerebrum (http://www.shuklin.com/ai/ht/en/cerebrum/) but I feel that these features are not yet perfect in my DB and I look forward for brilliant ideas. And I want to implement more features.

    WBR,
    Dmitry Shuklin
    http://www.shuklin.com





  • jsalk

    Hello Koreshkov,
    In my company we are developing CRM&ERP project. Its not my own project. 5 developers are working in it.
    My system is develoing on this architecture : http://forums.microsoft.com/msdn/ShowPost.aspx PostID=8054

    www.db4o.com, I use this oodb. Our architecture's a desavantage is it is working slow. with oodb it speeded up 10x . Yeah ofcourse it is supporting transactions. You dont need versioning becouse it can store anything u dont have got any schema of db. And it has got backup system.
    The problem is I dont know how to make reports.. I think I will use XML.
    Another problem is You dont have a browser to see your records.
    db4o is developing ObjectBrowser for 5.0

    Hey Dave Foderick

    Sorry I have never heard of Matisse. It looks cool I have to research it more.. Thank you


  • Silviu Guea

    Hello Keith,

    I agree that it is possible to create an intermediary to receive and carry out of SQL queries from LINQ subsystem. However the given approach will bring to nothing all benefits of OODB. The basic OODB advantage is existence (or simulation of presence) OODBMS inside application address space. There no intermediaries between .NET Framework and OODB should be. Serialization of instances should be transparent for application code. The language of server side OODB should be C# instead of SQL or OQL. The edge between a server and the application should be erased by using of OODB.

    These features will demand from following opportunities given by .NET Framework:
    - Tracking of instances usage statistics and managing instances LRU list.
    - Swapping of seldom used instances to storage and loading instances from storage on demand
    - Soft references support

    I had implemented these opportunities independently from .NET Framework. It was necessary to refuse.NET Garbage Collector and implement own algorithm. As built-in support for OODB in .NET is absent now then it is necessary for the programmer to make additional and superfluous work on instances pinning / unpinning when using my OODB from C#. I think it would be better to implement support of these features in a .NET Framework kernel. For this reason I am excited about MS plans to support OODB in the following versions of .NET Framework.

    WBR,
    Dmitry Shuklin
    www.shuklin.com



  • Pogaru

    Hello Dmitry,
    we implemented Native Queries for db4o in the following way:

    (1) We do a flow graph analysis on bytecode level, using Cecil as the base, with our addons. Actually these addons are being contributed back to the Cecil project under an MIT license, so they are available to the public.
    (2) All expressions and method calls (also partial expressions) that can be mapped to our query API will be translated.
    (3) That means a Native Query will execute against indexes.
    (4) If all or parts of a Native Query are not understood by the translating process, we actually instantiate the persistent objects and run the code against them.
    (5) Instantiating these objects in a query will happen on the server side.

    As an answer to your question that means:
    Yes, we support server side method execution, you can call anything you like and of course interfaces can be inherited.

    We provide clean ACID transactions with a read-committed isolation level. That means every transaction gets it's own object cache.

    Feel free to have a look around our code, it's open. The native query optimizer is just being released to the public right now, in a development release, we are building it at this second. It's not online yet but it will be in the next three days as db4o 5.0.007.

    http://www.db4o.com/
    http://www.db4o.com/community/ontheroad/downloadcenter/



  • hashcomp

    Hello Andriy,

    I see you work with XML-DB or with business logic teir based on XML. I worked with similar systems too. Despite of seeming RDBMS universality the real life forces us to be beyond relational theory. The real business frequently has a natural hierarchy so XML is very convenient, because it allows to represent data model in the form of trees. Despite of all benefits using of XML cannot be optimum in many cases.

    It is connected with the point that it is frequently necessary to model network instead of treelike structures. For example CAD for routing printed-circuit-boards is much more convenient to implement with network database in which each unit relates to the chip, and connections between units correspond to links between objects. XML as well as a tree are special case of a network. Therefore the network DB can be used if it is necessary as XML-DB, however the vice-vera will be inconvenient. For this reason I took network model of data presentation for a basis of DB.

    You are right, telling that the industry demands qualitative DB. Therefore the objective database should provide us a chence to work both with procedural style of programming and with declarative style. In this respect project LINQ represents a step in the future. In LINQ declarative and procedural styles of programming are united. Let now  LINQ opportunities are limited, but in some years this technology can overtake SQL on convenience and efficiency. In the LINQ no restrictions on work only with tabulared structures are exists instead of SQL. LINQ can work with relational data and with a trees. A following logic step - to implement support of queries to any graph of objects. It is obvious, that development of .NET will not stop and support of stable objects will be built into .NET. So .NET will become a high-grade object-oriented network database. Such base will demand developing of well optimized management system. I understand, that development of declarative query language is a challenge. Therefore I hope, that Microsoft will build in into LINQ support for OODB and I can use it in my Cerebrum project.

    I consider that implement such system on the basis of RDBMS  is very inconvenient and inefficient on set of the many reasons. For this reason I solved on development of completely mine engine without application of RDBMS as storage of objects. You can familiarized with a current condition of my developments by downloading of source codes. It can be made from page http://www.shuklin.com/ai/ht/en/cerebrum. Project is very young, therefore the documentation is in a development stage. If there will be any questions on use OODB Cerebrum -it is most quickly to ask me directly. You can find me in this forum or write me to shuklin @ bk. ru

    WBR,
    Dmitry Shuklin
    www.shuklin.com



  • ndiniz

    Hello, Doga.
    If not a secret, do you use a ODBMS in domestic projects or for out-of-the-box solutions What kind of system do you use, which vendor Have you test its features like performance, transaction support, versioning etc. against relational database systems
    Actually, I'm also considering to start using ODBMS in projects in order to get rid of all such stuff as OR-mapping, but I warry about how reliable such systems are, how much they "adult"
    Can you reveal a bit more details, what another kind of troubles do you face (the troubles always must be near us, aren't they :) ), how much relable your decisions turn out to be  

    Kindest wishes,
    Roman

  • Dave Breuer

    Hello Dmitry,

    probably the better place to discuss issues around db4o would be our forum:
    http://forums.db4o.com/forums/

    The easiest solution to your question:
    db4o supplies built in collections for this purpose.

    class Foo{
      IList Bar;
    }

    Foo foo = new Foo();
    foo.Bar = db.Collections().NewLinkedList();

    After persisting foo and working with the list, you can simply use:

    foo.Bar[9997]


    If you want to use your own list implementation with IDs, simply query for IDs. Using .NET 2.0 native query syntax, about to be released with db4o 5.0:

    IList <LElement> elements = db.Query <LElement> (delegate(LElement element) {
        return element.ID >= 9997 && element.ID <=9998;
    });


    If you are asking for how we are instantiating deep structures:
    We don't by default.
    We call our concept activation. You can decide, what you want instantiated by configuring depths for classes, for fields or for individual queries.

    With 5.1 (still this year) we will release a mechanism that will do activation transparently when fields are accessed the first time.

  • weejay

    Hello Carl,

    I looked on db4o and can't understand how i should call persitent object method from another persistent object method on a server side

    Lets assume that i have linked list from 10000 objects. And I have ID of obj 9997, I want call object 9997 from application and call object 9998 from object 9997 and return to application. What should i do to prevent instantiation of all linked list, just instantiate 9997 and 9998

    WBR,
    Dmitry


  • Kevin Tambascio

    DLinq relies on the idea that database vendors can provide the logic to transform a description of a query (in the form of an Expression Tree) into the correct code to retrieve the data described.  While this may be easier to achieve if MS provides more direct support for OODBs, it may in fact be easier for you to provide the transform logic than it is for anyone to correctly translate the expression tree into vendor-specific SQL for a mainstream RDB.

    All that's needed, I think, is for you to take a look at DLinq and create some extension methods for simple queries, and then go on from there.  I don't think you need to wait for MS.


  • Dick R

    Hello,
    I waited MSSQL 2005 to support OODB. But they didnt.

    Now Im using ODBMS in my projects. It makes easier code, and u dont have to tire your head with DAL, BL.
    The best thing is nobody cant say u r not developing with OOP.

    If u are using RDBMS and have got Domain Model. DAL project is becoming procedurel code. BL project looks like OOP. UI project is using PrimaryKeys...

    OODB is not new technology.. I dont understand why nobody doesnt use it. Everybody tries to develop with OOP and Domain model.. EveryBody knows procedurel code is not good coding.

    www.db4o.com, www.odbms.org
    (sorry about my simple English)


  • Broadbent


    I waited MSSQL 2005 to support OODB. But they didnt.

    Look for future versions of SQL Server to become more "post-relational" and more like object database.


    I dont understand why nobody doesnt use it.


    People do use oodbms but mostly for small dedicated embedded systems not for enterprise. Relational is better for adhoc and reporting and has better tool support. For most organizations oodbms is seen as too risky. CAD/CAM, financial trading and automobile are several industries that I have heard about that use oodbms.

  • LDJ

     Shuklin wrote:

    Does MS have a plan to make in .NET 3.0 support for object-related database engines

    Hi,

    if you do not want to wait for Microsoft, you may consider to evaluate our open source object database db4o, http://www.db4o.com .

    It's very nice to see a discussion around object databases in a LINQ forum. We are delighted that Microsoft also sees the need to integrate queries into the programming language. LINQ is an excellent approach, it's just not really object-oriented. It also introduces more new (arbitrary) semantics than would have been necessary.

    For db4o we also provide "language integrated queries", 100% typesafe, 100% refactorable, 100% compile-time checked. We simply use the language that is there already: C# (or Java). That's why we call our approach "Native Queries". Here is a small example in .NET 2.0 C# syntax:

    IList<Cat> cats = db.query<Cat>(delegate(Cat cat){
      return cat.Name.Equals("Achat") ||
             cat.Name.Equals("Acrobat") &&
             cat.Father.Name.Equals("Occam")
           
    });
     

    Some background on Native Queries is available for download in a paper here:
    http://www.odbms.org/experts.html

    Should DLINQ be successful we will of course provide an implementation for db4o also. Back to your original question: With the announcement of DLINQ Microsoft has made a paradigm shift away from SQL more likely. Accordingly the answer is "yes". Microsoft supports object databases. Big Smile Because of the tighter coupling of objects (in RAM) and storage implementation (on hard disc) that object databases provide, they will have huge performance advantages in comparison to relational databases for DLINQ and even more for Native Queries.



  • Abhijit4229

    I think that Dmitry Shuklin has started a very interesting thread.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

     

    The current situation with database development does not address the needs of modern businesses.

     

    For example, if we have a hierarchical data model to represent some business process, then we have to do the following steps to actually create an application that implements the data model:

     

    1)       create a hierarchy of classes to represent the entities of the data model

    2)       ‘break down’ the data model into tables to store into a relational database

    3)       write code that will abstract using the tables, so the developer would not think in terms of tables when working with the data model (this also means that the developer would not think how to access data if the data is located in many different tables)

     

    Step #1 is always necessary, if we want to manipulate our data model using a programming language, and in most cases does not introduce any difficulties, since developers and business analysts are already thinking in terms of the data model entities.

     

    The real problem in modern business software development is Step #2 and #3. It is always time and resources consuming process to represent our hierarchical data as relational data. Moreover, it is always necessary to write a Data Layer, e.g. code that takes care of all database accesses, including joining on many tables, which is always the case when working with hierarchical data.

     

    Wouldn’t it be nice if all these time and resources consuming tasks would be performed by a database engine Wouldn’t it be nice if we would not have to do this over and over again when starting a new business application Of cause, it would, that’s why Object-Oriented Databases are the future of business application development. Bill Gates once said when introducing the very first version of Windows: “For how long the programmers will need to write code to open a file ” The same situation here: for how long we have to spend our time doing job that MUST be done by a database engine

     

    And the problem is not only in adding support to a programming language, like Microsoft is doing now with the LINQ project and the COmega compiler. That is only a syntactical sugar for developers to access data that is already stored in a relational database (or in array, file, etc.). No doubts, this is a very nice and powerful addition to the .NET Framework, and we were waiting for this for years, and we will be happy to use it in our development. As Don Box and Anders Hejlsberg have pointed out, we will “benefit from the rich metadata, compile-time syntax checking, static typing and IntelliSense that was previously available only to imperative code”. And that’s a very nice and long aviated feature of C# and Visual Basic.

     

    The real problem that is a becoming more and more of a concern for businesses is performance. We all know how long it could take to access a database when executing many quires on many tables. Sometimes we just need to get a few records (a few entities), but we need to access a lot of tables, which of cause puts a heavy load on the database engine, and on the network. If we had an OO Database, it would do the entire job internally without requiring to specify the tables, and most important, without requiring us to access all of them and without sending the data over a network or the Internet.

     

    In conclusion, I want to say that such a Network OO database would be very useful for development of business applications. If properly implemented (and it needs to be properly implemented; otherwise there would not be any reason to use it), it would drastically reduce the development time and increase the performance of our web-applications. I guess, Microsoft will eventually do that, but that, of cause, is a question not to the .NET Framework architects and developers, but rather to the SQL Server team.

     

    Dmitry Shuklin, where can I get a link to your OO database to take a look at what you have done

     

    Regards,

    Andriy Knysh

     


  • Cridal69

    Hello Carl,

    Thanks for answer, but I am interested in quering object "9998" from method of object "9997". these ids given just for example.

    lets assume that i have a classes like this:

    class BaseNode
    {
        BaseNode prev;
        BaseNode next;
        int x;
        abstract doSomething();
    }

    class A : BaseNode
    {
       override doSomething()
       {
          x += 1;
          next.doSomething();
       }
    }

    class B : BaseNode
    {
       override doSomething()
       {
          x -= 1;
       }
    }

    lets assume that DB contains 10000 objects :
    ...
    o9996:    o9996.prev = o9995; o9996.next = o9997;
    o9997:    o9997.prev = o9996; o9997.next = o9998;
    o9998:    o9998.prev = o9997; o9998.next = o9999;
    o9999:    o9999.prev = o9998; o9999.next = o10000;
    ...

    and o9997 is A and o9998 is B
    and application have "pointer" to o9997
    and application wants calls o9997.doSomething();

    how it will be implemented on server side lets assume that all objects are not instantiaded yet.

    in My OODB it will be implemented like this:

    server:

    class A:IBaseNode
    {
       handle next;
       handle prev;

       soSomething()
       {
          x += 1;
          handle h = this.next;
          connector c = db.attach(h);
          ((IBaseNode)c.component).doSomething();
          c.Dispose();
       }
    }

    application:

          handle h = h9997;
          connector c = db.attach(h);
          ((IBaseNode)c.component).doSomething();
          c.Dispose();

    I want to know how do you solve this without instantiating all o0001 - o10000 objects

    WBR,
    Dmitry



  • Object-oriented network database