[Performance] Find out a solution for a game with big data.

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

User avatar
giapdq
Posts: 2
Joined: 11 Jul 2018, 09:48

[Performance] Find out a solution for a game with big data.

Postby giapdq » 11 Jul 2018, 10:15

Hi all,

I'm using smartfox to develop a game with big data, might this game will have 4-5 billion records in some of table in database.
I don't want to call query when game's running, that will make the game has delay time.

My solution:
I will load all data from database then store in RAM in ZoneExtension when starting server.
Something like this:

Code: Select all

private Map<Long, MyEntity> myData = new ConcurrentHashMap<Long, MyEntity>();
private Map<Long, MyEntity1> myData1 = new ConcurrentHashMap<Long, MyEntity1>();
....


And using these Map to have the needed data when game running.

Right now, It works well for me on my dev environment with small database, but i wonder that when these map size be increased to 4 or 5 billion, even more-> Is it still work well?
If you have experience in same this issue please share me.

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

Re: [Performance] Find out a solution for a game with big data.

Postby Lapo » 11 Jul 2018, 15:44

Hi,
no it's a terrible idea :) Sorry I have to be blunt :)
But seriously don't do that. Find a good "big data" database, such as Mongo, Redis etc., and use on of those. They can give you very good performance while keeping your data reliable and secure.

I don't want to call query when game's running, that will make the game has delay time.

This assumptions needs to tested, otherwise you're going to design your system based on something you haven't verified.
Database calls are not that heavy to add latency to your game and they can run asynchronously so there's no blocking time. Or they can run in separate threads.

You may also want to check a product like Hazelcast, which works as a distributed in-memory database or it can work as a big cache for a Big Data DB.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
giapdq
Posts: 2
Joined: 11 Jul 2018, 09:48

Re: [Performance] Find out a solution for a game with big data.

Postby giapdq » 12 Jul 2018, 02:13

Hi Lapo
It is impossible to me to change database as Mongo due to project deadline. Hazelcast might be a good solution for me.
Thanks for your advice.
User avatar
Lapo
Site Admin
Posts: 20437
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: [Performance] Find out a solution for a game with big data.

Postby Lapo » 12 Jul 2018, 08:06

Hi,
sure Hazelcast is a very solid pick for a in-memory database. We've written an article on how to integrate Hazelcast with SFS2X.
It should give you an overall idea on how to get started.

See here:
http://docs2x.smartfoxserver.com/Overview/white-papers
(second to last document)

Good luck
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 11 guests