Dynamic Macros in Multi-Tenant SQL for Cross-Database Query Translation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The existing database systems in cloud computing environments face challenges due to syntactical and behavioral differences, leading to support issues and customer frustration, as developers need to manage various database systems with unique syntax and features, such as Oracle and Postgres, which complicates query execution and data management.

Innovation Solution

The implementation of a multi-tenant aware structured query language, specifically SFSQL, which includes features like BY ORGID, BY PARTITION, dynamic macros, and conditional statement execution, allows for a unified syntax to operate across multiple database systems, translating queries into native formats for Oracle and Postgres, ensuring consistent behavior and reducing the complexity of managing disparate database systems.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If multiple database system offerings are provided to satisfy diverse customer needs, then adaptability and customer satisfaction improve, but syntactical and behavioral differences between systems increase complexity and cause support issues

Engineering Contradiction:
Improvedatabase system varietyVSAvoidsyntax and behavior consistency
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent introduces a query translation layer that acts as an intermediary between the unified SFSQL interface and multiple underlying database systems (Oracle, Postgres). This translator converts SFSQL queries into system-specific syntax, allowing customers to access diverse database systems through a single consistent interface without dealing with syntactical differences directly

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of operation

If a single homogeneous database system is provided to eliminate syntax differences, then ease of operation and consistency improve, but adaptability and ability to satisfy diverse customer needs deteriorate

Engineering Contradiction:
Improvequery syntax consistencyVSAvoiddatabase system variety
Core Design Contradiction:
Ease of operationVSAdaptability or versatility

Solution Approach 1:

The patent creates a universal query language (SFSQL) that can operate across multiple database systems. The system provides multi-functionality by enabling a single query interface to work with different database types (Oracle, Postgres, etc.), eliminating the need for customers to learn multiple syntaxes while maintaining access to diverse database capabilities

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Ease of operation

If dynamic macros are implemented in the query language, then ease of operation and query flexibility improve, but parsing and execution complexity increases

Engineering Contradiction:
Improvequery flexibilityVSAvoidparsing complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent implements dynamic macros that are pre-compiled and stored in a macro library during system initialization. When queries are executed, the parser checks the macro library for pre-compiled macro definitions rather than parsing macro syntax in real-time, significantly reducing parsing complexity while maintaining query flexibility

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10776349B2Systems, methods, and apparatuses for implementing dynamic macros within a multi-tenant aware structured query language
Publication Date: 2020.09.15 SALESFORCE INC
  • US10776349B2 patent drawing
  • US10776349B2 patent drawing
  • US10776349B2 patent drawing

AI summary

In accordance with disclosed embodiments, there are provided systems, methods, and apparatuses for implementing dynamic macros within a multi-tenant aware structured query language operable within a computing environment. For instance, such an exemplary system having a processor and a memory therein includes means for operating a multi-tenant database system having customer data stored therein for a plurality of distinct customer organizations; receiving a database query specifying a dynamic macro function call to be executed at runtime and replaced with a string within a new structured query language statement to be executed against the multi-tenant database system; parsing the database query to identify the dynamic macro function call specified; parsing the database query to identify a functional expression to be evaluated at runtime as passed with the dynamic macro function call specified; generating a new structured query language statement to execute against the multi-tenant database system in fulfillment of the database query received, in which the new structured query language statement includes the string in place of the dynamic macro function call or a functional call executable by the multi-tenant database system at runtime to be resolved to the string by the multi-tenant database during execution of the new structured query language statement; and executing the new structured query language statement against the multi-tenant database system. Other related embodiments are disclosed.