6 Replies - 478 Views - Last Post: 30 July 2011 - 08:43 PM Rate Topic: -----

#1 grasmanek94  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 11-July 11

Is there any open source database that can be integrated in my source?

Posted 30 July 2011 - 06:14 PM

Welcome,

My question is a bit weird but it has its uses..

I am developing extensions for a game server, so the coders can have a 'easier' life to script something using the extensions functions that it provides.

Now I was thinking about a verry effiecient en fast database system to INTEGRATE into my own extension.

I had a good idea about remaking the MySQL source to fit in a console app, so it's functions can be called from the server and written to the server files. However SQLite is fast too yeah?

The server is single threaded so there will be no problem with not using threads (using them may cause problems).

Please be aware that at the server side performance is one of the most important things, people do not use ini files anymore, they got to cache systems, SQLite3 or MYSQL,

But straight to the point:
I want to make something different than sqlite, mysql. something independend ... an extension which does not require a mysql server or more than 1 file (so I can have one big database), so I want to make an extension that will make a database, however reading and writing to it should be fast as possible. So now I am asking: is there any open source library than I can use for my needs? An stand-alone database system with some good functions to manage players data like age sex male/female score ip bans etc...



Hope you can help me, thanks in advance :)

Edit: It is also important that the library is cross-compatible (windows + linux) or it has to have an windows and linux variant....

This post has been edited by grasmanek94: 30 July 2011 - 06:33 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Is there any open source database that can be integrated in my source?

#2 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Is there any open source database that can be integrated in my source?

Posted 30 July 2011 - 06:35 PM

So exactly what is wrong with SQLite? It sounds like it would be the solution you are looking for. And if you want to customize it or extend it in anyway you can.

It is a fantastic little DB and I have used it on a number of occasions and have always been impressed with it performance.

There are a number of embedded DB projects out there you can look at. Go to source forge (or just google) and type C++ embedded database. There are tons of them. I have only used SQLite.

here is a list from wikipeida.
Was This Post Helpful? 0
  • +
  • -

#3 Adak  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 1,168
  • Joined: 01-April 11

Re: Is there any open source database that can be integrated in my source?

Posted 30 July 2011 - 06:36 PM

What you've described is a flat file database, using structs, (aka records), with struct members (aka fields), in an array. Perfectly cross compatible, standard C and C++ headers, with no extra libraries needed. Extremely fast, if you learn a few logic tweaks.
Was This Post Helpful? 0
  • +
  • -

#4 grasmanek94  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 11-July 11

Re: Is there any open source database that can be integrated in my source?

Posted 30 July 2011 - 06:40 PM

the server itself actually has build in sqlite 3 db system but the extensions one can be faster, and My script is crashing and I think it's the Sqlite3 DB because I use 3 databases (ffiles) at the same time.
So I want to make my own database which give some functions like

native CreateTable(Tablename[],filename[]);
native OpenDB(filename[]);

and then some natives to manage all data like
native AddPlayer(playername[],ip[],score);

(those natives are called from a script, and then the arguments with function calls are passed to the extension, then the extension does its job and returns back if it failed or accomplished or some custom value.

And thanks I will try to look on sourceforge, I just didn't knew what to search for so that's why I am asking it here :)

@adak, can you give some example database systems? Or whatever? :P

and the best ever DB would be a ini-like database which is extremely fast.

edit:
hmm,
i have read http://en.wikipedia....t_file_database
and Yes flat file DB could be something I need, but the values must have the possibility to be empty (NULL) and also have any available character like []\;'".,><!@#$%^&*()_+1234567890poiuytrewqasdfghjklmnbvcxzQWERTYUIOPLKJHGFDSAZXCVBNM


hmm forget everithinmg.. is it possible to make a INI database system which is very very very fast?
So one big file, and in it are ini files
so i just would need to give the ini tag argument and the node,s o i have this Database File:

[PlayerOne]
score=456

[PlayerTwo]
score=543


and that db system should be without looping the whole file, it should go to the teg/node immediately... so it will be faast? This is my dream and would be cool if such db system exists.

This post has been edited by grasmanek94: 30 July 2011 - 07:09 PM

Was This Post Helpful? 0
  • +
  • -

#5 Adak  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 1,168
  • Joined: 01-April 11

Re: Is there any open source database that can be integrated in my source?

Posted 30 July 2011 - 08:08 PM

If you can program in C or C++, I wouldn't USE a database, I would program your OWN database. All you need is a fairly simple flat file, with an array of structs, and some functions to support things like adding players, deleting players, searching for players, (scores, etc.), and editing players data.

Sounds big, but it's not. Students make them up, regularly.

And they SCREAM, compared to anything from SQL (anything). Regular databases are overkill for what you need, imo, and to handle that, they are a lot slower.

What capacity do you anticipate you'll need?
Was This Post Helpful? 0
  • +
  • -

#6 grasmanek94  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 11-July 11

Re: Is there any open source database that can be integrated in my source?

Posted 30 July 2011 - 08:35 PM

well like 4000 to 5000 player entries expandable to 1,000,000 should be enough with about 128 entries per player (score, car, name..... etc etc).. , and an unlimited size ban (for banning player names, ips with reasons and timestamps + extra info) file.. I'm really new to C++, my lastest project is http://code.google.com/p/sa-mp-drift/ ,
if you look at http://code.google.c...ounter/main.cpp
everithing in this file has been scripted by me, using some examples and tuts, and my own math knowledge.
now well, if you see that main.cpp.. that's my whole skill in C++ , + a bit more.. making such database in my case would not really be fast. I would appreciate it if somebody could point me in the right direction (urls to tuts, examples, or maybe some ready to include DBs?)
Was This Post Helpful? 0
  • +
  • -

#7 Adak  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 1,168
  • Joined: 01-April 11

Re: Is there any open source database that can be integrated in my source?

Posted 30 July 2011 - 08:43 PM

Databases (even flat file DB's), are optimized by indexing, and that's one of the big reasons they are so fast. If you make your own, you optimize that indexing to suit your needs, and the DB is all the faster.

For that kind of capacity, (> 100,000), a regular DB for C++ should be used, so I'm out of here. Good luck!

This post has been edited by Adak: 30 July 2011 - 08:48 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1