SQLX Multi-Threaded Questions.
Alright, now before I start doing any experimentation and running my-self into the ground before I know enough, I was wondering how the Multi-Threaded queries are sent.
It seems like a good idea, but there are some key issues I wish to verify before switching anything over. 1) What happens when an SQL connection is lost? Will data be lost from that point on? 2) When multi-threading is used, does it queue queries and execute later? What happens the server crashes? 3) When not using Multi-Threading, do the queries queue up? 4) Is there a precise or estimated server advantage of using this over DBI? Sorry if some of these questions were answered somewhere, but I'm just very curious before doing anything major to my plugins just yet. Thanks again. |
Re: SQLX Multi-Threaded Questions.
Since no one has answered this and I'm guessing the only person who can is Bail, I'll try and answer with educated guesses and what I know.
1) My guess is that if you run a threaded query and the connection dies before it resolves, then it'll lose all data but still call the handler function. 2) I don't think the queries queue up at all. As said in the wiki, the queue is "push one, resolve one, pop one." 3) I don't think they queue here either, I think the plugin simply halts there until it recieves a response. 4) The API is better abstracted to indicate what SQL is really like. It also has some more advanced features, such as being able to run 2 modules at once (MySQL and SQLite) and threaded querying. |
Re: SQLX Multi-Threaded Questions.
Quote:
2. It pushes them into a queue IN ANOTHER THREAD while the top one resolves. If the server crashes, you are screwed. But thats true with ANYTHING. 3. No, they are executed immedietely. 4. Yes. Since the queries are executed in another thread, they don't slow down the server while executing. |
Re: SQLX Multi-Threaded Questions.
Quote:
Code:
Quote:
Quote:
Quote:
Imagine the case of someone connecting and everyone in the server "blipping" because the DB took a few extra milliseconds to query. It got pretty bad and we moved to multithreading. Another example is the Official Server for AMX Mod X (the NFo one). The server is located in NY and our db server is in Texas, so it threads queries as to not interrupt gameplay. I'm pretty sure NFo also uses custom SQLx threading stuff on their servers. If your DB and server are close together, it's not necessary. But if you're catering to situations like the ones I described, it's a godsend. |
Re: SQLX Multi-Threaded Questions.
Alright, thank you all. Your responses were very helpful.
:) |
| All times are GMT -4. The time now is 07:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.