It describes a three-layered data architecture for a decentralized hiring/reputation protocol. Each layer has a clear purpose:
- The smart contract (on-chain) stores only the critical truth data that needs immutability (who is a reviewer, ratings, sponsorships, hiring outcomes).
- The Graph subgraph indexes those on-chain events, transforming them into structured entities for fast querying (users, ratings, sponsorships, balances, reputations).
- The off-chain database stores flexible, human-friendly data like profiles and job postings that don’t need to be on-chain.
1. Smart Contract Data (On-Chain)
- Holds state variables like admin, reviewer list, and reviewer mapping.
- Emits events for actions (approvals, ratings, credits spent, hiring decisions).
- Prioritizes immutability and gas efficiency over flexibility.
2. The Graph Subgraph (Indexed Queries)
- Creates entity models (
User
, Rating
, Sponsorship
) out of smart contract events.
- Enables querying and computation like reputation scores, ranking, filters, and relationships.
- For example, you can quickly ask: "What ratings did User X receive?" or "Which candidate got X sponsorships?"
3. Off-Chain Database (Profiles & Jobs)
- Stores user-friendly data (name, bio, job title, hiring manager identity).
- Linked to blockchain identity via wallet address.
- Flexible since it can be SQL or NoSQL, supporting frequent updates and richer profile content.
In short: on-chain = truth + security, subgraph = indexing + analytics, off-chain = profiles and jobs.