惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Martin Fowler
Martin Fowler
B
Blog RSS Feed
D
DataBreaches.Net
L
LangChain Blog
月光博客
月光博客
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
V
Visual Studio Blog
美团技术团队
Jina AI
Jina AI
博客园 - 司徒正美
雷峰网
雷峰网
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
小众软件
小众软件
罗磊的独立博客
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta

Netlify Changelog

Gemini 3.5 Flash now available in Agent Runners 4 Nuxt CVEs: what Netlify users need to know Gemini 3.5 Flash now available in AI Gateway Agent Runners workflow improvements Next.js & React security release (May 2026): what to know Block project transfers out of your team Gemini 3.1 Flash-Lite now available in AI Gateway OpenAI GPT-5.5 Instant now available in AI Gateway New `netlify logs` CLI command Deploy to Netlify with Stripe Projects Netlify Database is now generally available OpenAI GPT-5.5 and GPT-5.5 Pro in AI Gateway & Agent Runners Rename an agent run GPT Image 2 now available in AI Gateway New frontend-design skill for Agent Runners Claude Opus 4.7 now available in AI Gateway and Agent Runners Pricing updates for Credit-based plans New sorting and filter controls on the Members page Netlify Database GA coming soon, no new databases for now Deploy logs streaming is now faster Netlify CLI adds prompt-based creation and anonymous deploys Deploy from Codex with the Netlify Plugin Hydrogen with React Router 7 now supported on Netlify Monitor credit usage by day Invoices for Enterprise Available on the Billing Page AI app development on production infrastructure with Netlify Introducing Prompt Templates OpenAI GPT-5.4 Nano and GPT-5.4 Mini in AI Gateway Change your pricing plan Internal Builder Role & Project Access Controls
New PolyScale Integration to Improve Read Performance and...
Nahrin Jalal · 2023-03-30 · via Netlify Changelog

Performance optimizations and low latency are important for most developers, but these priorities are especially critical for those building complex sites and web applications. Ecommerce stores, social media platforms, online marketplaces, and other types of apps typically put a significant load on the underlying database, which sometimes results in slow response times and degraded performance. In scenarios that also include high read traffic, geographically dispersed users, and limited database scalability, performance bottlenecks worsen, resulting in poor user experience.

Our latest integration with PolyScale addresses performance issues caused by slow database access by storing frequently accessed data in the cache, reducing the load on the underlying database and improving the overall performance of the application. This integration enables you to create or select a PolyScale cache from the Netlify UI, execute queries against your cache from your serverless functions, and use code snippets generated in the Netlify UI to get started easily.

image

In the GIF above, you can see that creating and fetching the new cache is captured in a simple flow.

Calling Your Cache from a Function

After the cache has been added, you can select the cache you want to use from the Database cache menu (For detailed instructions on connecting your PolyScale account to your Netlify account and adding a cache, refer to our docs page). Note that the name of your cache uses the same alias you create initially.

image

When you select a cache, the Netlify UI detects the type of database and generates a code snippet you can use to get started. For example, if a CUSTOMERS cache uses Postgres, the following code snippet generates:

import postgres from "postgres";

const sql = postgres(process.env.POLYSCALE_CUSTOMERS_CONNECTION_URI);

You can use this snippet in a serverless function. In a project, you may have a file structure similar to this:

├─ netlify/

└─functions/

└─ customers/

└─ index.ts

└─package.json

In this example, index.ts is a function that executes a call to the Postgres database to select all customers. The snippet provides the starter code to add to this file. In this example, the snippet has been modified slightly to use TypeScript:

import { Handler } from "@netlify/functions";

import postgres from "postgres";

const handler: Handler = async function(event, context) {

const sql = postgres(

process.env.POLYSCALE_CUSTOMERS_CONNECTION_URI as string

);

const customers = await sql`SELECT * from customers`;

console.log("customers", customers);

return {

statusCode: 200,

body: JSON.stringify({

customers,

}),

};

};

export { handler };

If you have any questions or feedback about this integration, feel free to post in our forums!