as long as the table has an index named “Value” which will be used to rank the key instead.
ODS is awesome if you want to store a string or a number, up to 50 characters. Anything else and you’re out of luck unless you want to spend all your requests gathering extra data for each key you have.
The specific use case I have in mind is a steam-like marketplace where used could buy and sell items with everyone else in the game. I was to use ODS because it would allow me to have an unlimited number of keys under a single namespace and because it can easily sort by price (if I use price as the value). The problem is that ODS can only associate a string key with a number value. Normally this would be fine, I could just serialize the item and use that as the key, but datastores have a 50-character limit on keys so that’s out of the question for any real amount of data. My only option is to use the key to retrieve the data from a separate store, consuming one request per item. If I have a page of 10 items then this is very bad.
Alternatively ODS could allow larger keys. Anything larger than 600 characters would work for what I want.
And then, whenever you want to display the name to the user, get the data out of another DataStore:
Key | Value
----|------
0 | "Call of Robloxia"
1 | "Apocalypse Rising"
3 | "Work at a Pizza Place"
4 | "Sword Fights on the Heights IV"
5 | "Mad Paintball"
As far as I’m aware, that is how professional websites do this sort of thing in their SQL databases - which is why almost every forum you visit (even this one) has an ID for each post.
Arceus already addressed this, it doesn’t scale because you would very quickly reach your request limit this way.[/quote]
Huh? Two requests for each ‘game’? If you cache it properly then you can scale infinitely.[/quote]
One request for each page, and then one request per item in the page. If you’re fetching a page of 20 items then you have to make another 20 requests to get their data, which takes both extra time and uses up 1/3rd of your available web requests for that user. If a user makes 3 of these requests in a minute, you’re out of luck and have to floodcheck them to prevent your game from going over the request limit.
Caching works in some cases, I cache vigorously at Trade Hangout, but sometimes you are dealing with data that can be modified by any server, so caching for more than a few seconds is risky.
Arceus already addressed this, it doesn’t scale because you would very quickly reach your request limit this way.[/quote]
Huh? Two requests for each ‘game’? If you cache it properly then you can scale infinitely.[/quote]
The problem is that I’m already using 10*p requests to save player data and 60 requests is only enough for 5 pages of 10 items each. That means if I have five people (less than half the server) looking at the marketplace at the same time I’ll have to raise their page loading time to 1 per minute, which is unreasonable. Even if I cache the item details I still have hundreds of items with potentially hundreds of pages each which can be requested at any time and I have to account for other requests like buy, sell, cancel listing, view active listings, and view transaction history.
If I could just save a 600-character key then I would be able to do all of this within a reasonable number of requests.