Getting Started
Installation
Option 1: Manual Installation
- Download the Raddish module files
- Create the following structure in Studio:
ReplicatedStorage/
└── Raddish/
├── Raddish.lua (main module)
└── mods/
└── NetworkingModule.lua- Require the module in your scripts:
lua
local Raddish = require(game.ReplicatedStorage.Raddish)Option 2: Model File
- Get the Raddish model from the Roblox Library
- Insert it into
ReplicatedStorage - Require it:
lua
local Raddish = require(game.ReplicatedStorage.Raddish)Basic Usage
Storing and Retrieving Data
lua
local Raddish = require(game.ReplicatedStorage.Raddish)
-- Store a value
Raddish.Set("mykey", "myvalue")
-- Get a value
local value = Raddish.Get("mykey")
print(value) -- "myvalue"
-- Store with expiration (TTL in seconds)
Raddish.Set("tempkey", "temporary", 60) -- Expires in 60 seconds
-- Check if key exists
if Raddish.Exists("mykey") then
print("Key exists!")
end
-- Delete a key
Raddish.Delete("mykey")Working with Player Data
lua
game.Players.PlayerAdded:Connect(function(player)
-- Store player data
Raddish.Set("player:" .. player.UserId .. ":coins", 0)
Raddish.Set("player:" .. player.UserId .. ":level", 1)
-- Get player data
local coins = Raddish.Get("player:" .. player.UserId .. ":coins")
print(player.Name .. " has " .. coins .. " coins")
end)
game.Players.PlayerRemoving:Connect(function(player)
-- Clean up player data
Raddish.Delete("player:" .. player.UserId .. ":coins")
Raddish.Delete("player:" .. player.UserId .. ":level")
end)Increment/Decrement
lua
-- Increment a counter
Raddish.Set("visits", 0)
Raddish.Incr("visits") -- 1
Raddish.Incr("visits") -- 2
Raddish.Incr("visits") -- 3
-- Decrement
Raddish.Decr("lives") -- -1Pattern Matching
lua
-- Set multiple keys
Raddish.Set("user:1:name", "Alice")
Raddish.Set("user:2:name", "Bob")
Raddish.Set("user:3:name", "Charlie")
-- Find all user name keys
local userKeys = Raddish.Keys("user:*:name")
for _, key in ipairs(userKeys) do
print(key, Raddish.Get(key))
end
-- Output:
-- user:1:name Alice
-- user:2:name Bob
-- user:3:name CharlieNext Steps
- Learn about Data Structures (Hashes, Lists, Sets, Sorted Sets)
- Explore Pub/Sub Events for cross-server communication
- Integrate External APIs with the networking module
- Use DataStore Bridge for persistence
Configuration
You can configure Raddish by modifying these values in the respective modules:
CacheManager Configuration
lua
-- In CacheManager.lua
local MAX_CACHE_SIZE = 10000 -- Maximum cached items
local DEFAULT_TTL = 300 -- Default expiration (5 minutes)Networking Configuration
lua
-- In mods/NetworkingModule.lua
local MAX_RETRIES = 3
local RETRY_DELAY = 2 -- seconds
local REQUEST_TIMEOUT = 10 -- seconds
local RATE_LIMIT_WINDOW = 60 -- seconds
local MAX_REQUESTS_PER_WINDOW = 100Performance Tips
- Use TTL on temporary data - Prevent memory leaks by setting expiration times
- Use pattern matching carefully -
Keys()can be slow with many keys - Batch operations when possible - Reduces overhead
- Use appropriate data structures - Sorted Sets for leaderboards, Lists for queues, etc.
Troubleshooting
"Key not found"
Make sure you're checking if the key exists before getting it, or the TTL hasn't expired.
lua
if Raddish.Exists("mykey") then
local value = Raddish.Get("mykey")
end"Cache full"
Increase MAX_CACHE_SIZE or implement better cleanup strategies with TTL.
Rate limit errors
The system handles this automatically, but you can check stats:
lua
local stats = Raddish.GetStats()
print("Cache size:", stats.size)
print("Max size:", stats.maxSize)