Fork me on GitHub
  October 22, 2018, 01:35:34 pm
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: MC Server compatibility or SQLite database?  (Read 3551 times)
joehillen
Newbie
*
Posts: 9


Minecraft Username: StylishHobo


View Profile
« on: March 01, 2011, 06:49:59 am »

The way I see it, the point of this project is to make up for the design mistakes made with the original Minecraft server.

I don't know much about the how the current map data is stored in mineserver, but at first glance it looks very similar to how the original server was implemented.

My thought is it is probably better to store map and user data in a databases, such as sqlite, rather than as a set of flat chunk files. It would require a good bit of refactoring, but there would definitely be a significant performance improvement.

This of course would break compatibility with the original minecraft worlds. However it could be possible to write tools for mineserver that make it possible to import and export minecraft worlds.

I'm curious what everyone's thoughts on this issue are.
« Last Edit: March 01, 2011, 06:58:06 am by joehillen » Logged
Jailout2000
Newbie
*
Posts: 49


Enthusiast


View Profile WWW
« Reply #1 on: March 01, 2011, 07:33:03 am »

My thought is it is probably better to store map and user data in a databases, such as sqlite, rather than as a set of flat chunk files. It would require a good bit of refactoring, but there would definitely be a significant performance improvement.
The chunk files store (roughly) one byte per block in a chunk; that's equivalent to 16*128*16, which is 32,768 bytes per chunk.

If you wanted to place an entire chunk within an SQL engine, it would need to be built for performance, which is possible but most users don't build their databases and tables for data loading/saving that much at a time.

In other words, I don't think SQL would be the best choice for world chunks; keep it as flat files in my opinion.

However, SQL for other data such as player data/inventory, world time, user permissions, etc. could be transferred to SQL since there's little to work with at a single moment; and for what there is, it takes little to no effort to read/write it in SQL.

Also, the whole SQL idea was brought up a while ago, but I forgot by whom and when.

The way I see it, the point of this project is to make up for the design mistakes made with the original Minecraft server.

I don't know much about the how the current map data is stored in mineserver, but at first glance it looks very similar to how the original server was implemented.
Yes, mineserver is meant to be an improvement over the original "vanilla" server. That doesn't mean, however, that we don't implement its concepts and features. Being that it's written in C++, those same concepts and features will run better, since code is being ran natively on the CPU instead of in an interpreter ran in a JVM (Java Virtual Machine).

Besides, many people (including myself) wish to use mineserver, but have the exact same, if not close to, the features that the vanilla server has. And because of how mineserver is being written, it'll be easy to implement our own ideas, even our own recipes for furnaces/workbenches (which means one could make a stone block turn into a diamond pickaxe, if one wanted to, or one could also smelt a sapling and turn it into wood, again if one wanted to).

I'm curious what everyone's thoughts on this issue are.
I'm not trying to harp on you, but I am giving you insights as to why some things are done the way they are, and why some things haven't been done yet.

In fact, that's what these forums are for--to discuss what mineserver is, will be, and what it can do.

Regards,
- Jailout2000
Logged

Visit my website to see what's up with me.
joehillen
Newbie
*
Posts: 9


Minecraft Username: StylishHobo


View Profile
« Reply #2 on: March 01, 2011, 08:17:25 am »

Yeah, handling user data is what gave me the idea for using SQL, that would probably be its best use case.

Kika64 on IRC pointed out a recent update for minecraft to me.

http://mojang.com/2011/02/16/minecraft-save-file-format-in-beta-1-3/

This seems like a good improvement. I see that it is already on the todo list.
Logged
Jailout2000
Newbie
*
Posts: 49


Enthusiast


View Profile WWW
« Reply #3 on: March 02, 2011, 02:42:28 am »

Kika64 on IRC pointed out a recent update for minecraft to me.

http://mojang.com/2011/02/16/minecraft-save-file-format-in-beta-1-3/

This seems like a good improvement. I see that it is already on the todo list.
That would just make it tougher on SQL since there's more than one chunk per record, in that case. Then again, if you're going in SQL, it may just be different anyway... why follow Notch's format?
Logged

Visit my website to see what's up with me.
Ligustah
Newbie
*
Posts: 42


View Profile
« Reply #4 on: March 02, 2011, 04:37:04 am »

I don't see how SQL should bring any performance improvements. It doesn't even
make things easier.
Relational Databases are not supposed to be used with lots of binary data. It's more about
storing data that somehow relates to each other. And it's even more about building complex queries based on the data saved.
I really can't see where this matches with the type of data, which minecraft deals with.
Logged
joehillen
Newbie
*
Posts: 9


Minecraft Username: StylishHobo


View Profile
« Reply #5 on: March 02, 2011, 05:47:45 am »

There was a bit of a concession developed on IRC.

It was foolish of me to think that storing map data in SQL was a good idea. However, storing user data in a sqlite database would allow for much more flexibility and performance.

What it really comes down to though is whether or not anyone is willing to implement it. I had considered it, but I wanted to get people's opinions before I got started.
Logged
Jailout2000
Newbie
*
Posts: 49


Enthusiast


View Profile WWW
« Reply #6 on: March 04, 2011, 12:56:40 am »

is willing to implement it. I had considered it
Plugins are cool.

I wonder if plugins can take over the world loader/saver for everything except chunk files...
Logged

Visit my website to see what's up with me.
joehillen
Newbie
*
Posts: 9


Minecraft Username: StylishHobo


View Profile
« Reply #7 on: March 04, 2011, 01:03:08 am »

If not, it's not that hard to add hooks. A plugin would be the way to go because then people would be able to write plugins for whatever kind of databases they want.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!