C# database project

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jelle de Jong

    C# database project

    Hi,

    I want to start a new project, I want to build my own database server and
    start very simple. I want to create a file-based database server, with
    XML-files. Does anyone know a good site or book to get some more information
    about this kind of project (like 'How to build your own database server')?

    Or can someone help me start...?

    I want to build it in C# (.NET) and save files in XML.

    I want to use XML-files to use as my database-definition files, like:

    <data>
    <database name="TestDB">
    <table name="TestTable ">
    <field type="PrimaryKe y" name="ID" />
    <field type="String" name="Name" />
    <field type="DateTime" name="DateOfBir th" />
    <field type="Bool" name="Male" default="True" />
    </table>
    </database>
    </data>

    I also want to use/create a SQL like query language to use for querying this
    database.

    Hopefully someone can help me.

    Thanks in advance.



    Greetings,

    Jelle

  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: C# database project

    Jelle,

    This is a ^tremendous^ undertaking that you are considering. I don't
    know if you are doing it because you have to (in which case, I would say
    find some other data source) or if you are just doing it for the hell of it,
    but either way, it's not easy.

    The major areas you have to deal with are the storage of the data, and
    the querying of the data. While these are the two main concerns, there are
    going to be many things that you have to consider:

    - How will storing data structure/information in XML affect the performance
    of the database?
    - How will you affect concurrent access to the database?
    - How will you handle indexes (you have a primary key, which implies an
    index in most/all DB systems)
    - How will you connect to the database and execute commands/return
    information
    - What will the query language look like?

    These are just ^some^ of the issues you have to deal with when writing a
    DB server. There are many, many more, but the questions posed above are
    probably good places to start.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Jelle de Jong" <jelle@nospam.h oest.nlwrote in message
    news:47b34992$0 $19307$9a622dc7 @news.kpnplanet .nl...
    Hi,
    >
    I want to start a new project, I want to build my own database server and
    start very simple. I want to create a file-based database server, with
    XML-files. Does anyone know a good site or book to get some more
    information about this kind of project (like 'How to build your own
    database server')?
    >
    Or can someone help me start...?
    >
    I want to build it in C# (.NET) and save files in XML.
    >
    I want to use XML-files to use as my database-definition files, like:
    >
    <data>
    <database name="TestDB">
    <table name="TestTable ">
    <field type="PrimaryKe y" name="ID" />
    <field type="String" name="Name" />
    <field type="DateTime" name="DateOfBir th" />
    <field type="Bool" name="Male" default="True" />
    </table>
    </database>
    </data>
    >
    I also want to use/create a SQL like query language to use for querying
    this database.
    >
    Hopefully someone can help me.
    >
    Thanks in advance.
    >
    >
    >
    Greetings,
    >
    Jelle

    Comment

    • Jelle de Jong

      #3
      Re: C# database project

      By the way, I want to use it for webapplications and windowsapplicat ions.



      "Jelle de Jong" <jelle@nospam.h oest.nlwrote in message
      news:47b34992$0 $19307$9a622dc7 @news.kpnplanet .nl...
      Hi,
      >
      I want to start a new project, I want to build my own database server and
      start very simple. I want to create a file-based database server, with
      XML-files. Does anyone know a good site or book to get some more
      information about this kind of project (like 'How to build your own
      database server')?
      >
      Or can someone help me start...?
      >
      I want to build it in C# (.NET) and save files in XML.
      >
      I want to use XML-files to use as my database-definition files, like:
      >
      <data>
      <database name="TestDB">
      <table name="TestTable ">
      <field type="PrimaryKe y" name="ID" />
      <field type="String" name="Name" />
      <field type="DateTime" name="DateOfBir th" />
      <field type="Bool" name="Male" default="True" />
      </table>
      </database>
      </data>
      >
      I also want to use/create a SQL like query language to use for querying
      this database.
      >
      Hopefully someone can help me.
      >
      Thanks in advance.
      >
      >
      >
      Greetings,
      >
      Jelle
      >

      Comment

      • Jelle de Jong

        #4
        Re: C# database project

        Nicholas,

        I know it's not an easy project, but I just want to create something for my
        own use. And this is a real challenge! ;-)

        I want to start very simple. My idea was to work with some form of
        Serialization. But I don't know what the performance will be when I want to
        write back to the filesystem.

        It's just for fun, and maybe someone also wants to create such a thing or
        did it before?

        Gr.,
        Jelle



        "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c omwrote in
        message news:%23yQ19onb IHA.5164@TK2MSF TNGP03.phx.gbl. ..
        Jelle,
        >
        This is a ^tremendous^ undertaking that you are considering. I don't
        know if you are doing it because you have to (in which case, I would say
        find some other data source) or if you are just doing it for the hell of
        it, but either way, it's not easy.
        >
        The major areas you have to deal with are the storage of the data, and
        the querying of the data. While these are the two main concerns, there
        are going to be many things that you have to consider:
        >
        - How will storing data structure/information in XML affect the
        performance of the database?
        - How will you affect concurrent access to the database?
        - How will you handle indexes (you have a primary key, which implies an
        index in most/all DB systems)
        - How will you connect to the database and execute commands/return
        information
        - What will the query language look like?
        >
        These are just ^some^ of the issues you have to deal with when writing
        a DB server. There are many, many more, but the questions posed above are
        probably good places to start.
        >
        >
        --
        - Nicholas Paldino [.NET/C# MVP]
        - mvp@spam.guard. caspershouse.co m
        >
        "Jelle de Jong" <jelle@nospam.h oest.nlwrote in message
        news:47b34992$0 $19307$9a622dc7 @news.kpnplanet .nl...
        >Hi,
        >>
        >I want to start a new project, I want to build my own database server and
        >start very simple. I want to create a file-based database server, with
        >XML-files. Does anyone know a good site or book to get some more
        >information about this kind of project (like 'How to build your own
        >database server')?
        >>
        >Or can someone help me start...?
        >>
        >I want to build it in C# (.NET) and save files in XML.
        >>
        >I want to use XML-files to use as my database-definition files, like:
        >>
        ><data>
        > <database name="TestDB">
        > <table name="TestTable ">
        > <field type="PrimaryKe y" name="ID" />
        > <field type="String" name="Name" />
        > <field type="DateTime" name="DateOfBir th" />
        > <field type="Bool" name="Male" default="True" />
        > </table>
        > </database>
        ></data>
        >>
        >I also want to use/create a SQL like query language to use for querying
        >this database.
        >>
        >Hopefully someone can help me.
        >>
        >Thanks in advance.
        >>
        >>
        >>
        >Greetings,
        >>
        >Jelle
        >
        >
        >

        Comment

        • Nicholas Paldino [.NET/C# MVP]

          #5
          Re: C# database project

          Jelle,

          If you are going to use it for web-based applications, then I really
          have to say that you are going to have to do plenty of dirty little things
          to make sure it performs well, and you are going to have to make sure that
          transaction consistency is bullet-proof. With the number of people that
          will hammer the database at the same time in a web-based app, those things
          are certainly going to be put to the test.

          Additionally, if the database is file-based, you simply are not going to
          get the performance you can get with keeping the data in memory and paging
          out to disk when necessary. The reason for this is that if all of your
          operations are done on the file each time they occur, your disk access
          becomes a HUGE bottleneck for you.


          --
          - Nicholas Paldino [.NET/C# MVP]
          - mvp@spam.guard. caspershouse.co m

          "Jelle de Jong" <jelle@nospam.h oest.nlwrote in message
          news:47b34bd0$0 $25500$9a622dc7 @news.kpnplanet .nl...
          By the way, I want to use it for webapplications and windowsapplicat ions.
          >
          >
          >
          "Jelle de Jong" <jelle@nospam.h oest.nlwrote in message
          news:47b34992$0 $19307$9a622dc7 @news.kpnplanet .nl...
          >Hi,
          >>
          >I want to start a new project, I want to build my own database server and
          >start very simple. I want to create a file-based database server, with
          >XML-files. Does anyone know a good site or book to get some more
          >information about this kind of project (like 'How to build your own
          >database server')?
          >>
          >Or can someone help me start...?
          >>
          >I want to build it in C# (.NET) and save files in XML.
          >>
          >I want to use XML-files to use as my database-definition files, like:
          >>
          ><data>
          > <database name="TestDB">
          > <table name="TestTable ">
          > <field type="PrimaryKe y" name="ID" />
          > <field type="String" name="Name" />
          > <field type="DateTime" name="DateOfBir th" />
          > <field type="Bool" name="Male" default="True" />
          > </table>
          > </database>
          ></data>
          >>
          >I also want to use/create a SQL like query language to use for querying
          >this database.
          >>
          >Hopefully someone can help me.
          >>
          >Thanks in advance.
          >>
          >>
          >>
          >Greetings,
          >>
          >Jelle
          >>
          >

          Comment

          • Jelle de Jong

            #6
            Re: C# database project

            Nicholas,

            So maybe it's better to use XmlSerializatio n to save objects to the
            filesystem and Deserialize them to use them as objects again. So no
            query-language or in-memory data or whatsoever. Or use MySQL, SQL Server or
            Oracle instead ;-)

            Or do you have other nice ideas about how people should store their data
            into a data-structure or a filesystem?


            Gr.,
            Jelle



            "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c omwrote in
            message news:%23UoBExnb IHA.1960@TK2MSF TNGP02.phx.gbl. ..
            Jelle,
            >
            If you are going to use it for web-based applications, then I really
            have to say that you are going to have to do plenty of dirty little things
            to make sure it performs well, and you are going to have to make sure that
            transaction consistency is bullet-proof. With the number of people that
            will hammer the database at the same time in a web-based app, those things
            are certainly going to be put to the test.
            >
            Additionally, if the database is file-based, you simply are not going
            to get the performance you can get with keeping the data in memory and
            paging out to disk when necessary. The reason for this is that if all of
            your operations are done on the file each time they occur, your disk
            access becomes a HUGE bottleneck for you.
            >
            >
            --
            - Nicholas Paldino [.NET/C# MVP]
            - mvp@spam.guard. caspershouse.co m
            >
            "Jelle de Jong" <jelle@nospam.h oest.nlwrote in message
            news:47b34bd0$0 $25500$9a622dc7 @news.kpnplanet .nl...
            >By the way, I want to use it for webapplications and windowsapplicat ions.
            >>
            >>
            >>
            >"Jelle de Jong" <jelle@nospam.h oest.nlwrote in message
            >news:47b34992$ 0$19307$9a622dc 7@news.kpnplane t.nl...
            >>Hi,
            >>>
            >>I want to start a new project, I want to build my own database server
            >>and start very simple. I want to create a file-based database server,
            >>with XML-files. Does anyone know a good site or book to get some more
            >>information about this kind of project (like 'How to build your own
            >>database server')?
            >>>
            >>Or can someone help me start...?
            >>>
            >>I want to build it in C# (.NET) and save files in XML.
            >>>
            >>I want to use XML-files to use as my database-definition files, like:
            >>>
            >><data>
            >> <database name="TestDB">
            >> <table name="TestTable ">
            >> <field type="PrimaryKe y" name="ID" />
            >> <field type="String" name="Name" />
            >> <field type="DateTime" name="DateOfBir th" />
            >> <field type="Bool" name="Male" default="True" />
            >> </table>
            >> </database>
            >></data>
            >>>
            >>I also want to use/create a SQL like query language to use for querying
            >>this database.
            >>>
            >>Hopefully someone can help me.
            >>>
            >>Thanks in advance.
            >>>
            >>>
            >>>
            >>Greetings,
            >>>
            >>Jelle
            >>>
            >>
            >
            >
            >

            Comment

            • Jelle de Jong

              #7
              Re: C# database project

              Nicholas,
              >
              There is nothing wrong with saving data to the file system, but keep in
              mind that ^always^ accessing the data from the files in the file system is
              going to be a huge bottleneck for you.
              >
              But when I'm using Serialization, my application should perform better, then
              the object will be in-memory while it's being used, isn't it? And in-memory
              is the fastest way, I presume?



              Jelle

              Comment

              • Nicholas Paldino [.NET/C# MVP]

                #8
                Re: C# database project

                Jelle,

                Yes, it will be in memory, but you want to ^keep^ it in memory for as
                long as possible. If you save it back to the filesystem after an update,
                for example, and then reload it again the next time you need it, that's
                going to cause a bottleneck. If you already have it lying around in memory,
                you wouldn't have to load it from disc.


                --
                - Nicholas Paldino [.NET/C# MVP]
                - mvp@spam.guard. caspershouse.co m

                "Jelle de Jong" <jelle@nospam.h oest.nlwrote in message
                news:47b35e03$0 $25500$9a622dc7 @news.kpnplanet .nl...
                Nicholas,
                >
                >>
                > There is nothing wrong with saving data to the file system, but keep
                >in mind that ^always^ accessing the data from the files in the file
                >system is going to be a huge bottleneck for you.
                >>
                >
                But when I'm using Serialization, my application should perform better,
                then the object will be in-memory while it's being used, isn't it? And
                in-memory is the fastest way, I presume?
                >
                >
                >
                Jelle

                Comment

                Working...