Telerik Platform supports two types of Cloud Code: Cloud Code for Data and Cloud Functions.
Cloud Code for Data is similar to a trigger in a conventional database. This type of code gets executed whenever an item is created, read, updated, or deleted. Furthermore, you can plug your code both before the query execution or after, to act on the query result. This way you can change both the query or the result based on your custom logic.
Cloud Code for Data can be useful in these example scenarios among others:
- Validating data before inserting or updating items
- Updating related data on inserting or updating items
- Sending emails or push notifications after inserting or deleting items
- Enhancing data before returning it to the client (adding custom fields to items, fetching related data, etc.)
Read more in Cloud Code for Data.
With Cloud Functions, you can write a piece of code, store it in the cloud, and execute it whenever you need on the Telerik Platform servers. Cloud functions can accept parameters and can return a result.
Each Cloud Function is assigned a unique RESTful endpoint. To invoke the Cloud Function, you make an HTTP request to the endpoint's URL. Parameters to the function are supplied as query parameters in the URL or as HTTP headers. You can also use the body of the request to send any data you want. The result of the function is obtained through the HTTP response.
Cloud Functions can be useful in these example scenarios among others:
- Server-side logic that is not triggered by a data operation
- Hook for integration with external products and services
- Generating reports
You can read more in Cloud Functions.
In this section:
- Cloud Code for Data
- Cloud Functions
- Using the Cloud Code SDK
- Making HTTP Requests from Cloud Code
- Using External Libraries in Cloud Code
- Cloud Code Parameters Reference