Show HN: NebulaDB, my first attempt at a database
github.com
github.com
NebulaDB manages a c file that is full of structs that have arrays of pointers to links. When you save a query new structs are added to the file along with c functions that configure the links. When you query the data, the function that corresponds to your query is appended to the c file, the file is compiled and the output is parsed into JSON downstream.
Seriously?
Whether sharing this particular example here was brave or stupid is up for grabs though... ;) (No offense to the OP intended. I think it's an interesting example of thinking outside the box, and I'm sure you're learning a lot more than you would going through a bunch of online tutorials!)
What exactly have you been doing for two years if you think compiling is an "advanced concept"?
By the way, your functions go in the .c file, not in the .h file.
[1] http://www.amazon.com/Fundamentals-Database-Systems-Ramez-El...
The only thing I sometimes worry about - and this is a quite good example - is if it is really a good idea to have all the weekend fun projects in the public. You want to know if there are some interesting new databases or libraries for something? Search for it and you get an ever increasing list of results with 99 % useless weekend hacks. I am not sure how it will turn out in the long run but there might be some real danger of polluting the internet with evermore useless stuff and bad code.
And the comment was not specifically aimed at your project, but is a very general thought about potentially negative effects of having an ever increasing amount of code in the public. Similar to the situation for satellites and space junk.
The dominant standard, the relational model now often more or less synonymous with SQL, is 45 years old, the first »modern« database systems are more than 50 years old like IDS [1] released in 1964. But even those are usually referred to as 3rd generation systems with a decade or so of development on their back. And if you want to you could go even further back, at least as far as 1884, 130 years, and the Hollerith machines which are at the roots of IBM.
And with this expectation I looked at your project and found something that is probably the most convoluted ways to implement an database that I have seen. Really, don't take it personal, but there is not much that resembles a usual database system design and there is nothing where I honestly could have said that it is a nice idea but it could be improved by doing this or that. I could have suggested to read the Wikipedia article on databases [2] and work from there, but would this really have sounded less rude?
"Seriously?"
Perhaps going beyond the first word and explaining your thoughts would have been worth more of everyone's time?
Now increase the size of the database to say 100,000 facts. This will make essentially no difference for a normal database because they will likely be able to answer the query using an index in time logarithmic in the number of facts but it will take NebulaDB ten times longer to answer a query because GCC has to compile a ten times larger file.
If there is some quadratic code somewhere in the system it may actually take a hundred times longer. Every query requires processing all the data while a usual database will only touch the data relevant to answer the query.
Another thing are updates and deletions. I did not read the code in enough detail but can you support that? If yes it sounds a bit like a nightmare to me to find and remove or update the relevant lines in the C source code file. And it will be very likely a slow process because if the length of a fact changes you will have to move all the later facts.
> NebulaDB runs on a Node server.
I wish there was a way to declare non-Node dependencies in the package.json.
['* ','->','admin']
Couldn't you write a little parser to understand this:
" * -> admin"
I doubt the overhead would be much.
[edit] a * is hard to get into a HN comment