Why stored procedures?#
Stored Procedures (sprocs) are functions that run on the server side of a database. In particular we will be talking about sprocs in CosmosDB.
The main reasons to use CosmosDB Sprocs are for atomic transactions and performance. All database operations completed in a single sproc call will be atomic. Since the sproc runs on the server the network latency for loading and saving documents will be considerably less than if you ran the same operations from a remote server
This short series will show you how to programmatically update stored procedures and explore thier basic functionality.
The CosmosDB SQL is very flexible in returning objects and view projections, but it cannot Update documents via its SQL dialect.
The CosmosDB SQL API is very flexible in returning objects and view projections, but it cannot merge documents via its SQL dialect.
CosmosDB Stored Procedures Why stored procedures? Stored Procedures (sprocs) are functions that run on the server-side of a database. In particular, we will be talking about sprocs in CosmosDB.
The main reasons for using CosmosDB Sprocs are atomic transactions and performance. All database operations completed in a single sproc call will be atomic. Since the Sproc runs on the server the network latency for loading and saving documents will be considerably less than running the same operations from a remote server or laptop.
...