Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (562)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Best Database?  (Read 1347 times)
0 Members and 1 Guest are viewing this topic.
Offline AndrewM16921

Senior Newbie





« Posted 2012-12-18 18:55:54 »

What's the recommended database to use? I've been using sqlite for many of my applications, but I'm not sure that's appropriate for a game where the map and player-data will be frequently loaded and saved and all that. Is there a better option?
Offline TheGDeveloper

Junior Member


Projects: 1



« Reply #1 - Posted 2012-12-18 19:09:56 »

the answer to that is what are your needs. What functionality do you need from your dbms

Offline princec

JGO Kernel


Medals: 379
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #2 - Posted 2012-12-18 19:18:44 »

Well, if you're just loading and saving player data and maps and so on, why bother with a database?

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sproingie

JGO Kernel


Medals: 202



« Reply #3 - Posted 2012-12-18 19:19:55 »

Postgres for industrial-strength server-side, H2 for client or small servers, sqlite for Android.

Offline AndrewM16921

Senior Newbie





« Reply #4 - Posted 2012-12-19 00:08:48 »

Well, if you're just loading and saving player data and maps and so on, why bother with a database?

Cas Smiley

Well, by maps I mean in chunks, so say 32x32 tiles at a time. But I guess I could use flatfiles for that just as easily... hmm.
Offline SwampChicken
« Reply #5 - Posted 2012-12-19 01:49:46 »

So your wanting to save binary images in your database?
Offline Best Username Ever

Junior Member





« Reply #6 - Posted 2012-12-19 03:53:39 »

Databases do not magically make things better. As a rule in programming, if you do not know what something is meant to be used for, then don't use it. Your question is sort of like asking "What's the best type of rocket fuel to use? I drive my car very frequently."

Second, do not load and save things frequently. The trick to improving disk performance is to use the disk less. You can't change read, write, or seek speeds. That's why you minimize the amount of data transferred and the number of times you need to seek.
Offline sproingie

JGO Kernel


Medals: 202



« Reply #7 - Posted 2012-12-19 05:14:41 »

Minecraft uses files to store chunks, and it works fine.  The filesystem itself is a pretty decent database for this sort of thing, as long as you're not doing it concurrently (file locking is not fast) or on mobiles (phone filesystems are tiny and slow).

It's good to learn relational databases, but you need to understand how they work (with some experience) before applying it.  The last thing you want in a project is a solution looking for a problem, it's how you ensure your project is never finished.
Offline AndrewM16921

Senior Newbie





« Reply #8 - Posted 2012-12-19 05:28:28 »

Yeah, I was thinking about Minecraft using the chunk files. I've done a lot with relational databases (mostly at school/internship though), I just figured with so much data it'd be better to put it all in one big db file but that was pretty silly of me. Anyway, thanks for the info, I think I'm gonna use the file system approach. Seems easier anyway.
Offline OverKill

Junior Member




Java games rock!


« Reply #9 - Posted 2012-12-20 10:21:00 »

Base your storage off of the way you hold your data, not the other way around. Feel me?

If you have something like Minecraft, were you basically have large memory chunks you want to quickly read&write to storage.
Perhaps a memory mapped file is something for you.

But that is for tile information and like. Perhaps for your entities (characters, items, whatever) you would still opt for a db.

Finally, as others mentioned, you have to be aware of size.
Postgres is a great db, but it consumes a lot of space and is not very portable.
H2 and sqlite on the other hand are.

So try to figure out first what you need in every aspect (what has to be stored, how much space do you have, are you running on a client or is there a server, etc pp) and then find something that fulfils those needs.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Varkas
« Reply #10 - Posted 2012-12-20 14:48:03 »

Your question is sort of like asking "What's the best type of rocket fuel to use? I drive my car very frequently.

You could try hydrazine. I'd be very interested to see how that works with a car. (... from behind a thick panel of reinforced glass Grin)

No seriously. There seldom is a "best" of anything, and I start to dislike all the "What is the best" questions.

Step 1) List all solutions that you can imagine.
Step 2) Make a list of your requirements to the solutions.
Step 3) See which of your solutions fulfill the requirements and how well they do it.
Step 4) Make a well-thought decision between those solutions which fulfill the requirements well.

This is a way to find what will be "best" for your needs. If still usnure in step 4, post yourt doubts, and people will have much better chances to actually help you, than just asking for the "best" in such a big domain as databases.

if (error) throw new Brick(); // Blog (german): http://gedankenweber.wordpress.com
Offline Damocles
« Reply #11 - Posted 2012-12-20 15:31:16 »

Oracle is a good choice good if you plan on supporting 20.000.000 players.

java.io.FileWriter is a good choice if you plan on supporting 200 players.

OR: how about just using php+mysql on a standard free or rented webspace.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (25 views)
2014-09-21 02:42:18

BurntPizza (16 views)
2014-09-21 01:30:30

moogie (19 views)
2014-09-21 00:26:15

UprightPath (26 views)
2014-09-20 20:14:06

BurntPizza (29 views)
2014-09-19 03:14:18

Dwinin (44 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (100 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56

mitcheeb (71 views)
2014-09-08 06:06:29
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!