logo

Server-Side Processing

With VortexDB, you can run computations directly in the database using stored procedures. This reduces network hops and eliminates the need for a separate application layer for many tasks.

Stored Procedures

VortexDB supports stored procedures written in JavaScript. These procedures are executed on the database server, allowing you to perform complex data manipulations and business logic close to the data.

Benefits

Benefit Impact Example
Reduced Latency 40-60% faster Data processing
Improved Performance 2-3x throughput Batch operations
Simplified Logic Cleaner code Business rules
  • Reduced Network Latency: By processing data on the server, you avoid sending large amounts of data over the network.
  • Improved Performance: Stored procedures are pre-compiled and optimized for performance.
  • Simplified Application Logic: You can encapsulate complex business logic in stored procedures, making your application code cleaner and easier to maintain.

Use Cases

  • Complex Business Logic: Implement intricate business rules directly within the database.
  • Data Validation: Enforce data integrity and consistency at the database level.
  • Batch Processing: Execute large-scale data transformations and updates efficiently.
  • Security: Encapsulate sensitive operations and control access through stored procedures.

User-Defined Functions (UDFs)

Stored Procedures Flow

VortexDB also supports User-Defined Functions (UDFs), which are similar to stored procedures but return a single value and can be used within SQL queries.

Creating UDFs

UDFs can be written in JavaScript and registered with the database. They can perform calculations, string manipulations, or other operations on data.

Benefits of UDFs

  • Reusability: Define common logic once and reuse it across multiple queries.
  • Modularity: Break down complex queries into smaller, more manageable functions.
  • Performance: UDFs are optimized for execution within the query engine.
On this page