SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 15/02/2017, 09:13 PM   #21
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,714
Reputation: 1255
Default Re: Redis (cache, database and message queue)

Quote:
Originally Posted by Hiddos View Post
I'd love to read up more on this or even see a proof of concept, any tips?
I'll get my article finished soon and post it here (and on the discord channel too probably) which will talk about all the tech behind the idea and how to implement it.
[HLF]Southclaw is offline   Reply With Quote
Old 23/05/2017, 10:53 AM   #22
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,714
Reputation: 1255
Default Re: Redis (cache, database and message queue)

I tried that originally but couldn't get it to compile (not a C++ dev) so I stuck with the simple header-only hiredis (lack of Windows support isn't really a problem for me, I just needed a redis connector asap). But I'm open to pull-requests! I was thinking of writing a separate windows version with the same Pawn API since a lot of people have asked me but I don't really have the time currently.

Regarding Kubernetes - yes it could be done with iptables but the "fancy" LB of Kubernetes abstracts away the complications (cluster networking is a nightmare!) it's overkill for SA:MP but it's just a fun little experiment!
[HLF]Southclaw is offline   Reply With Quote
Old 23/05/2017, 12:25 PM   #23
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,093
Reputation: 130
Default Re: Redis (cache, database and message queue)

Quote:
Originally Posted by [HLF]Southclaw View Post
I tried that originally but couldn't get it to compile (not a C++ dev) so I stuck with the simple header-only hiredis (lack of Windows support isn't really a problem for me, I just needed a redis connector asap). But I'm open to pull-requests! I was thinking of writing a separate windows version with the same Pawn API since a lot of people have asked me but I don't really have the time currently.

Regarding Kubernetes - yes it could be done with iptables but the "fancy" LB of Kubernetes abstracts away the complications (cluster networking is a nightmare!) it's overkill for SA:MP but it's just a fun little experiment!
Just wanted to check cpp_redis, and in releases changelog i found these:
Code:
Fix compilations on windows
That was 23 days ago (so ~1 May 2017)
__________________
Путин here,
Путин there,
Путин просто everywhere.


Any PM's that include question about any kind of help will be ignored.
Use appropriate boards for that
DRIFT_HUNTER is offline   Reply With Quote
Old 23/05/2017, 02:38 PM   #24
nGen.SoNNy
High-roller
 
nGen.SoNNy's Avatar
 
Join Date: Sep 2009
Location: Romania
Posts: 1,001
Reputation: 65
Default Re: Redis (cache, database and message queue)

5 starts, i'm using it.
__________________
If i've helped you, please click
nGen.SoNNy is offline   Reply With Quote
Old 02/07/2017, 04:43 AM   #25
Skillet`
Big Clucker
 
Skillet`'s Avatar
 
Join Date: Oct 2012
Posts: 171
Reputation: 132
Default Re: Redis (cache, database and message queue)

I wanted to know if you're going to keep developing this plugin ?
Skillet` is offline   Reply With Quote
Old 02/07/2017, 10:11 AM   #26
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,714
Reputation: 1255
Default Re: Redis (cache, database and message queue)

Quote:
Originally Posted by Skillet` View Post
I wanted to know if you're going to keep developing this plugin ?
Yes, at the moment it serves all my needs but if you have any suggestions or requirements let me know!
[HLF]Southclaw is offline   Reply With Quote
Old 03/07/2017, 10:49 AM   #27
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Home
Posts: 3,123
Reputation: 650
Default Re: Redis (cache, database and message queue)

Quote:
Originally Posted by [HLF]Southclaw View Post
Yes, at the moment it serves all my needs but if you have any suggestions or requirements let me know!
I had numerous questions regarding missing functionilities but as I see on the tests script, they do exist but just not listed above.

Code:
Redis_Exists(Redis:client, key[]);
Redis_Connect(host[], port, auth[]); // missing auth[]

But it do not have SSL connection capabilities as I see.

Are there going to be callbacks to catch errors and lost connection?
OnRedisConnectionLost()
OnRedisError()
Would be nice to catch them for error ouput and reconnect.
__________________
Find me on GitHub SEF community (Official NEF Successor) Ko ko nut.
Kaperstone is offline   Reply With Quote
Old 04/07/2017, 06:37 AM   #28
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Home
Posts: 3,123
Reputation: 650
Default Re: Redis (cache, database and message queue)

Quote:
Originally Posted by Gamer_Z View Post
I did read the redis security article before posting,
I do have poor understanding of proxies, but as I understood it's a layer on the same machine, which redis fires requests to, the proxy then has a function to create an trusted SSL connection and send it over the internet. (out of the machine)
Which in other words, it is an external code which runs and accepts requests.

How to make it functional, is a mystery to me.

And the other article you linked to is only half true in my opinion, I genuinely have a disbelief in the use case of SSL, as Redis features a pub/sub functionality which is widely used by many, yes maybe the storage itself is mostly used for local purposes, but the pub/sub is usually used to communicate over the internet with other registered machines.

Besides that, most of the scripters on samp won't use it because most of the time they can get around with normal arrays and Redis is just something unique and new that needs to be learnt first to understood the benefit of it.

SSL connection is available on other branches and so I thought maybe this plugin could provide one by itself.

I myself, want to expend my server from a single machine to multiple one to decrease the stress on one machine and maybe start to experiment with data flow over the network (What has been commented before on the thread)

The subject is interesting, but samp has a strange nature to attract people who try to tickle, play and sniff your data.
__________________
Find me on GitHub SEF community (Official NEF Successor) Ko ko nut.
Kaperstone is offline   Reply With Quote
Old 05/07/2017, 12:06 AM   #29
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,714
Reputation: 1255
Default Re: Redis (cache, database and message queue)

What I'm doing is exposing my server data through an API rather than connecting things via Redis. Yes, it is used as a pub/sub but I really don't agree with Redis being used that way as it's extremely lacking proper message queue features and there are much better solutions out there. I think connecting two applications with ephemeral/trivial events on the same machine is fine (it's probably the fastest and simplest solution I could throw together in a night too tbh) but exposing a database outside the machine just introduces a whole other world of issues.

If you do want pub/sub, it might be worth using a more solid solution and just having a microservice sit between the broker and the game server which translates between Redis events and more resilient broker messages with SSL. I actually started writing a RabbitMQ plugin but my C++ is so rusty that I gave up and stuck with the simple Redis header-only include!

In terms of features: yes, I do actually need to implement some better connection handling code - right now, if the connection drops there's no way the AMX can know about it so I think an event is probably the best way to go. I was working on an automatic reconnection with exponential backoff but I think that would be best left up to the user.

If you do have any solid suggestions though, feel free to drop an issue on the repository and when I get some free time I'll do another feature update.
[HLF]Southclaw is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redis cache and message queue plugin for SA:MP [HLF]Southclaw Discussion 2 06/02/2017 06:47 PM
Using Redis Misiur Discussion 3 11/08/2014 10:17 PM
Moderation Queue Syncro Screenshots and Videos 1 07/05/2014 12:57 PM
Queue iJumbo Discussion 13 06/08/2013 09:29 AM


All times are GMT. The time now is 07:23 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.