#What's the most optimized way to creator a global marketplace other than httpservice.

1 messages · Page 1 of 1 (latest)

opaque fjord
#

I'm curious because I don't want to pay however much it costs to host a server but I also want a good way of handling a global marketplace. Also would roblox's servers be able to handle for example 50k concurrent with a global marketplace in their system.

pure remnant
#

@brave flame

brave flame
#

Use a datastore

#

And keep doing updateasync

#

But don't cache the data

#

Always use the value passed into the update function

#

In order to reduce calls you can batch operations into 1 call

opaque fjord
#

is that it?

brave flame
#

Yes

opaque fjord
#

so to be clear it will work if theres a large player base?

#

like 50k for example

brave flame
#

I'm not sure what players have to do with it

opaque fjord
#

i dont know if roblox datastores can handle it

#

thats one of my concerns

#

bc i looked up on the devforum

#

and it said it could overload

#

and no register data

brave flame
#

What about it are you worried it can't handle

opaque fjord
#

not*

#

just like transfering the data to everyone across all servers

#

im worried it might not register

brave flame
#

What are you transferring to everyone

#

Won't you just be loading the datastore once per server and sending that value to everyone

opaque fjord
#

like for example i decide to sell a gun for 100 coins and i put it on the global marketplace and then i want someone to be able to purchase it in a different server and recieve it in their inv for example

opaque fjord
brave flame
#

So each player can update a data store 10 times per minute

#

And the server can update a data store 60 times per minute

opaque fjord
#

something like that

#

wiat no

brave flame
#

But

opaque fjord
#

10 times per min is crazy

#

its gonna have like a cd

brave flame
#

You should not expect the shop to be real time

#

What you should do is

#

Make the server update every 10 seconds

opaque fjord
opaque fjord
#

sorry if im asking dumb questions

#

its 3 am

#

💀

brave flame
#

Would updating every 10 seconds be worse then updating as soon as a player adds a item to the datastore

#

Depends how often players are interacting with it

opaque fjord
#

definitely not im just asking this if I were to update like every 30 seconds for example and make it reset each item in 24 hours and remove it off the market, and have like a 10 minute cooldown on uploading items to the market would it work fine?

brave flame
#

You could even update once every second and it would be fine

opaque fjord
#

oh alr

opaque fjord
brave flame
#

But the main problem is if 2 servers try to update the data store at the same time the update function can run multiple times

opaque fjord
#

what would you do against that

brave flame
#

Update every 10 seconds instead of 1 second

opaque fjord
#

ok

brave flame
#

You could have local items and global items

#

Then every 10 seconds move local items into the global items

opaque fjord
#

lastly should I dedicate a whole datastore on like managing the marketplace items?

brave flame
#

When you sell a item you would need to do a updateasync to remove the item

#

And you can't give the item to the player untill then

opaque fjord
#

ok

brave flame
#

an even better way is to

#

Not just blindly loop

#

But have like a debounce

#

So if an update has not happened in the last 10 seconds then instantly allow the action

opaque fjord
#

hm ok

#

thanks bro

#

u have a good one

brave flame
#

But if a second player comes along then have then wait until the 10 second debouce has ended but you can still take the item from there hands and let it wait in a queue

opaque fjord
#

can u keep this forum open so I can reference it