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
- How to add the dynamic new rows from my registration form in my database?
- How to store a date/time in sqlite (or something similar to a date)
- Problem with add new attribute in table with BOTO3 on python
- When an E-R attribute should be perceived as a relationship attribute or as an entity set attribute?
- SQLAlchemy: efficient relationship loading in 3-way many-to-many relationship
- Cannot connect to Postgres Database when running Quarkus Tests with Gitlab ci
- Local or remote database with react-native?
- I want to edit a specific row in database
- How to enter data in mongodb array at specific position such that if there is only 2 data in array and I want to insert at 5, then rest data is null
- Open Web Library
- database login.py and register.py error showing 404 file not found and doesn't work
- SQL71561: SqlComputedColumn: When column selected
- Liquibase as SaaS To Configure Multiple Database as Dynamic
- Updated max input vars but table still shows error
- Spring does not map set of roles
Related Questions in STORED-PROCEDURES
- Calling a REST API from SQL Server
- Updating Access Database using C# and stored procedure does not work
- How to load csv data to mysql table using mysql stored procedure
- Why are encrypted stored procedures taking a long time to execute in SQL Server 2022?
- switch from current encoding to specified encoding is not supported
- Get merge WHEN NOT MATCHED output into another table
- Parmeter values not resolving in ADF
- Creating a stored function on SQL of average scores, error code 1064
- value for insert on a procedure call is taken as column name generating an error that reports such column doesn't exist
- Stored Procedure to Update Column in TableA to TableB Value +1 For Each Change In The Column
- CallableStatement for DB2 StoredProcedure throws BadSqlGrammarException - Descriptor index not valid (10>9)
- How to call a stored procedure from Spring Data JPA and map the result to a custom object without having a corresponding entity?
- ORACLE: Build 'INSERT INTO' statements from 'SELECT *' results
- SQL Tranformations in view or stored procedure?
- How to add conditions to WHERE clause with if...else in SQL?
Related Questions in MIGRATION
- How Do Schema migration in mongoose & mongodb?
- WPF Windows Initializing is locking the separated thread in .Net 8
- Migrate data from MySQL to PostgreSQL In Azure
- migrate error : ...No migrations to apply
- After upgrading Alfresco from 5.2 to 7.2 getting failed to initialize keystore error. Our old repository is in Alfresco 5.2
- Convert Neoload script to LoadRunner script
- Migration of UseOAuthAuthorizationServer from .Net Framework to .Net8
- Migrate multiple notebooks from current environment to new environment
- How to Generate a Migration Script in the Azure DevOps
- C# Project Coding
- Blazor hybrid cant add migration
- Migrate from SAML extensions to SAML service provider and spring security
- Ejabberd Migration from 23 to 24
- unable to upload Paginated report
- Android Studio could not build Flutter App APK after migration
Related Questions in COCKROACHDB
- CockroachDB: The best way to turn a UNIQUE CONSTRAINT into a PRIMARY KEY?
- Is the ANY keyword in SQL considered an atomic operation?
- Cannot recover cockroachdb when a node is dead
- Is there a limit on the table or database creation for CockroachDB Serverless
- Using r2dbc-postgresql for CockroachDB result in authentication failure: "Password must not be null"
- Is it possible to perform evelope encryption in CockroachDB?
- How to split table ranges to other nodes in a cluster
- How to handle CA cert of Cockroach DB when deploying a Streamlit app to production?
- Error: P1001: Can't reach database server at `crdb`:`26257`
- How does HLC hybrid logical clock solve Linearizability and Serializability in distributed transaction?
- Why is the slice not passed to the pg array?
- Symfony database connection to CockroachDB
- Using cockroachdb / postgresql in an iOS swift app
- How to change my region on CockroachDB Cloud?
- How to ignore getaddrinfo ENOTFOUND in NestJS (using TypeORM)
Related Questions in COCKROACHCLOUD
- Is it possible to perform evelope encryption in CockroachDB?
- Using cockroachdb / postgresql in an iOS swift app
- How to change my region on CockroachDB Cloud?
- Why is my CockroachDB disk usage not decreasing?
- Cockroachdb: Retrieving cluster info: failed Error: 401 Unauthorized
- using sql regrex_replace to replace every word that starts with a # symbol with mask(word)
- Cannot decommission cockroachdb node
- How to copy a cloud cockroachdb cluster to a local cluster in a docker container
- How do I connect DBeaver to CockroachDB Serverless?
- How do I connect JetBrains DataGrip to CockroachDB Serverless?
- How do I connect Ecto to CockroachDB Serverless?
- Random spikes in usage (CockroachCloud Serverless)
- encapsulating a Drop and Add constraint in a transaction
- Alternative For Stored Procedures In cockroachDB
- Alter the definition of the Stored Computed Column in CockroachCloud
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 # Hahtags
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.