RPC (Remote Procedure Call) requests serve as the bridge between an application and the Solana cluster, facilitating interactions with the blockchain. These requests are handled by dedicated RPC Nodes, separate from the nodes participating in the consensus mechanism. However, from the perspective of application users, the performance of RPC is just as critical as overall cluster performance. To provide a stellar user experience that showcases Solana's speed and low latency, it is essential to ensure that your RPC infrastructure is up to the task.
Development and Testing:
During the development phase, it is highly recommended that developers utilize a local cluster, particularly in the early stages and for testing purposes. Local clusters offer greater flexibility compared to public options, allowing you to run unoptimized initial iterations of your application. The simplest way to set up a local cluster is by using the solana-test-validator
binary, which is included in the Solana CLI Tools suite. As your application matures and stabilizes, transitioning to a public cluster becomes a more appropriate choice.
Optimizing RPC Requests:
Optimization is key when it comes to RPC requests. It's important to remember that less is often more in this context. Avoid making repetitive calls for the same data and refrain from constructing clients that directly issue RPC requests. The idea of "backend-less dApps" is a misconception; essentially, this approach puts unnecessary strain on someone else's infrastructure. Instead, employ effective caching strategies for costly calls, such as getProgramAccount
, getSignaturesForAddress2
, and getConfirmedBlock
, and serve your users from the cache. Investing time in code optimization before going live can prevent issues with poor user experiences and significantly reduce infrastructure costs.
Free Services: Several providers offer free RPC access to public Solana clusters. These services are suitable for real-world testing, early demonstrations, and small, private beta programs. However, it's crucial to understand that you get what you pay for. Free services typically lack autoscaling capabilities, impose rate limits, provide no Service Level Agreement (SLA), and are willing to suspend users who abuse their services. When your application is ready to be deployed to the public and demands higher reliability and performance, it's advisable to invest in private RPC access to ensure a smoother and more dependable experience for your users.
<aside> <img src="https://assets-global.website-files.com/6364e65656ab107e465325d2/637af440040cbf0511a40557_O0_Fk-BgYBomkGecFkR1axqZ0e7h9yoUMnImzFmDyps.png" alt="https://assets-global.website-files.com/6364e65656ab107e465325d2/637af440040cbf0511a40557_O0_Fk-BgYBomkGecFkR1axqZ0e7h9yoUMnImzFmDyps.png" width="40px" /> Quicknode
</aside>
<aside> <img src="https://www.gitbook.com/cdn-cgi/image/width=256,dpr=2,height=40,fit=contain,format=auto/https%3A%2F%2F1542051092-files.gitbook.io%2F~%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F3pmrRFhZIr9mPXG3yCuu%252Flogo%252FbttEc1uyI8SijzcfaNjm%252F10B%2520S%2520Logomark.png%3Falt%3Dmedia%26token%3Dcc782bb1-77b6-478a-83d8-71a5e17c7b13" alt="https://www.gitbook.com/cdn-cgi/image/width=256,dpr=2,height=40,fit=contain,format=auto/https%3A%2F%2F1542051092-files.gitbook.io%2F~%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F3pmrRFhZIr9mPXG3yCuu%252Flogo%252FbttEc1uyI8SijzcfaNjm%252F10B%2520S%2520Logomark.png%3Falt%3Dmedia%26token%3Dcc782bb1-77b6-478a-83d8-71a5e17c7b13" width="40px" /> GenesysGo
</aside>
<aside> <img src="https://tradingplatforms.com/wp-content/uploads/2021/11/solana_logo.png" alt="https://tradingplatforms.com/wp-content/uploads/2021/11/solana_logo.png" width="40px" /> Foundation Server
</aside>
<aside> <img src="https://assets-global.website-files.com/6364e65656ab107e465325d2/637eae942fbaec215832a650_TpRewb19HwDyxtXKJW7OtiSL0JZ3_G-j4xCr6EauDUc.jpeg" alt="https://assets-global.website-files.com/6364e65656ab107e465325d2/637eae942fbaec215832a650_TpRewb19HwDyxtXKJW7OtiSL0JZ3_G-j4xCr6EauDUc.jpeg" width="40px" /> GetBlock
</aside>
<aside> <img src="https://pbs.twimg.com/profile_images/1649552326347169793/i61iTZzx_400x400.jpg" alt="https://pbs.twimg.com/profile_images/1649552326347169793/i61iTZzx_400x400.jpg" width="40px" /> Triton/RPC Pool
</aside>
<aside> <img src="https://pbs.twimg.com/profile_images/1416262609456746498/cZoMwlyl_400x400.jpg" alt="https://pbs.twimg.com/profile_images/1416262609456746498/cZoMwlyl_400x400.jpg" width="40px" /> Run Node
</aside>
<aside> <img src="https://assets-global.website-files.com/6364e65656ab107e465325d2/637aee406bd53a72acca2af1_6QPw_6dQ-Ijfe4vTZOD2CXB2DVlHJmd3pGVuWWSFFt0.png" alt="https://assets-global.website-files.com/6364e65656ab107e465325d2/637aee406bd53a72acca2af1_6QPw_6dQ-Ijfe4vTZOD2CXB2DVlHJmd3pGVuWWSFFt0.png" width="40px" /> Alchemy
</aside>
<aside> <img src="https://pbs.twimg.com/profile_images/1676292138617675784/BNf4F9-d_400x400.jpg" alt="https://pbs.twimg.com/profile_images/1676292138617675784/BNf4F9-d_400x400.jpg" width="40px" /> Helius
</aside>
<aside> <img src="https://chainflow.io/content/images/2023/06/logo-1.svg" alt="https://chainflow.io/content/images/2023/06/logo-1.svg" width="40px" /> Chainflow
</aside>
<aside> <img src="https://pbs.twimg.com/profile_images/1159254945885016064/vhhp1wL4_400x400.jpg" alt="https://pbs.twimg.com/profile_images/1159254945885016064/vhhp1wL4_400x400.jpg" width="40px" /> Figment
</aside>
<aside> <img src="https://pbs.twimg.com/profile_images/1651228942445993993/bZGQcvtW_400x400.jpg" alt="https://pbs.twimg.com/profile_images/1651228942445993993/bZGQcvtW_400x400.jpg" width="40px" /> Blockdaemon
</aside>
<aside> <img src="https://pbs.twimg.com/profile_images/1677372599897055237/dOXB_0YR_400x400.jpg" alt="https://pbs.twimg.com/profile_images/1677372599897055237/dOXB_0YR_400x400.jpg" width="40px" /> NOW Nodes
</aside>
<aside> <img src="https://pbs.twimg.com/profile_images/1476140916586860547/GvP_nYAe_400x400.png" alt="https://pbs.twimg.com/profile_images/1476140916586860547/GvP_nYAe_400x400.png" width="40px" /> Chainstack
</aside>
<aside> <img src="https://assets-global.website-files.com/6364e65656ab107e465325d2/646bbe3ac5f73aa4081342b8_syndica-logo_icon-300px.png" alt="https://assets-global.website-files.com/6364e65656ab107e465325d2/646bbe3ac5f73aa4081342b8_syndica-logo_icon-300px.png" width="40px" /> Syndica
</aside>
<aside> <img src="https://assets-global.website-files.com/6364e65656ab107e465325d2/646bbe32a9534629a8b3a290_Ankr_Blue-Symbol.png" alt="https://assets-global.website-files.com/6364e65656ab107e465325d2/646bbe32a9534629a8b3a290_Ankr_Blue-Symbol.png" width="40px" /> Ankr
</aside>