The Domino Model API serves code as a low-latency web service.
Enable business teams to share data and functionality as a WebService API in seconds.
Table of Contents
- Data API, fast data access
- Function API, fast function deployment
- Examples
The Data API provides sub-second access to user-defined data
- storage types: AWS S3 and Microsoft Windows Network Drives
- file types: parquet, json, binary
- options: caching, performance
Read data from a configured AWS bucket and prefix
Domino Model API:
{ "function":"data_read", "path":"10MB.bin", "storage:"s3" }
Function API:
data_read( {"path":"10MB.bin", "storage:"s3"} )
Read data from a Microsoft Windows Network Drive
Domino Model API:
{ "function":"data_read", "path":"10MB.bin", "storage:"sd" }
Function API:
data_read( {"path":"10MB.bin", "storage:"sd"} )
The Function API deploys user-defined functions.
- immediate live load deployment
- no Model API server restarts, downtime, lost memory
User-defined function files should include a main function
def main(cache, kwargs):
Domino Model API:
{ "function":"function_create", "function_name":"udf", "function_file":"udf.py" }
Function API:
function_create( {"function_name":"udf", "function_file":"udf.py"} )
Domino Model API:
{ "function":"udf", kwargs }
Function API:
udf(kwargs)
The above APIs are demonstrated below use the Domino client domino_client.py.
domino_client.py '{Domino_API_JSON}'
Note: The Domino client requires:
- 'requests' module installed
- DOMINO_ENDPOINT environment variable
This example shows a WebService reading user-defined data from AWS S3
domino_client.py '{ "function": "data_read", "path":"test/1MB.bin", "storage":"s3" }'
This example shows a WebService reading user-defined data from a Windows Network Drive
domino_client.py '{ "function": "data_read", "path":"test/1MB.bin", "storage":"sd" }'
This example shows off deploying a user-defined function and calling it as a WebService.
domino_client.py '{ "function":"function_create", "function_name":"random_number", "function_file":"function/random_number.py" }'
domino_client.py '{ "function":"random_number", "start":1, "stop":100 }'
3.4 π calculator
This example shows off deploying a complex user-defined function and calling it as a WebService.
domino_client.py '{ "function":"function_create", "function_name":"pi", "function_file":"function/pi.py" }'
domino_client.py '{ "function":"pi", "significant_digits":'9' }'
This example shows off deploying a complex user-defined function consuming user-defined data and calling it as a WebService.
domino_client.py '{ "function":"function_create", "function_name":"performance_test", "function_file":"function/performance_test.py" }'
domino_client.py '{ "function":"performance_test" }'
| Storage Type | 1 MB file | 10 MB file | 100 MB file |
|---|---|---|---|
| Microsoft Network drive | 0.6 seconds | 0.8 seconds | 7 seconds |
| AWS S3 | 5.7 seconds | 12 seconds | 13 seconds |
| Cache | 0.0001 seconds | 0.0001 seconds | 0.0001 seconds |
WebService data access times