What is Xano?
A slow screen can be waiting on API logic, a database query or work that does not need to finish before the response. Finding that wait is the first useful step; indexes and caching solve different problems.
Follow the path of a request
- App request
- API logic
- Data query
- Response
Xano in brief
Xano is a no-code platform for building application backends. Its main features include:
- Authentication – Built-in JWE tokens and OAuth authentication.
- No-code API builder – Build business logic and workflows, with automatic generation of CRUD operations.
- Database – Managed PostgreSQL with controls for triggers, indexes, and data validation.
- Recurring tasks – Scheduled workflows, similar to cron jobs.
We offer Xano audits to find slow queries and other performance problems. These can include a WeWeb audit.
How can you improve Xano performance?
The following sections cover specific changes to queries, API endpoints, and background tasks.
Database indexing
Indexes can help with slow queries. Here is when to consider them in Xano.
When should you use database indexes in Xano?
According to the Xano documentation, common cases for adding an index include:
- A query takes a long time to return data.
- The query uses simple operators, such as
item.amount < 0anduser.name = “Juraj”. - The table is large enough that scanning it is a measurable part of the delay. Row count alone is not a reason to add an index.
When should I avoid applying DB indexes in Xano?
- If your table has a lot of insert/update operations.
- If the combination of fields in the index has only a few unique values (known as low cardinality).
- Non-selective queries – if the query usually returns a large percentage of the table’s data, you should avoid using DB indexes.
What types of indexes can I add to a Xano table?
| Index Type | Use Case |
|---|---|
| GIN (Generalized Inverted Index) | Mainly used to search through JSON data (e.g., finding a key-value pair in a JSON column). |
| Index | Standard, simple queries. Can be simple (one column) or composite (multiple columns like age + location). |
| Unique | Used to enforce unique values in columns (secondary IDs, slugs, etc.). |
| Spatial | Used specifically for searching geographical data. |
| Search | Index used with Xano’s fuzzy search for text similarity. |
How can I create a new index in Xano?
Xano’s index guide covers creating and monitoring indexes. Compare the actual query before and after the change.
An index is a trade-off
| Reasons to investigate | Reasons to be careful | |
|---|---|---|
| Query behavior | A slow query with selective filters | A query returning most of the table |
| Data changes | Repeated reads of the indexed fields | Frequent inserts and updates |
| Field values | Enough distinct values to narrow the search | Only a few distinct values |
API and function caching
What is caching?
Caching can reduce some API response times from seconds to milliseconds. Xano uses REDIS caching to store responses in memory. When a cached response is available, the endpoint returns it without querying the database or running the function stack.
When should I implement response caching in Xano?
There are two “types” of response caching in Xano (API and Function), but they work in exactly the same way. We recommend using response caching to improve performance and free up computing resources for other operations.
- Static or rarely-changing data – when the underlying data doesn’t change frequently.
- Expensive queries – if the logic takes 10+ seconds. You can configure a cache reset (e.g., every hour).
- Predictable data changes – if you know data updates daily, you can configure the cache to reset right after the update.
When should I avoid using response caching in Xano?
If an API or function is cached, it does not query data in real-time or execute function stack operations. Avoid caching or use it carefully in these cases:
- Queries for frequently changing data (e.g., social network feeds).
- Functions or endpoints that perform write or update operations (as these operations will not run when a cached response is returned).
- Personalized responses – ensure you use “private caching” if data is user-specific.
Use add-ons when querying the data
What are Xano addons?
An addon includes related data in a Xano database query. Instead of doing multiple queries and merging data, it includes related records in the result of your main query. That does not by itself guarantee one underlying database operation.
When should you use Xano addons?
- Example 1: Add related data using a foreign key – If an
eventtable has alocation_id, an addon can fetch the city/country from thelocationtable automatically. - Example 2: Aggregations – If you have a list of movies and a table of reviews, an addon can return the count of reviews for each movie alongside the movie details.
Fetch related data with the record
Separate lookups
- Fetch the event
- Fetch its location separately
- Merge the response yourself
Query with an addon
- Query the event with its related location
- Include the needed city and country
- Return the combined data
Fewer function blocks, more filters
For example, take a table with 1,000 posts. We want to remove dots and commas, capitalize words, trim spaces, split text, and join it again.
- Separate function blocks (avg ~ 1.5s): One block for each operation.
- Xano filters in one block (avg ~ 0.75s): One function block with multiple chained filters. In this example, that was approximately 50% lower processing time. The figures describe this workload, not a general speedup guarantee.
Custom code might help sometimes
Xano is primarily no-code, but code can optimize speed for specific tasks.
- In the same example, AWS Lambda code reduced the overall time by another 60%. Different transformations need their own comparison.
.forEachand.mapperformed similarly, though.forEachcan be more memory-efficient for huge arrays.
Asynchronous processing
Not everything needs to be synchronous. Xano’s “Post process” feature allows you to execute logic after the API returns a response.
- Useful for: Sending a confirmation email during signup. The user doesn’t need to wait for the email provider to respond to see a “Success” message.
- Caution: Avoid this if the user needs to know immediately if that specific operation failed.
Separate the response from later work
- 1 Complete the required operation
Finish the work needed for the API result.
- 2 Return the response
Let the interface show the result.
- 3 Run post-processing
For example, send a confirmation email after signup.
Check the result under real load
One change, then measure again
- Measure a baseline
- Find the slow step
- Make one change
- Compare the result
More users, data, and features can put pressure on performance in both no-code and custom-built apps.
If your Xano app is slow, we can review it with you and suggest changes.