SQLite or MySQL?
#1

The title says it all
Reply
#2

I remember ****** saying something such as using SQLite for small projects since you're not running an enterprise size website. MySQL(a web version of SQLite, another implementation of the SQL language) is better for large projects whereas a small SAMP server would be perfect for SQLite, an offline implementation of the SQL language using a .db or alike file for the database storage.
Reply
#3

I was all for MySQL back in the day, but now I would prefer SQLite. If you use SQLitei include you are all set, and you don't need to mess your gamemode with threaded queries, etc.
Reply
#4

I heared that SQLite is faster but MySQL is more famous.
Reply
#5

SQLite is my choice because there isn't a worry about query errors and of the such.
Reply
#6

Quote:
Originally Posted by Terrorizt
View Post
I heared that SQLite is faster but MySQL is more famous.
It can be faster but it really depends, the software is very outdated. MySQL can be faster if configured correctly. I personally prefer MariaDB and PostgreSQL actually.
Reply
#7

Quote:
Originally Posted by Abagail
View Post
I remember ****** saying something such as using SQLite for small projects since you're not running an enterprise size website. MySQL(a web version of SQLite, another implementation of the SQL language) is better for large projects whereas a small SAMP server would be perfect for SQLite, an offline implementation of the SQL language using a .db or alike file for the database storage.
This. I wanted to say the same thing.
SQLite is simpler than MySQL but MySQL has more power. If you don't need something really complexed, use SQLite.
And yes, you can use it to show i.e. data on your websites and so on.
Reply
#8

Quote:

Y_Less: "I've said this before. People think that MySQL is some simple plug-and-play magic bullet that you can use to just make your mode instantly better. The don't realise that the "L" in "SQL" means "language". So instead of programming PAWN, and using a bit of this mystery thing, you are now programming in two languages at once. If you spend months learning PAWN, you should spend the same time learning SQL, if not more - it is probably the more complex of the two languages, and not something that just gets bolted on to the side."

Well i'm one of those who thought that MySQL is some simple plug-n-play magic bullet. xD. I think i'm changing to SQLite and I hope it's not really diffrent from MySQL so whenever i want to change to MySQL i won't have much difficulties
Reply
#9

Quote:
Originally Posted by Terrorizt
View Post
Well i'm one of those who thought that MySQL is some simple plug-n-play magic bullet. xD. I think i'm changing to SQLite and I hope it's not really diffrent from MySQL so whenever i want to change to MySQL i won't have much difficulties
So you have already made your server to work with MySQL? Why would you change anything then?

The players won't know the difference.
Reply
#10

As many people said, use SQLite if you are not going to connect your gamemode to a website or something, SQLite is much better for me since it's easier to use.

But if you scripted it on MySQL, keep it as it is, don't change anything.
Reply
#11

Quote:
Originally Posted by Finn
View Post
So you have already made your server to work with MySQL? Why would you change anything then?

The players won't know the difference.
Nah, i just started learning it. But i hesitate because i heard it's difficult.
Reply
#12

Quote:
Originally Posted by ZachKnoxx
View Post
SQLite is my choice because there isn't a worry about query errors and of the such.
Wat. If anything, if you write wrong queries it will only be harder to debug because SQLite does not keep logs like the MySQL plugin does/can.

I also want to disprove Sergei's point about "not messing with threaded queries". If you have a moderately large database an extensive/expensive query can take a few seconds to complete. Doesn't seem like much, but if you don't thread then the main server process has to wait. This means no player updates, no callbacks being called, etc. This inevitably means that players will start to experience lag.

And my final point: the version of SQLite that is included with SA-MP doesn't seem to be have been updated since it was first implemented in 2007. This means it doesn't benefit of all the updates pushed since 2007 and it also means that it lacks a very basic feature: foreign key support. It is nearly impossible to build a properly normalized database without foreign key support. But then again, most SA-MP scripters don't know how to properly use them and can get away with merely 2 or 3 tables, whereas in both SA-MP projects I worked on I exceeded 50 tables both times.
Reply
#13

Quote:
Originally Posted by Vince
View Post
If you have a moderately large database an extensive/expensive query can take a few seconds to complete.
Do you know practical example of such case in SAMP?
Reply
#14

It all depends on what you do to me is better MySQL.
With MySQL you can do many things, like your server to synchronize with your forum, and is easier to understand.
Reply
#15

As a matter of fact, I do. I have imported the MaxMind GeoIP database into MySQL, using numerical IP ranges for increased efficiency. Some 100,000 rows. If I need to join that table to retrieve a country code or a CIDR range it sometimes takes a while, depending on the query, even with proper indexing.

For example:
PHP Code:
SELECT a.reg_nameINET_NTOA(a.regip), c.namei.block FROM account_main a
JOIN list_ipv4 i ON a
.regip BETWEEN i.range_start and i.range_end
JOIN list_countries c ON i
.country_code c.code 
Executes on average in 1.14 seconds. And that's just for the 28 accounts in my local test instance.
Reply
#16

Quote:
Originally Posted by Vince
View Post
Wat. If anything, if you write wrong queries it will only be harder to debug because SQLite does not keep logs like the MySQL plugin does/can.

I also want to disprove Sergei's point about "not messing with threaded queries". If you have a moderately large database an extensive/expensive query can take a few seconds to complete. Doesn't seem like much, but if you don't thread then the main server process has to wait. This means no player updates, no callbacks being called, etc. This inevitably means that players will start to experience lag.

And my final point: the version of SQLite that is included with SA-MP doesn't seem to be have been updated since it was first implemented in 2007. This means it doesn't benefit of all the updates pushed since 2007 and it also means that it lacks a very basic feature: foreign key support. It is nearly impossible to build a properly normalized database without foreign key support. But then again, most SA-MP scripters don't know how to properly use them and can get away with merely 2 or 3 tables, whereas in both SA-MP projects I worked on I exceeded 50 tables both times.
Everyone agrees with you that MySQL is way better than SQLite when it comes to proper databases, but if you are able to make SQLite queries to cause lag on your server you are doing something horribly wrong...

Edit: Then you come up with a perfect example why MySQL is superior... How about something that is absolutely necessary for a SA-MP server to be successful?

I am not trying to say SQLite is better, I'm trying to say that SQLite is just fine if you are not planning to make anything too overly complicated.
Reply
#17

Depends on your server needs, I personally prefer MySQL because of the easily remote control and website integration, and because of plugin functions which are really familiar to me So if you're going to create a simple server which has no website / ucp, I recommend you to use SQLite instead.

MySQL plugin saved me a lot of times, since I've been working on complex scripts, functions like "cache_insert_id" were essential on this process, I don't really know if SQLitei has this function by the way, but I heard that its a really impressive include and now its up to you decide, good luck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)