Best way to store tables globally

I am trying to make a factions system for my leveling system and I wanted to know what would be the best way to store the faction tables of which players are in which faction and other values and ways to transmit them to the client.

If you know what values will be in the table, then it would work something like this:
[lua]
local factions = {
faction1 = {
color = Color(255, 255, 255),
players = {
Player(1),
Player(2),
}
}
}

function SendFactions()
for name, data in pairs(factions) do
net.WriteBool(true)
net.WriteString(name)
net.WriteColor(data.color)
local count = #data.players
net.WriteUInt(count, 8)
for i = 1, count do
net.WriteEntity(data.players*)
end
end
net.WriteBool(false)
end

function ReadFactions()
while net.ReadBool() do
local name = net.ReadString()
local data = {players = {}}
data.color = net.ReadColor()
local playercount = net.ReadUInt(8)
for i = 1, #playercount do
data.players[#data.players + 1] = net.ReadEntity()
end
factions[name] = data
end
end
[/lua]

Would you recommend userdata/playerdata or files to store it?

I would recommend MySql but that might be a bit overkill for a fraction system

userdata isn’t a file storage method, I would give the user a config option and for my personal server use tmysql > flatfile > pdata