Tutorials

Scale & Secure Part 1: Introduction to Scaling Fundamentals

Summary

As your application grows and gains more users, it becomes crucial to scale your infrastructure to keep up with the increasing demand. Xano provides a range of features to help you handle more requests, complex queries, and maintain compliance with regulations. In this guide, we'll walk you through the process of identifying when your application needs scaling and the steps you can take to ensure seamless performance and security.

Monitoring Resource Usage

The first step in determining whether your application needs scaling is to monitor your resource usage. Xano provides a resource usage graph that displays the compute usage across five separate sections: APIs, database, background tasks, Lambda functions, and Redis caching. This graph allows you to filter and identify the areas consuming the most resources.

Here are some general guidelines for interpreting the resource usage graph:

  • 50% usage: Once you start hitting around 50% compute usage, it's time to assess opportunities for improving the efficiency of your application and determine whether an upgrade is necessary.
  • 70% usage: At this level, you may have less time to react, so it's crucial to take action promptly.
  • 90-100% usage: This indicates that your application's performance and user experience are likely suffering, with requests potentially failing or slowing down significantly.

Identifying Performance Bottlenecks

Xano's filterable request history is a powerful tool for pinpointing performance bottlenecks. It allows you to identify the APIs that are taking the longest to deliver a response and dive into each individual step to determine which specific operations are causing delays.

By analyzing the request history, you can prioritize areas for optimization and decide whether improving efficiency or upgrading your plan is the best course of action.

Improving Efficiency

Before upgrading your plan, it's essential to explore opportunities for improving the efficiency of your application. Here are some strategies you can implement:

  1. Optimize long-running function stacks: If your request history reveals that certain APIs or function stacks are taking an excessive amount of time, consider refactoring them. For example, you could replace nested loops and data transformations with database queries and joins, reducing the number of steps and improving execution time.
  2. Implement database best practices: As your tables grow larger, it's crucial to optimize their performance. This can be achieved by adding indexes, using add-ons, and leveraging joins to construct data efficiently within your queries.
  3. Leverage caching strategies: Xano offers several caching options to enhance response times:
  • Response caching: Cache the entire response from an API and return the cached version for subsequent requests, reducing the need to re-execute the function stack.
  • Data caching (Redis): Cache specific pieces of data that don't change frequently, enabling faster data retrieval and reducing database load.
  1. Rate limiting: Implement rate limiting to prevent users from overloading your APIs with excessive requests, which can lead to performance degradation.

By implementing these strategies, you can often improve the efficiency of your application and postpone the need for an upgrade.

Upgrading Your Plan

If your application continues to experience performance issues after optimizing efficiency, it may be time to upgrade your Xano plan. Higher-tier plans provide increased CPU resources, load balancing, and advanced caching capabilities to handle more requests and complex queries efficiently.

Xano's documentation provides a comprehensive breakdown of performance concerns and typical solutions, guiding you through the process of selecting the appropriate plan based on your application's specific needs and user feedback.

Continuous Monitoring and Optimization

Scaling is an ongoing process, and it's essential to continuously monitor your application's performance and user feedback. Regularly review your resource usage graph and request history to identify emerging bottlenecks proactively. Additionally, stay up-to-date with Xano's latest features and best practices to ensure your application remains robust, responsive, and secure as your user base expands.

By following these steps and leveraging Xano's powerful scaling features, you can ensure that your application delivers a seamless and high-performance experience to your users, even as it grows in popularity and complexity.

This transcript was AI generated to allow users to quickly answer technical questions about Xano.

Was this helpful?

I found it helpful

I need more support
Sign up for XanoSign up for Xano

Build without limits on a secure, scalable backend.

Unblock your team's progress and create a backend that will scale for free.

Start building for free