DEV Community

Discussion on: Build a Web3 Dapp in React & Login with MetaMask

Collapse
 
jacobedawson profile image
Jacob E. Dawson

Hi Ramiro - you're exactly right - you can think of a smart contract as replacing a traditional backend server, so the smart contract includes the state & functions as opposed to, say, a NodeJS + MongoDB backend.

Having said that, it's also possible (and even necessary, depending on complexity) to employ state that is retrieved from "off-chain" sources, such as TheGraph subgraphs, since for some types of data & complex queries it's not feasible to store & read everything from a smart contract.