how hard would it be to make your own Database? Not like a database inside of MySQL/MSSQL, but like your own db system?
Printable View
how hard would it be to make your own Database? Not like a database inside of MySQL/MSSQL, but like your own db system?
Why re-invent the wheel? If its a matter of price then use Access as its free to distribute its databases and the MDAC runtimes.
Sounds more like a challenge then anything.
In which case, a data store is a data store. You can make it as simple as a txt or dat file (or some custom extension if you want) that you read yourself. How you read it, index it and access it is all you'll be building. The "database" aspect is sickeningly easy... All the tools you use with it is where it gets fun.
A DBMS comes in several layers. At the top is the API; at the bottom, the storage engine. The fun stuff is everything in between.
I imagine you could build a simple one very easily, as sevenhalo suggests. Sounds like a good learning exercise and something I wouldn't mind doing myself if I had the time.
it is really just to see how hard it would be and maybe i might make a really small one, just for fun ;)Quote:
Originally Posted by RobDog888
Then just use a textfile or an in file. :D
That is the easy way out. :DQuote:
Originally Posted by RobDog888
Go for it dclamp...see what you come up with.
I will. i will start it today... now, how should i go about making it...?
I've no idea....I've never made a database.
What were some of your original ideas?
Lets talk this through.
lol i have no original ideas. lol It just came to mind like 7 secondes before posting this thread.
Rob will know what to do... where ever he is..
I think i would have to make it in VB. Probably .NET...
I guess I have ESP now :D
Some of the older db systems used a series of text files and / or ini files. You could do that but its hard to manage and not very scaleable.
Here is a very cool feature to build into your database.
Create an internal list of reserved words and don't let people use those words as field names. :sick:
Someone should suggest that to Microsoft, Oracle, MySQL, and anyone else that makes a database used in production apps.
They all have that (well, the 'popular' DBMS's do anyway).Quote:
Originally Posted by Hack
Not surprisingly, I also wish they did that!Quote:
and don't let people use those words as field names. :sick:
It's something that comes up far too often.. hence the automatic checker I wrote (link in my sig).
What ideas do you have? What functionality do you want?Quote:
Originally Posted by dclamp
Bear in mind that to make something with a decent amount of speed or functionality will take a long time.. and the less forward-planing you do, the worse that will be.
The first part is to create the ISAM portion.
You need a place to store data records.
You need a place to store index data.
Index data needs to be binary-searchable.
This is all very easy - we've done this on mainframes 25 years ago.
So basically - you need four functions.
Create_Database
Create_Table
Put_Record
Get_Record
Get started ;)
do i need an IDE for it?
i guess i will be storing it in a text file. Lets start with how i am going to store it first...
how should it be stored, one table per file, one database per file, one record per file...?
A table creation is basically a pile of metadata (column count, each column datatype, size, etc...)
You can store each tables-metadata in a single file or store each tables-metadata at the "head" of the single-database file.
Since we are being modern (post-1950) I would suggest that each tables-metadata is stored in a single file.
So the basic initial layout of your database file is something like this (very rudimentary - but you should get the idea)
All these "blocks" of memory/data are repeated for each column and for each table that is defined.Code:(word) Number of Tables
... repeated for each table
(word) Number of Columns
(xxx) Name of Table
... repeated for each column
(word) size of column-definition
(word) Starting Byte
(word) Size of Column
(word) Datatype
(word) Size of column name
(xxx) Column name
The Create_Database and Create_Table functions create/initialize/modify this part of the file.
This would be the first part to accomplish.
ok. now what language should i write it in? I was told that i should do it in C, but i dont know a lick of C. would VB.NET be ok for it?
The two functions we are talking about - Create_Database and Create_Table could be written in fortran or cobol for all it matters - just write them!
It only matters what language you develop the "execution" functions in - and you are miles away from that ;)
btw - our EXECUTION functions on the mainframe were written in VAX-11 BASIC first and them migrated to assembler/machine code...
I wouldnt think it would make any real difference between VB 6 or .NET but if you write it in C++ your in for a hughe headache lol.
i think this is going to be more then i am in for...
You break easy :DQuote:
Originally Posted by dclamp
lol yeah!
Then if you have given up you might as well mark your thread as Resolved from the Thread Tools menu so other members will know its solved. :D
well maybe some one will come along and make it for me... lol ok i will do that.