What if i have 100 Million users playing a car racing game. At the end everybody get the position, which is written to mysql database. The next game will start 10 seconds later and all cars will be placed in the position he finished the last game.
SHORT: Big amount of users => For each must be saved data => Data must be immediately available.
Should I write directly to database or is there an advantage, if I use jobs/workers. And if yes, is there a good service for that. Because I think, when i write 100 Million jobs into database, it is almost the same when i right do the job. Maybe a service is better for this.
I also need to search in positions, so I think about using algolia for this. So many options, but I need a starting point.
@Snapey I know :) Sorry, the post sounds like I want to build the next facebook. Most of the products i build or startups im working for, i say the same. Im not a dreamer who say "I will be the biggest player on the market". The thing is, that i normally have products which grow slow. The problem here with my new app is, that it is for tv shows. So if i have 1 customer who pays, I automatically have maybe 50k - 10m users at one time. That is why i ask. It is still a first mvp but the database must be stable. If you say it is now problem, i will go on. But it would be bad, if i have a big company who wants to play the game with tv viewer and the app will crash.
PS: I also already wrote code. Learned how to write microservice, learned vue and a lot more for this app. The app is 60% done. But i have the critical point of this highscore thing (example with positions) which must be work, when 5m access database at once.
Then I suggest you consult with your system architects and data centre managers on the best architecture (you do have multiple distributed datacentres dont you?).
@Snapey I thought there is a service like algolia to start with. At the moment i dont have the app online. I also have tests written with multiple users, but only 20. I know it will crash with 20m. But I will ask a friend who is devops and architect... i think he will help me a bit to setup this. thx for your answer.
I talked to a friend, who did big data apps. He gave me a tip to start and when I grow he will help me, but here is what I do now...
I now make some changes in my concept and in my microservice, which must be very fast in store and read, I switch from mysql to redis. Maybe this will help some, who has the same problem.
@pixelairport There’s absolutely no way you’re going to have a game with 100 million users online in a single session. GTA Online has a player base of probably around that number and buckets players into servers for a reason.
thx @martinbean ... that is a good info. There will be no game with 100 million users in one game. There will be games with only 1000k but also maybe games with 1m. I will think about a structure to split the games on different servers. That is a really good tip. thx.
@Pixelairport That’s still a massive number. Think about games like Fortnite: there’s only 100 players in a single game because any more would just be unwieldy. There’s also a limit on how much data you can pass back and forth between a server and that number of clients. Every time those 100 players move, their new positions have to be broadcast to the other 99 players. If you have say, a million players, the payload of game state being passed to each connected client—multiple times a second—is going to be massive and probably take longer to transmit that needed for smooth gameplay.
@martinbean thx again. Also for still think about my problem :) I think/hope that I dont have too much problems. At my game there is not much information passed to the server and back like in fortnite (moving, weapon change, fire, getting items, ...). Like in the example, every car driver comes to finish after the other and the position is set. After the full game he reads all positions. That means maybe 100k reach the finish over 60s not all in the same second. But maybe I have to change the concept, when I see there are problems (only the best will be stored and the other will placed randomly). I just started a course for redis, because i never used it before. And they say >80k writes per second are possible. I will start with customers, which will only have <5k customers at one time. So I will start and see how it scales. My friend (100% dev. with lot of infrastructure knowledge) said he will help, when i will get bigger. For me it is just important to set the right base for all and dont use a wrong tool in the start. I know 1m or 100m is much. But when i have one big customer, I have directly 1m users and dont want to crash my app. I saw this a few month again in a show where they promote their app. My friend says we can later do tests to check how many people can work with the tool. ... But really thx for your help :) I now have the way... I think... => Choose right tools, Get first customers with under 5k users, Get an architect into the project and then make cooperations with bigger customers.
When handling big data from 100 million users in a car racing game, efficiently writing this information to a MySQL database becomes crucial. This process involves meticulous database design and optimization strategies to ensure fast and accurate data storage and retrieval. The ability to swiftly update player positions at the end of each game and seamlessly transition to the next game within a 10-second interval requires robust database management techniques, such as indexing, partitioning, and caching, to handle the high volume of concurrent transactions effectively. These optimizations not only enhance user experience by providing real-time updates but also facilitate the smooth functioning of in-game mechanics like positioning cars based on previous game results. In the context of traffic rider substitutes, managing such large-scale data operations in the backend enables gaming platforms to offer seamless experiences to users, attracting more visits, installations, and downloads due to the optimized gameplay flow and responsiveness. For More: www.trafficridermod.me