Clouddb optimization

hi, I have a game where are almost 700 players and in this game, I have ranking and player list and in the players list, next to players name there is if he is online or offline. and this is very laggy, beacuse sometimes the ads and other parts of the game are not loading and the whole game is running slow. do you know how to optimatizate this code so the game will run better? (i think its beacuse it need to request 1400 values and then compare it)

You really need to be doing most of this "server side".

cloudDB is probably not up to handling this. You should use Firebase or similar that can handle queries and indexing / filtering of values, or simply return the entire dataset in one go, for handling within the app, as opposed to having to make 1400+ calls to the online database.

Can't help with the ads issue.

okay, so do you have any idea how to do so it will not request 1400 values but how to store it and then get value so it will not lag that much? maybe I will delete player list and then only finding people. but still it need the whole list for ranking.

ok, I think its just because it want to do 1400 things at the same time

Given that your data is constantly changing across all 700 players, you will still need to return all the values in order to assess them, you cannot do this server side with cloudDB.

sorry, but giving it to firebase it will take me a long time and also I will need all data to store in firebase from clouddb, and I think firebase is not secure as clouddb. maybe there is a solution for this. maybe some blocks will be added or deleted.

What makes you say that? cloudDB data is potentially accessible for all users, and could be deleted at any time, and if you overuse it you could be switched off. Are you using your own redis server ?

no, im on app inventor's redis server. i think clouddb is more secure because I made a game from account email 1 and gave specific tags for shop in clouddb and then gave this app into account email 2 and without testing I gave it on google play. in school I said to friends "download this game, its on google play!" and then they downloaded it and everything in the shop was free. so someone will need to login into my app inventor account to make an app and then add clouddb and then change the project name to the same as in app and then he will can change values (maybe I'm wrong)

Essentially Tomek, MIT's CloudDb Server is for testing and demonstrating your App. If you are distributing your App, you should not be using the MIT Server, you should use your own. In an ideal world you would have your own website and host your database on it.

It is very important to protect the privacy of your App Users too.

okay, i will change it, but which one is better

  1. firebase or own domain hosting (I need to change very much thing and I don't like it)
  2. own redis server
    so is own redis server actually better for this or I need firebasee or own domain hosting

Your own server (hired/hosted by a company such as IONOS), using any alternative database that offers similar storage (and speed) as Firebase, or simply use Firebase itself, which is hosted by Google. Unfortunately both solutions can be expensive.

If you have your own server, it can host your website too and it might be best to have your advertisements there rather than in-App, or perhaps have static ads rather than dynamic ones eating into the phone's cpu resource.

If you do some research on the internet, looking at 'Massively Multi-Player Online Games systems', you will then be able to conclude whether or not your idea is viable, and understand how the big game producers are doing it.

See these two:

neither for the faint hearted....

1 Like

If considering Firebase

You get more flexibility with your data storage, and you could call back all your 1400+ values from one or two nodes, so just two calls....

1 Like