What I want to do is write a database program that is independent of SQL, MySQL, Access, etc...

I don't want to use Access due to file size limitations and speed decrease. I don't want to use SQL due to expense and licensing. I looked at MySQL, but I don't want to purchase it for commercial use, which is what I would have to do since my project is not open-source.

So...I plan on using files.

I have a program that currently works off of files. It has several functions to load the file to memory as a string, set fields, write the string back to file, etc...and it all works fast.

However, I am trying to think long-term and how it will work in terms of speed as the database grows and more files are added.

So, it would help if I knew how SQL and other databases work. I assume they make use of memory, since it is a lot faster than accessing from the hard drive. Also, I assume there is some indexing going on or something that makes it so fast.

My question for you guys is can anyone offer some ideas that would help me make this a reality?

Thanks!