How to Save Time on DevOps and Scale Your Ethereum Dapp With Infura
The Pros and Cons of Running Your Own Node
One of the most powerful propositions of the Ethereum blockchain is that theoretically, anyone can run a node, validate transactions, and contribute to the network. If you’re a veteran Ethereum developer, spinning up and running a node might have been one of the first things you did when you entered this space.
However, syncing an Ethereum node and storing the blockchain data can be time-consuming (days), costly (500 GB of storage, or more), and finicky (if you shut down your client improperly, if your disk isn’t an SSD, if your Internet drops out, etc). If you’re hoping to build a popular dapp, you’ll eventually need to scale your infrastructure to accommodate new users and higher transaction volume. This means more nodes, more disk space, full-time infrastructure engineers, and ultimately more costs. If you need to pin data to IPFS, access full node archive data, or upgrade your nodes to stay compatible with network hard forks, maintaining infrastructure only gets more complex.
Three Ways to Scale your Infrastructure
Roll Your Own Solution
If you have the resources to build out a development team and employ full-time Site Reliability Engineers (SREs), you can scale your own infrastructure by spinning up and maintaining more Ethereum nodes in-house.
If you’re new to Web3 development or don’t have the time or resources to set up infrastructure and run your own synced Ethereum node(s), you can use cloud-based node service providers like Infura. With Infura’s API endpoints, you can connect your dapp to Ethereum testnets, mainnet, and IPFS with a single line of code. No syncing or complex set-up is required. Infura’s subscription tiers allow you to scale your service easily and helps your team stay focused on core product development rather than maintaining costly infrastructure.
A hybrid infrastructure model is a good solution if your own node serves you well but you want the flexibility and peace of mind of being able to tap into node service providers. A hybrid solution is a mix of self-hosted cloud nodes with failover to a provider like Infura, which lets you confirm and verify transactions on your end while also diversifying your infrastructure to ensure maximum network uptime. As we’ll discuss below, a number of popular dapp teams still operate self-hosted nodes in combination with Infura so they can verify transactions themselves and double-check that their own nodes are synced.
How Popular Dapps Are Using Infura to Reinforce Their Infrastructure
Infura supports a wide variety of applications across the Ethereum ecosystem, from dapp development platforms to DeFi protocols to next-generation games. Here are how a few notable teams are using Infura’s APIs to meet demand during these unprecedented times of network activity.
The OpenZeppelin team runs some self-hosted nodes and incorporates Infura into their Starter Kits, helping them reduce overhead and streamline Web3 onboarding for burgeoning devs that are ready to deploy their dapps on mainnet. OpenZeppelin’s Network JS tool speeds up dapp builders’ workflows by enabling them to easily fall back to a public Infura node and connect to the Ethereum network with one line of code.
“From our dev tools standpoint, I can be connected to Ethereum anywhere I am. When I’m at home I have a node, but when I travel I fall back to Infura so I can always do what I want to do with the network.”Mariano Conti, Head of Smart Contracts, MakerDAO
Microsoft Azure’s Blockchain Development Kit extension for VS Code natively supports Infura, so you can connect to your Infura account and create new projects directly in the VS Code interface. Here’s a helpful walkthrough of Infura in VS Code.
Decentralized Finance (DeFi)
The biggest challenge for DeFi dapp teams has simply been keeping up with traffic, especially with recent market shocks that have users flooding the network. Compound, the interest-bearing lending pool, has become an especially popular protocol that plugs into a wide range of DeFi platforms. Initially, the Compound team ran their own Geth and Parity nodes on Kubernetes, but the clients hogged disk space, and performing basic tasks like pulling event logs required significant DevOps time. Now the team uses Infura’s API suite in a variety of ways to optimize their infrastructure and ensure a seamless user experience:
- Compound interface reads directly from Infura. Even if Compound servers have an issue, DeFi users can still access the Compound protocol through the interface and all their account details.
- Infura pushes all of Compound’s event log data into a stream processor. This simplifies the systems on Compound’s end that used to consume and present data.
- Compound unifies their requests on-chain to reduce round-trips to Infura. By merging requests via a view contract, Compound minimizes the need for multiple API queries and streamlines their Infura usage.
Read the full story on how Compound is using Infura to run efficient, rock-solid DeFi infrastructure.
“Infura provides our users with a high-availability solution to access their account data even in the craziest of times in crypto.”Geoffrey Hayes, CTO, Compound
Gnosis has taken a hybrid approach to their infrastructure to ensure connectivity at scale. Infura helps users connect to Ethereum through the Gnosis multisig wallet and also displays token balances via the Gnosis mobile app. The Gnosis team runs their own nodes alongside Infura for complex queries and so they have the flexibility to verify transactions themselves. This way they can reduce operational costs and also remain confident that their infrastructure is diversified.
“Using Infura saves us a lot of time in devops and reduces our costs for infrastructure. We are still running our own nodes for some complex queries but even there we use Infura to check that our own nodes are synced.”Stefan George, Co-Founder and CTO, Gnosis
After DeFi applications, games are among the highest ranking Ethereum dapps in terms of transaction volume. If the CryptoKitties surge was any sign back in 2017, blockchain-based games are poised to become increasingly popular onramps to Web3. SkyWeaver, an Ethereum-based trading card game developed by Horizon, allows players to trade unique collectible cards that are actually ERC-1155 tokens, so users can easily track and verify ownership on the blockchain. Infura partnered with Horizon earlier this year to help manage infrastructure as SkyWeaver moves into production ops and continues to scale.
Explore Infura’s customer reviews to find out how other Ethereum apps are using the Infura API suite to scale analytics solutions, organizational platforms, and more.
Are You Ready to Simplify Your Infrastructure?
“We’ve been running on Infura for as long as I can remember. It’s one of the pillars of our infrastructure. If our nodes fail, or the Etherscan API fails, we can rely on Infura.”Jordan Spence, CMO, MyCrypto
Here’s when you should consider an Ethereum infrastructure provider like Infura:
- You’re new to Ethereum. Infura makes your life easier even if you’re just deploying to testnets like Ropsten, Rinkeby, Kovan, and Görli. Our core service is free for up to 100,000 requests/day.
- You’re time-constrained. Infura APIs provide an instant connection to Ethereum and IPFS so you and your team can focus on building your core software, rather than syncing, upgrading, and maintaining nodes.
- You have limited resources. Running nodes and storing data gets expensive, especially when you need dedicated engineers to remain confident in your infrastructure.
- You need to scale. Seamless connectivity is how dapps earn users’ trust, particularly during times of high transaction volume. Leading dapps bank on Infura because our request response times are up to 20x faster than self-hosted infrastructure.
- You need maximum reliability. When backup infrastructure and failover are mission-critical, a third-party solution like Infura is a logical choice.
- You need expert support. Infura provides 24/7 access to expert infrastructure support teams.
If you want to learn more about how you can interact with the Ethereum and IPFS networks via Infura, head to infura.io/docs and explore our documentation, or check out our step-by-step tutorial on getting started with Infura.
Ready to connect your app with our instant access APIs? Head to infura.io/register and get started for free today.