SmartFox and Redis can be implemented ?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

adnan
Posts: 4
Joined: 16 May 2016, 09:04

SmartFox and Redis can be implemented ?

Postby adnan » 16 Jul 2018, 10:33

Hello all,
Hope you are doing well.
let me describe how its going on my server. We use SQL to get all data from database so, if you want to get leaderboard players you have to call the sql statement of leaderboard. We was thinking about an approach to keep loaded data be saved into something like object to be sent to users instead of re-call the sql statement again and again. Our problem is, when leaderboard is updated, saved object ( loaded object ) how can be updated or up to date ?? is it possible ?
I took a look on Redis, is it can be implemented in smartfox ? or something like this approach ??

Thanks guys,
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SmartFox and Redis can be implemented ?

Postby Lapo » 17 Jul 2018, 07:12

Hi,
Generally speaking your use case would benefit from a cache service for your DB. A cache would significantly improve the access to frequently read data and offload your DB, without changing your DB.
Redis is just a different type of database that could help as well but you would need to migrate part (or all) of your DB which is a huge time investment.

If you're currently working with a SQL database I think you should stick with it and look into a caching service such as memcache and similar.

As regards Redis they provide Java API so it should be easy to integrate in SFS2X
Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
adnan
Posts: 4
Joined: 16 May 2016, 09:04

Re: SmartFox and Redis can be implemented ?

Postby adnan » 17 Jul 2018, 10:14

Great Thanks Lapo, and sorry for post duplicating :D
I got your point. But i afraid that cached data may not be updated when database table updated ..


Thanks again for your help,
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SmartFox and Redis can be implemented ?

Postby Lapo » 17 Jul 2018, 15:49

Of course they do.
The caching mechanism works by keeping track of which data was changed and read that from DB. Once the data is in cache it will stay there for all the next reads until a new update is done to the database.

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 43 guests