Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (653)
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 1800 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 Devvie

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 Spiffy Duke »

Medals: 556
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 Devvie

« 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 Devvie

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):
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. 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.

SHC (28 views)
2015-08-01 03:58:20

Jesse (20 views)
2015-07-29 04:35:27

Riven (40 views)
2015-07-27 16:38:00

Riven (22 views)
2015-07-27 15:35:20

Riven (24 views)
2015-07-27 12:26:13

Riven (15 views)
2015-07-27 12:23:39

BurntPizza (36 views)
2015-07-25 00:14:37

BurntPizza (46 views)
2015-07-24 22:06:39

BurntPizza (31 views)
2015-07-24 06:06:53

NoxInc (37 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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‑
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!