AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   About MySQL and Sqlite (https://forums.alliedmods.net/showthread.php?t=335672)

wilian159 12-24-2021 00:32

About MySQL and Sqlite
 
I have a 'bank' that saves in MYSQL, but sometimes MYSQL is off, would I be able to use SQLITE and MYSQL together?

If by chance MYSQL does not respond, save in SQLITE, and every X seconds send the SQLITE data to the MySQL server


Or is it not possible to connect 2 banks at the same time? or if you have another solution.

Natsheh 12-24-2021 04:06

Re: About MySQL and Sqlite
 
https://forums.alliedmods.net/showpo...5&postcount=10

CryWolf 12-24-2021 04:55

Re: About MySQL and Sqlite
 
Don't bother, because if MySQL server is not on the same machine with Game Server you will always have problems with querry, i use a lot of MySQL but only on the same hawk as the Game Server, otherwise it doesn't respond verry well.
Just sain

HamletEagle 12-24-2021 07:19

Re: About MySQL and Sqlite
 
Quote:

Originally Posted by CryWolf (Post 2766807)
Don't bother, because if MySQL server is not on the same machine with Game Server you will always have problems with querry, i use a lot of MySQL but only on the same hawk as the Game Server, otherwise it doesn't respond verry well.
Just sain

You could just use threaded queries to avoid freezing the main game thread.

CrazY. 12-24-2021 07:38

Re: About MySQL and Sqlite
 
Save to a vault file. I don't see why you would need a MySQL database for that if you are using it only in the game server itself. You're just adding an extra overhead that is not needed at all.

wilian159 12-25-2021 00:05

Re: About MySQL and Sqlite
 
Quote:

Originally Posted by CryWolf (Post 2766807)
Don't bother, because if MySQL server is not on the same machine with Game Server you will always have problems with querry, i use a lot of MySQL but only on the same hawk as the Game Server, otherwise it doesn't respond verry well.
Just sain

Exactly, that's the problem, I use a database outside the cs server, and sometimes it doesn't connect, I was thinking of using 'grip', but the grip has a buffer limit, they say there is no limit, I wanted to know more about.


Quote:

Originally Posted by CrazY. (Post 2766816)
Save to a vault file. I don't see why you would need a MySQL database for that if you are using it only in the game server itself. You're just adding an extra overhead that is not needed at all.

the bank was an example. I'm doing something much bigger like managing admins etc.

Shadows Adi 12-25-2021 03:47

Re: About MySQL and Sqlite
 
Quote:

Originally Posted by wilian159 (Post 2766860)
Exactly, that's the problem, I use a database outside the cs server, and sometimes it doesn't connect, I was thinking of using 'grip', but the grip has a buffer limit, they say there is no limit, I wanted to know more about.

For switching from MySQL to SQLite, you can take a look here:
https://github.com/ShadowsAdi/MostVa...ble_player.sma

And I use curl instead of grip for some projects and it works well, except for some incorrect buffers which seems to be intended ( https://github.com/Polarhigh/AmxxCurl/issues/11):
https://github.com/Polarhigh/AmxxCurl

bigdaddy424 12-25-2021 16:24

Re: About MySQL and Sqlite
 
In order to keep both databases with fresh stats you must connect to both sources and refresh their data so whenever one fails, the other one can get you the answer to your query. I'd suggest a table on both databases that saves the integer of current systime so you know which one was updated recently in order to get what you need from that db and not the old one.


All times are GMT -4. The time now is 11:39.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.