Post
Share your knowledge.

Shared Objects in Depth: When You Really Need Them
Problem this solves: Developers overuse shared objects, causing consensus slowdowns.
What you’ll learn:
When shared objects are unavoidable
How to design them for minimal contention
Sharding patterns
- Good use cases
Orderbooks
Auction houses
Public registries
- Bad use cases
Per-user data
Frequently updated counters
- Sharding example
Instead of one GlobalLeaderboard, create LeaderboardSeason1, LeaderboardSeason2, etc., each as separate shared objects.
- Sui
- Architecture
Why is it generally a bad idea to store per-user data in a shared object on Sui?
You generally shouldn’t store per-user data in a shared object on Sui because every change to a shared object requires consensus, which slows down performance and creates unnecessary contention when many users interact at once; instead, giving each user their own owned object avoids consensus overhead, lets their transactions run in parallel, and scales much better as activity grows. Read more: [https://docs.sui.io/learn/architecture/objects](https://docs.sui.io/learn/architecture/objects)
Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.
- How to Maximize Profit Holding SUI: Sui Staking vs Liquid Staking616
- Why does BCS require exact field order for deserialization when Move structs have named fields?65
- Multiple Source Verification Errors" in Sui Move Module Publications - Automated Error Resolution55
- Sui Move Error - Unable to process transaction No valid gas coins found for the transaction419
- Sui Transaction Failing: Objects Reserved for Another Transaction410