Skip to content

Overview

Epsio plugs into existing databases and constantly updates results for queries you define whenever the underlying data changes, without ever re-calculating the entire dataset. This approach allows Epsio to provide instant and always up-to-date results for complex queries while significantly reducing costs.

Image title
Image title

Epsio supports most SQL syntax, including most types of JOINs, CTEs, subqueries, GROUP BY, and more.

How does it work?

As an example, imagine a database table that contains the salaries of all employees within a company, and a complex query that calculates the sum of salaries by department:

As new data arrives or existing data is updated, the answer needs to change accordingly. While traditional databases need to rerun the entire query to do this, Epsio will only perform the minimum calculations needed - in this case, adding or subtracting the new salary from the relevant department:

As the above calculation is very efficient (compared to recalculating the entire query), this results in massively reduced query times, significant cost savings, and a highly scalable architecture.

Usage

To configure Epsio to incrementally maintain the results of a heavy query, call the create_view function with the name and query parameters (note that all work with Epsio is done calling functions/selecting data from your existing database).

Define the Epsio View
postgres=# CALL epsio.create_view('epsio_view', 
  'SELECT SUM(SALARY), d.name FROM employee_salaries e
      JOIN deplartments d on e.department_id = d.id
      GROUP BY d.name');

NOTICE:  View created successfully
CALL

To retrieve the results, query the newly created Epsio view.

Query Epsio View
postgres=# SELECT * FROM epsio_view;
     sum     |    name     
-------------+-------------
 76348540000 | Engineering
 14689640000 | Marketing
 64478860000 | Sales
(3 rows)

Time: 7.598 ms
From this point onwards, Epsio will automatically update the view results whenever the underlying data changes to reflect the new results.

Data Changes
postgres=# UPDATE departments SET name='Changed' WHERE name='Marketing';
UPDATE 1
postgres=# INSERT INTO employee_salaries (name, salary, department_id)
              VALUES ('John', 1337, 1);
INSERT 0 1
Query Epsio View
postgres=# SELECT * FROM epsio_view;
     sum     |    name     
-------------+-------------
 76348540000 | Engineering
 14689641337 | Changed
 64478860000 | Sales
(3 rows)

Time: 6.332 ms