I was trying to migrate from Another RDBMS to cockroachDB but I think there is no such functionality like stored procedures in Cockroach. So what is the best alternative to make a stored procedure in cockroachDB ?
Alternative For Stored Procedures In cockroachDB
2.1k Views Asked by divya kriplani At
2
There are 2 best solutions below
0
Mario
On
CockroachDB is distributed SQL and natively suits serverless patterns. As a stored proc is just a way to ensure procedural consistency, you could probably get by using serverless functions (whatever flavor). The idea is the serverless function is a proxy for the stored procedure.
While it is possible for a procs to call other procs, common advice is to avoid having serverless functions call each other. It would be reasonable to develop a cloud library (JavaScript, for example) which models all the DB constraints. Then each serverless function becomes an endpoint (proc) and the library provides the means to reuse/shared logic.
Related Questions in DATABASE
- When dealing with databases, does adding a different table when we can use a simple hash a good thing?
- How to not load all database records in my TListbox in Firemonkey Delphi XE8
- microsoft odbc driver manager data source name not found and no default driver specified
- Cloud Connection with Java Window application
- Automatic background scan if user edit column?
- Jmeter JDBC Connection Configuration Parametrization of Database URL for accessing SQL Database
- How to grant privileges to current user
- MySQL: Insert a new row at a specific primary key, or alternately, bump all subsequent rows down?
- Inserting and returning autoidentity in SQLite3
- Architecture: Multiple Mongo databases+connections vs multiple collections with Express
- SQL - Adding a flag based on results within a query - best practice?
- Android database query not returning any results
- Developing a search and tag heavy website
- Oracle stored procedure wrapping compile error with inline comments
- Problems communicating with mysql in php
Related Questions in STORED-PROCEDURES
- Optimising a slow running SQL Server Stored procedure ordered by calculated fields to return a closest match
- Oracle stored procedure wrapping compile error with inline comments
- Insert Into SP in Oracle Sql Developer
- Abstracting out a query to a stored procedure makes it run very slowly
- why it doesnt accept a concated string as parameter in SP?
- SQL Server Index recreate Stored Procedure Slow
- How to access a Row Type within an Array Type in DB2 SQL PL
- Return all Ids generated by Insert statement
- Most effective way to bind data models in WebForms without stored procedures?
- How to get result set from Oracle Stored Procedure?
- SQL Stored Procedure How to Modify and Return the Result of an Executed Dynamic Query
- How LinqToSql Generates output result of stored procedures
- pass $_post array elements of form as a string to mysql stored routines
- passing parameter values to stored procedure when calling from another procedure
- Insert Stored Procedure for One to many relationship SQL
Related Questions in MIGRATION
- NoMethodError: undefined method `add_attachment' for #<AddImageCloumnToPost:0x58 ba1b8>
- Not getting Downloaded - "Azure DocumentDB Data Migration Tool"
- migrate one ldap server to another - questions
- Scope attribute migration from Struts1 to Struts2
- Is there any way to rearrange the table's fields in Rails migrations?
- Unable to cast object of type 'System.Web.Hosting.SimpleWorkerRequest' to type 'System.Web.Hosting.IIS7WorkerRequest'
- handling really long migrations in Heroku
- Migrating source code from PVCS to SVN
- I am new to ubuntu.i have installed phpstorm and try to run composer but it's not running
- Magento Fatal error: Call to a member function setData()
- Add comment to SQL table
- Django migration having no effect, on postgres table
- Rollback and Start Over/Pending Migration
- How Django finds all the migrations
- Join table comment in rails 4 migration
Related Questions in COCKROACHDB
- cockroach DB issue to start : Fail to initialize the node: unable to load named timezone
- Spring-boot vs Postgres vs Cockroach -> The fastpath function lo_creat is unknown
- Searching a large string in Database
- Nestjs: Loading jsonb from CockroachDB with TypeOrm turns date into string
- Compare two arrays using QueryDSL
- How does one update the version of Hibernate that SCDF uses?
- CockroachDB read transactions
- CockroachDB is generating big ids when records are inserted via spring
- How to ignore getaddrinfo ENOTFOUND in NestJS (using TypeORM)
- How to change my region on CockroachDB Cloud?
- Using cockroachdb / postgresql in an iOS swift app
- Why is the slice not passed to the pg array?
- Symfony database connection to CockroachDB
- How does HLC hybrid logical clock solve Linearizability and Serializability in distributed transaction?
- Insert dataframes to cockroachdb table
Related Questions in COCKROACHCLOUD
- How to change my region on CockroachDB Cloud?
- Using cockroachdb / postgresql in an iOS swift app
- Why is my CockroachDB disk usage not decreasing?
- encapsulating a Drop and Add constraint in a transaction
- Can't connect to CockroachCloud Free (beta) Cluster from a Spring Data R2DBC driver
- can not connect to cockroachdb invalid cluster name
- Accessing cockroachcloud db from python app running in Heroku
- Alter the definition of the Stored Computed Column in CockroachCloud
- Alternative For Stored Procedures In cockroachDB
- Is it possible to perform evelope encryption in CockroachDB?
- using sql regrex_replace to replace every word that starts with a # symbol with mask(word)
- Cannot decommission cockroachdb node
- Cockroachdb: Retrieving cluster info: failed Error: 401 Unauthorized
- Random spikes in usage (CockroachCloud Serverless)
- How do I connect DBeaver to CockroachDB Serverless?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
CockroachDB does not support stored procedures and the best alternative would depend on the problem you are trying to solve. A few examples:
EDIT: Stored Procedures as a Litmus Test, an article by Joe Emison, compares Stored Procedures to other solutions. It may be helpful in understanding alternatives.