ServerStorage vs. ReplicatedStorage

There are two well known storages across Roblox, and of course, those are ServerStorage and ReplicatedStorage. From what I hear, there is very little to no difference between the two. What’s something that ServerStorage would be better for and something ReplicatedStorage would be better for. I would really like to know the difference! :slightly_frowning_face:

29 Likes

There is one main difference. Items in ReplicatedStorage can be accessed via the client side, whereas things in ServerStorage can only be accessed by the server. This means things that you need to access from the client, such as RemoteEvents, etc, should be put into ReplicatedStorage so that the LocalScripts are able to access these things. ServerStorage should be used to house things that will be only accessed by the server, for example maps. This is the main difference between them, but essentially they do the same thing. Just that ReplicatedStorage can be accessed by the client AND the server, but ServerStorage can only be accessed by the server. Hope this helps.

101 Likes

I am extremely new to Studio, so I would like to clarify that a client is something that can be accessed through all servers running in the game?

8 Likes

The client is the player, so you’d be accessing things through that player’s computer. This is why a LocalScript is called "Local"Script, as these scripts run locally on the client’s computer. The server is the game server, and it is what handles what everyone sees. For example, if you try to move a part on the client, the server disagrees and only you will see the part that has moved. So in summary, the client that I am referring to means the player, the server is the server.

35 Likes

For anyone that has stumbled onto this topic you may notice retrieving an asset from ServerStorage and putting it into workspace, takes a second or two longer to load than if its in ReplicatedStorage.

That’s because everything in ReplicatedStorage is loaded onto the players RAM and everything in ServerStorage stays in Roblox’s Servers, that is until it is moved to workspace then placed onto the players RAM.

So any big assets that don’t need to be seen instantly can be stored in ServerStorage, for example: Entire Maps, NPCs, Tools, Heavy Meshes, Systems, Uncommon assets, Accessories and Uncommon VFX.

What about the things you should store in ReplicatedStorage?:
Repetitive VFX, Client only assets, Sounds, Modules for Sever and Client, Events and things the player needs to see instantly.

What if your asset falls between the two use cases or you dont want “Pop-In” to occur when the player sees the asset for the first time? You can use the “Content Provider” to pre-Load the asset, here’s an example for a tool the player will see eventually but not right away that prevents Pop-in.

local ContentProvider = game:GetService("ContentProvider")

local tool = ServerStorage.Tools.MagicAxe:Clone()
ContentProvider:PreloadAsync({tool})
tool.Parent = player.Backpack

I personally use this myself as my game uses Hundreds of tools and its bad practice to load all of those tools onto the Players RAM, remember if your game is going to support Mobile Devices, most of those devices will only have around 3GB to 6GB of RAM, so its always good to be mindful of memory.

5 Likes