Patch notes: what does DDNet use SQL for?

Request help for teeworlds-related subjects (mapping, servers, ..).
For client issues, see our repositories (https://github.com/ddnet/ddnet/issues).
Post Reply
Pathos
Posts: 176
Joined: Wed Jun 17, 2015 4:30 pm

Patch notes: what does DDNet use SQL for?

Post by Pathos »

https://github.com/ddnet/ddnet/compare/10.1.1...10.2.1

It shows master SQL server. Is this a brand new code?

What are tokens that are sent to other clients that's not being sent to vanilla clients?
HMH
Posts: 145
Joined: Mon May 05, 2014 8:41 pm
Player profile: http://ddnet.tw/players/HMH/

Re: Patch notes: what does DDNet use SQL for?

Post by HMH »

Pathos wrote:what does DDNet use SQL for?
DDNet uses sql (specifically MariaDB https://mariadb.org/) to save ranks, teamranks, savegames and thus to calculate points and all the stuff you can find here: https://ddnet.tw/ranks/ .

Pathos wrote:It shows master SQL server. Is this a brand new code?
It indeed is more or less new code I have been working on for quite some time now. It enables the DDNet-Servers to connect to more than one Database-server. This has several benefits: If a DB-server can not be reached the DDNet-server can fallback to another one.
Additionally all actions that modify the sql-database can be delegated to a so called masterserver. This enables easier/better ways to structure our databasesystem which we will adopt soon. For more info I recommend to read deen's great article 'Experiences of Running an Online Game for 3 Years'; it also includes some info about our database system: https://hookrace.net/blog/ddnet-evoluti ... e-platform .

Basically all this stuff happens under the hood and players will not notice.

PS. all this stuff also includes saving ranks to a file if no database-server is currently reachable. The thing I still need to do is some automation to add those ranks from their files into the database so there will be less posts like this: viewtopic.php?f=88&p=41684#p41684 or viewtopic.php?f=88&t=3503 . But surely this is better than just losing these ranks as previously.
Pathos
Posts: 176
Joined: Wed Jun 17, 2015 4:30 pm

Re: Patch notes: what does DDNet use SQL for?

Post by Pathos »

I see.

Can you briefly describe how the fallback SQL server would work? How many of them will be there? Will it be regional backups?

The reason why I ask if it is regional backup is because as mentioned in the posts you linked, Chilean servers may be difficult to connect to for the rest of the world at times. My guess is that this is an infrastructural issue, which would naturally call for a Chilean backup on its own.
HMH
Posts: 145
Joined: Mon May 05, 2014 8:41 pm
Player profile: http://ddnet.tw/players/HMH/

Re: Patch notes: what does DDNet use SQL for?

Post by HMH »

The plan is to have three master-database-servers in a replication-ring which will allow inserts. All other servers will replicate from them to provide faster access to things like /top5 but those will not allow inserts from the gameservers. So if one master is not reachable after a map was finished the next one will be tried until there is no one left. If this is the case the rank will be backed up in a file and (currently) needs to be restored manually.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest