Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here are some things you will probably notice. Start with a really small database, maybe 10,000 facts. How long does a query take? Half a second? One second? I am just guessing here. It will take less than a millisecond on a usual SQL database.

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.



So I timed the compile step and it gets quite long at one second for 10,000 facts, about a 1/10th of a second per 1000 entries. I wasn't expecting my first attempt at a database to be able to handle 100,000 facts or to be able to compare with SQL, but I did think GCC would be a little bit faster than that. Interestingly, when I created arbitrary relations between the data and queried them, the queries themselves executed in 5ms no matter how large the data set. I think I might convert nebula back into a graph-based logic programming language and try to make a triple-store without a compile step.


Just to put this into perspective, 100,000 facts is a tiny amount for a databases. If you use it for a blog having 250 users with 20 articles per user and 20 comments per article you have already reached 100,000 comments. If you add the date of and the user writing the comment you are at 300,000 facts. And we haven't yet stored any information about the users or articles.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: