PostgREST supercharged

Meet PostgREST+

Get all the benefits of the open source version
PLUS a set of powerful features.
Aggregate functions, window functions, read replicas...
You name it, we have it.

»

Powerful analytical queries

Aggregates

A big part of why databases are so useful is their ability to perform aggregate queries. By exposing the groupby query parameter, you can run custom aggregate queries against your data without the need for additional custom views or stored procedures created specifically for a particular aggregation »
/product_orders
  ?select=city,total:$sum(order_amount)
  &groupby=city
[
  {"city":"Arlington","total":"$37,000.00"},
  {"city":"GuildFord","total":"$50,500.00"},
  {"city":"Shalford","total":"$13,000.00"}
]

A Secret Superpower

Window functions

There was SQL before window functions and SQL after window functions: that’s how powerful they are.
Window functions are closely related to aggregate functions. But rather than collapsing all the rows we want into one row, we keep them. Then we add a new column with a running total, rank or moving average »
/empsalary
  ?select=depname,empno,salary,avg:$avg(salary)-p(depname)
[
  {"deptname":"develop"   "empno":7  "salary":4200 "avg":4900},
  {"deptname":"develop"   "empno":9  "salary":4500 "avg":4900},
  {"deptname":"develop"   "empno":8  "salary":6000 "avg":4900},
  {"deptname":"personnel" "empno":5  "salary":3500 "avg":3700},
  {"deptname":"personnel" "empno":2  "salary":3900 "avg":3700},
  {"deptname":"sales"     "empno":3  "salary":4800 "avg":4866},
  {"deptname":"sales"     "empno":1  "salary":5000 "avg":4866},
  {"deptname":"sales"     "empno":4  "salary":4800 "avg":4866}
]

Protect your Database

Smart Views

If you need to block full-table operations (deleting/updating multiple rows with one request) or restrict clients from issuing expensive request without specific filters applied, you need PostgREST+.
For this reason, PostgREST+ makes available to the SQL context all the request parameters which enables some powerful capabilities.
We call them Smart Views. »
create view api.books as 
select id, title, publication_year, author_id 
from private.books 
where 
validate(
  request.method() != 'DELETE' or
  (
    request.method() = 'DELETE' and
    request.get('id') is not null
  ),
  'Full table DELETE blocked',
  'Please provide the id of the book entry you want to delete'
)

Scale read-heavy workloads

Read Replicas

Elastically scale out beyond the capacity constraints of a single DB instance for read-heavy database workloads. PostgREST+ will load-balance the requests across your read replicas. You can create one or more replicas of a given source DB Instance and serve high-volume application read traffic from multiple copies of your data, thereby increasing aggregate read throughput.

Faster Queries

Prepared Statements

PostgREST+ generates prepared statements instead of inline queries compared to the open source version.
From PostgreSQL manual: Prepared statements potentially have the largest performance advantage when a single session is being used to execute a large number of similar statements. The performance difference will be particularly significant if the statements are complex to plan or rewrite, e.g., if the query involves a join of many tables or requires the application of several rules »
/projects?select=id,name&id=eq.5
PREPARE my_query (int) AS
SELECT id, name 
FROM projects
WHERE projects.id = $1;
EXECUTE my_query(5);

Deploy it anywhere

Fully Managed Service

subZero automates every part of setup, running and scaling of PostgREST+ in AWS. Let your team focus on what they do best - building your product. Leave PostgREST+ management and monitoring to the experts.

Self-Managed

If you have compliance or privacy requirements, prefer a specific cloud provider or you want to run it internally on bare-metal, you can take it with you ... not questions asked :). You can purchase a license and download our binary & container distributions or even get the source code.

Buy