Free Small Stand-Alone DataBase?

Started by
21 comments, last by Extrarius 18 years ago
For a project I'm working on, I'll need a free, small, stand-alone database that can be used for commercial applications. It's not that I'm selling a program, but the program will possibly be making money so I need something I can use for that without having to pay fees or open-source the project's code. I won't be distributing executables at all, so I *think* the GPL would be OK since (my understanding) is that it only requires that those that are given binaries are also given source. It won't need to support a large number of records, complex relations of any kind, high-volume traffic, or anything like that, but it does need to be reliable and it really needs to support searching by string indexes. Essentially, it will be used to store pairs consisting of a "UserName" (a string) and "Credit"(fixed-point number, though storing it as double precision should be fine). Queries won't be done often at all, maybe once a minute, but it support a decent number of queries just in case. Also, it should support some kind of "lock" operation to ensure that while one application instance is updating a record, no other application instances obtain the original or intermediate values. In general, a lock will last for up to 10 minutes, so it really needs to be a per-record thing. I'd also like to store what amounts to a log of credit going up and down based on various actions, so anything that would help with that would be great too. It's kind of like a virtual store, so this part would be multi-table, with one table storing a userID, transation ID, a timestamp, total amount of credit gained or lost, etc, and another table assocating transaction ID with item # and quantity sold/bought at what price. This will be insert-only, though, so it should be rather simple and should make use of very few (if any) locks, though it can probably be quite slow since the rate of insertion should be at maximum a few items a minute on average. So far, the only stand-alone database I've found at all is SQLite, which fails to meet my needs in many ways, but if it's all there is, I might have to end up hacking what I need out of it. Since I don't really need the full power of SQL, I'm thinking of rolling my own, but put simply I hate to do that because even the basic things I want can be difficult to get right, and I don't want to risk really screwing things up. If there are any good, inexpensive solutions, I might be willing to go with one of those, but I'll hold off at least until the application has passed basic testing before purchasing anything. If you know of any such databases that are small and stand-alone and either free or inexpensive, I'd appreciate pointers to them, comments on how they worked for you and how you used them, and any other feedback you can provide.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Advertisement
What about Berkeley DB ?
Quote:Original post by Emmanuel Deloget
What about Berkeley DB ?


Isn't that payware for non-opensource projects?
Quote:Original post by Anonymous Poster
Quote:Original post by Emmanuel Deloget
What about Berkeley DB ?


Isn't that payware for non-opensource projects?


From their licensing informations

Quote:The Sleepycat open source license permits you to use Berkeley DB, Berkeley DB Java Edition or Berkeley DB XML at no charge under the condition that if you use the software in an application you redistribute, the complete source code for your application must be available and freely redistributable under reasonable conditions. If you do not want to release the source code for your application, you may purchase a license from Sleepycat Software.


Regards,
I didn't read the post, so sorry if the following link doesn't fit your needs exactly. But judging from the subject, it might interest you ^^

http://www.sqlite.org/
Paic beat me too it, but I also recommend SQLite. It's really fast, tried and tested in commercial apps (OSX uses it) and it's API isn't bad. You said it doesn't meet your needs, but how is that?
Ollie"It is better to ask some of the questions than to know all the answers." ~ James Thurber[ mdxinfo | An iridescent tentacle | Game design patterns ]
I third the recommendation for SQLite.
enum Bool { True, False, FileNotFound };
Quote:Original post by acid2
Paic beat me too it, but I also recommend SQLite. It's really fast, tried and tested in commercial apps (OSX uses it) and it's API isn't bad. You said it doesn't meet your needs, but how is that?
First and foremost is that it only supports database-wide locking, so I can't have one application hold a lock on a record while another one processes something else using the same database. I could do something like have an extra field in the database "InUse" or somesuch, but I'd much prefer to simply get back some kind of "ERROR_LOCKED" so I don't have to add an extra field in each table I want to have per-record locks.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Oracle Database 10g Express Edition
this was the first thing to cross my mind after just reading the thread title...
(well, 4GB of user data IS small for a business database ^^)


since SQLite is not an option for you what speaks agains MySQL or PostgreSQL?
(LAMP and/or WAMP are really easy to setup....)

chaos, panic and disorder - my work here is finished

i think you desire for an automagically locking mechanism it not going really what you want (even though you think it is). now i am not a dba nor a db programming guru, but ...

reading a record from a db is not like opening a file in read mode, because it returns a copy of the record not a "pointer to the record" (forgive my c-style bias). As such you check out the copy (retrieve), modify it, and check it back in (update). I am unaware of a database that is going to give you read/write access to the record, which would imply the need for native support of writer/reader locking on a per-record basis.

Beyond that, I think your idea of creating an extra field that indicates a 'checked out/in status' is the smarter solution. this way you can manage who has the lock. In addition the field would let the check-out persist over multiple sessions and can be used to apply further security measures should this project need to expand later on.

but then again ... who am i?

This topic is closed to new replies.

Advertisement