According to conventional Web-based architectures, a client application (e.g., a Web browser) requests information from a Web server, the Web server retrieves the information from a database system (e.g., via an intermediate application server), and the Web server provides the information to the client application.
Open Data Protocol (OData) is a resource-based Web protocol for querying and updating data. Accordingly, a Web-based client may use the OData protocol to retrieve data stored in a database system, as long as the database system (and/or an intermediate application server) supports the OData protocol. However, the OData protocol does not provide an efficient mechanism for accessing single entities of a parameterized entity set.
The following description is provided to enable any person in the art to make and use the described embodiments and sets forth the best mode contemplated for carrying out some embodiments. Various modifications, however, will remain readily apparent to those in the art.
Database system 110 implements an “in-memory” database, in which data 112 represents a full database stored in volatile (e.g., non-disk-based) memory (e.g., Random Access Memory). The full database may be persisted in and/or backed up to fixed disks (not shown). Embodiments are not limited to an in-memory implementation. For example, data 112 may be stored in one or more fixed disks (e.g., persistent memory for storing their respective portions of the full database) and accessed during operation when needed.
Database system 110 may comprise any query-responsive data source or sources that are or become known, including but not limited to a structured-query language (SQL) relational database management system. Database system 110 may comprise a relational database, a multi-dimensional database, an eXtendable Markup Language (XML) document, or any other data storage system storing structured and/or unstructured data. Database system 110 may be distributed among several relational databases, dimensional databases, and/or other data sources. Embodiments are not limited to any number or types of data sources.
In some embodiments, data 112 may comprise one or more of conventional tabular data, row-based data, column-based data, and object-based data. Moreover, data 112 may be indexed and/or selectively replicated in an index to allow fast searching and retrieval thereof.
Database system 110 includes native processing engines 114, for example, for processing SQL statements received from application server 130. An SQL processing engine may perform table joins, etc. which are required to respond to an incoming SQL statement. Native processing engines 114 may include one or more engines for executing any standardized or proprietary scripting language. Such an engine may therefore provide execution of data-intensive application logic within database system 110.
SQL other scripting languages may be implemented using a common infrastructure of built-in data engine functions which have access to various metadata, such as definitions of relational tables, columns, views, and indexes, and definitions of script procedures. Database system 110 may additionally provide a framework for the installation of functional libraries which are integrated with different ones of processing engines 114.
Application server 130 includes HTTP interface 132 through which clients 120 may communicate with application server 130. According to the illustrated embodiment, application server 130 provides a set of embedded system services which support applications 134 executing on server 130. The system services may be used by these server applications 134 to expose the data model of database system 110 to clients 120, including its tables, views and database procedures. In addition to exposing the data model, application server 130 may host system services such as a search service. The system services may also provide a lightweight web server, server-side JavaScript execution and access to SQL and other scripting language functions, and configurable support for OData (i.e., OData services 136).
OData services 136 expose an end point that allows applications 134 to access data 112. OData services 136 implement the OData protocol and map data 112 between its underlying form (e.g., database tables, spreadsheet lists, etc.) and a format that the requesting client can understand.
OData defines an abstract data model and a protocol which, together, enable any client to access data exposed by any data source via a Uniform Resource Indicator (URI). The data model provides a generic way to organize and describe data. OData uses the Entity 1 Data Model (EDM).
The OData protocol is a set of interactions which includes the REST-based create, read, update, and delete operations along with an OData-defined query language. OData defines operations on resources using HTTP commands (for example, GET, PUT, POST, and DELETE) and specifies the URI syntax which is used to identify the resources. The OData service sends data in either in XML-based format defined by Atom/AtomPub or using JavaScript Object Notation (JSON).
Each of clients 120 may comprise one or more devices executing program code of a software application for presenting user interfaces to allow interaction with application server 130. Presentation of a user interface may comprise any degree or type of rendering, depending on the type of user interface code generated by application server 130. For example, a client 120 may execute a Web Browser to request and receive a Web page (e.g., in HTML format) from application server 130 via HTTP or HTTPS, and may render and present the Web page according to known protocols. One or more of clients 120 may also or alternatively present user interfaces by executing a standalone executable file (e.g., an .exe file) or code (e.g., a JAVA applet) within a virtual machine.
Initially, an OData service is activation at S210. As is known in the art, activation of an OData service may include creation of a view to be exposed by the OData service, creation of an OData service definition for the OData service, and compilation of these items into run-time artifacts. The OData service definition specifies the database views to be exposed as OData collections. A view may be exposed using the view's repository (i.e., design-time) name or the view's database catalog (i.e., run-time) name.
The OData service definition also may include associations to express relationships between entities, and specifies the columns of a view which will form the key for the view. Moreover, the OData service definition allows generation of Parameter Entity Sets for both calculation views and analytic views by adding ‘parameters via entity’ to the entity, as illustrated in the following service-definition example:
During activation of the entity set, the specified parameters are retrieved from the metadata of the view and exposed as a new EntitySet named after the entity set name and the suffix Parameters, for example, CalcViewParameters. A NavigationProperty named Results is generated to retrieve the results from the parameterized call.
The OData service activated at S210 exposes a Parameter Entity Type and a Result Entity Type. The Parameter Entity type includes one or more input parameters of the database view as properties, and defines a key formed by each of the one or more input parameters. The Result Entity Type includes the one or more input parameters and one or more output parameters of the database view as properties, and defines a key formed by each of the one or more input parameters and at least one of the one or more output parameters.
Parameter Entity Type 305 also includes Property 3 defining a relationship between Parameter Entity Type 305 and Result Entity Type 325, to allow navigation from Parameter Entity Type 305 to Result Entity Type 325.
The following is an example of a $metadata document of an OData service which exposes a calculation view and shares the structure of
According to the above example, the Parameter Entity Type “ScriptPIKParamsType” includes input parameters nvarcharParam and integerParam as first and second properties, and defines a key formed by nvarcharParam and integerParam. Result Entity Type “ScriptPIKType” includes input parameters nvarcharParam and integerParam as first and second properties, output parameters nvarcharOut and integerOut as third and fourth properties, and defines a key formed by nvarcharParam, integerParam and nvarcharOut.
For comparative purposes,
Result Entity Type 425 includes output parameters 435 and 440 exposed as properties. However, Result Entity Type 425 exposes CalculatedID property 430 as key 445. The value CalculatedID property 430 is uniquely derived from the parameters and keys of the actual query result instance. Consequently, access to instances of the result are only possible via the Parameter Entity Type or by deriving the key, the latter of which requires a user to know the derivation algorithm of the key column.
The following is an example of a $metadata document of an OData service which exposes a calculation view and conforms to the prior art structure shown in
According to the above example, the Parameter Entity Type “ScriptPIKParamsType” includes input parameters nvarcharParam and integerParam as first and second properties, and defines a key formed by nvarcharParam and integerParam. In contrast to the prior example, Result Entity Type “ScriptPIKType” includes a CalculatedID as a first property, and output parameters nvarcharOut and integerOut as second and third properties. Moreover, the key of ScriptPIKType is formed solely by CalculatedID.
Returning to process 200, a Web-based request is received at S220. The request may be received by an application 134 from HTTP interface 132, which in turn received the HTTP request from one of clients 120.
The request includes a URI specifying the result entity type exposed by the OData service. The request also specifies a value for each of the one or more input parameters of the database view and for at least one of the output parameters of the database view. In other words, the request projects the parameters of the call as properties (i.e., columns) in the result rather than using a calculated key. Consequently, a single result entity is accessible via a distinct list of property values within a URI, without requiring generation of a key value.
The following is an example of a URI received at S220 according to some embodiments:
Using this URI, the application 134 accesses the corresponding OData service 136 calc.xsodata at S230. Based on the metadata definition of the OData service, an OData handler constructs the required database statements and invokes them using an SQL API. A single entity associated with the parameter values is returned at S230.
In contrast, using the conventional system mentioned above, a single entity may be directly accessed only via a calculated key value (i.e., CalculatedID) as shown:
According to some embodiments, the URI for requesting all entities is the same for both systems:
Moreover, a URI for requesting a list filtered to include only the single entity is also the same using either system:
Embodiments of the features described herein therefore allow direct access of a single entity based only on the parameter values. The Result Entity Set is queried directly using the parameters as keys. The prior system also described herein is only capable of filtering the result and returning a result set including a single entry, if only the parameter values are known.
Clients 540 send their requests to database platform 510 via HTTP or HTTPS. Clients 540 may be Web browsers, mobile applications, or other applications that consume resources and services provided by server applications. According to some embodiments, the presentation logic is run on clients 540.
Server 520 runs services that accept the HTTP requests and maps them to database queries and stored procedure calls. As described above, the HTTP requests may include OData requests, and the services may include OData services and validation exits. Data-intensive logic may be executed in index server 530 (using SQL, SQLScript, views, L procedures, C++, etc.).
In this regard, web application server 520 can be viewed as an index server with server layer 525 on top. However, according to some embodiments, no application data is stored in Web application server 520 itself. If server layer 525 needs to access tables or views or needs to call a stored procedure, it uses the illustrated internal SQL API to open a local database connection and then sends an SQL statement to the SQL processor in the web application server 520. The statement is processed by the SQL processor or by the calculation engine of web application server 510.
The SQL processor and the calculation engine delegate the execution to the index server 530 which manages the required data. This delegation may be similar to the mechanism used in a distributed database system including multiple index servers. In contrast, however, web application server 520 delegates the execution of database operations because it does not store application tables. Integration of server 520 into database platform 510 may lead to simplified administration and a better development experience.
Incoming requests from clients 620 are received by the request handler. The request handler first determines the application to which the requested resource belongs by invoking the application registry, which maintains a list of all active applications. The application registry initially reads this information from runtime storage tables located in the master index server and caches the information in its application index. After the application is determined, optional Uniform Resource Locator (URL) rewriting rules are applied. URL rewriting rules can be defined for each application to map between external URLs and corresponding internal technical URLs.
The request handler then invokes the session manager. The session manager either relates the request to an existing session or starts a new session. The session manager is responsible for session authentication. A developer may specify, on the package level, whether authentication is required for accessing the resources. Server 610 may support several authentication mechanisms, including but not limited to SAML, SAP assertion ticket, SAP logon ticket, Kerberos, X.509 certificates, and user and password using HTTP basic authentication or form-based logon.
After successful authentication, the request handler forwards the request to the responsible resource handler of server 610.
The static content handler is called for content such as Hypertext Markup Language (HTML) files, client side scripts, or images. The static content handler retrieves the resources from the runtime storage.
OData handler 615 is invoked if the requested resource belongs to an OData service. If the client requests the service definition, OData handler 615 returns a document including the metadata about the service. This document is generated during the activation of the service descriptor which was written by the developer. If the client requests actual data, the OData handler constructs the required database statements and invokes them using the internal SQL API. The OData handler transforms the query results into the format requested by the client, which can be either Atom (content type “atom+XML”) or JSON.
The JavaScript handler is invoked if the requested resource is a server-side JavaScript program. The JavaScript handler reads the runtime object with the JavaScript byte code from the runtime storage tables, and invokes the JavaScript runtime for executing it. The JavaScript runtime also contains an implementation of JavaScript APIs. If such an API is called, the JavaScript runtime invokes the responsible component, such as the session manager, the outbound HTTP client, the trace writer, or the internal SQL API.
The outbound HTTP client is used to send HTTP/S requests to an external server. The connection details of the remote server need to be specified in advance by creating an HTTP destination configuration. The internal SQL API invokes an SQL execution chain. The SQL executor and the calculation engine in server 610 delegate the actual data operations to the index server where the data resides.
The C++ handler is responsible for resources and services exposed by system applications that are written in C++. These system applications have the same lifecycle as the database platform and are part of the database build. One example is a Direct Extractor Connection (DXC) that allows DataSource extractor-based data replication between clients and the database platform via HTTP. DataSource extractors in the client are redirected to send extracted data to the database platform system via HTTP. The data is received by the DXC system application in the XS server, which stores it in the database.
Apparatus 700 includes processor 710 operatively coupled to communication device 720, data storage device 730, one or more input devices 740, one or more output devices 750 and memory 760. Communication device 720 may facilitate communication with external devices, such as a reporting client, or a data storage device. Input device(s) 740 may comprise, for example, a keyboard, a keypad, a mouse or other pointing device, a microphone, knob or a switch, an infra-red (IR) port, a docking station, and/or a touch screen. Input device(s) 740 may be used, for example, to enter information into apparatus 700. Output device(s) 750 may comprise, for example, a display (e.g., a display screen) a speaker, and/or a printer.
Data storage device 730 may comprise any appropriate persistent storage device, including combinations of magnetic storage devices (e.g., magnetic tape, hard disk drives and flash memory), optical storage devices, Read Only Memory (ROM) devices, etc., while memory 760 may comprise Random Access Memory (RAM).
Program code 732 may comprise program code executed by processor 710 to cause apparatus 700 to perform any one or more of the processes described herein. Embodiments are not limited to execution of these processes by a single apparatus. Database 734 may include database data as described above. As also described above, database data (either cached or a full database) may be stored in volatile memory such as memory 760. Data storage device 730 may also store data and other program code for providing additional functionality and/or which are necessary for operation of apparatus 700, such as device drivers, operating system files, etc.
The foregoing diagrams represent logical architectures for describing processes according to some embodiments, and actual implementations may include more or different components arranged in other manners. Other topologies may be used in conjunction with other embodiments. Moreover, each component or device described herein may be implemented by any number of devices in communication via any number of other public and/or private networks. Two or more of such computing devices may be located remote from one another and may communicate with one another via any known manner of network(s) and/or a dedicated connection. Each component or device may comprise any number of hardware and/or software elements suitable to provide the functions described herein as well as any other functions. For example, any computing device used in an implementation of a system according to some embodiments may include a processor to execute program code such that the computing device operates as described herein.
All systems and processes discussed herein may be embodied in program code stored on one or more non-transitory computer-readable media. Such media may include, for example, a floppy disk, a CD-ROM, a DVD-ROM, a Flash drive, magnetic tape, and solid state Random Access Memory (RAM) or Read Only Memory (ROM) storage units. Embodiments are therefore not limited to any specific combination of hardware and software.
Embodiments described herein are solely for the purpose of illustration. Those in the art will recognize other embodiments may be practiced with modifications and alterations to that described above.
This application claims benefit to and priority of U.S. Patent Application Ser. No. 61/908,710, filed Nov. 25, 2013, the contents of which are hereby incorporated by reference in their entirety for all purposes.
Number | Date | Country | |
---|---|---|---|
61908710 | Nov 2013 | US |