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.