Home / Companies / SurrealDB / Blog / Post Details
Content Deep Dive

Custom API Endpoints: streamlining your architecture

Blog post from SurrealDB

Post Details
Company
Date Published
Author
-
Word Count
940
Company Posts That Month
12
Language
English
Hacker News Points
-
Post removed?
No
Summary

SurrealDB 3.0 introduces a significant feature called DEFINE API, which allows developers to create custom API endpoints directly within the SurrealQL query language, simplifying the traditional three-layer architecture of client, middleware, and database into a more streamlined client-to-database interaction. This enhancement reduces infrastructure complexity, improves performance, and facilitates management, as demonstrated in a real-world scenario where rate limits for guest users in a social application are efficiently managed using this new feature. By incorporating middleware functions such as api::timeout, developers can control server time for guest users, while the DEFINE API statement specifies API endpoints, ensuring that data is returned according to defined criteria. SurrealDB also supports custom middleware functions, enabling developers to enhance API responses further, and with the power of API design integrated into the database, users can redefine architectural possibilities without needing additional frameworks.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
AI Agents 2 3,583 743 199 -1%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.