-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transaction/Commit Support #2159
Comments
+1 (#2013) |
Is there no alternative? |
Transactions are already used in PostgresStorageAdapter.js, not sure how sufficient though. |
Hey, what is the current status? Is there any example how to implement transaction/commit? |
@pewh As per my earlier message:
Method |
I think mongodb need it, too |
P.s: I'm newbie, so i don't know if it possible or not |
@pewh I think we need any query or update function support transaction/commit. |
@pewh Let's do it ? |
Is it possible to have transactions with mongo, as mongodb doesn't really support multi document transactions? Optimistic locking would be nice for Object class. Just need a integer type attribute, which gets incremented each time the object is saved. And save will fail if someone else has modified since the last read. This can be consistently implemented across Mongo and Postgres. |
If you need a transactional RDBMS, you should not use MongoDB in the first place, and if you really need transactions, baking it into parse-server may prove painful and inefficient (i.e., you should probably not use parse-server if you intend to have a highly transactional system, I would personally not use it for that).
|
@flovilmart We have an application that is currently based on Parse, but needs the reliability of transactional support. When you say "painful and inefficient", are you referring to high-performance or difficulty in implementation? We're not as concerned with performance as reliability. If it's just performance you are referring to, how much effort do you think it would take to implement transactional logic now that we have switched to Postgres (which is working great)? Do you have anyone you can refer us to? |
We also have an application based on Parse. Recently, it became necessary to use transactions to support a ledger of user loyalty rewards points. We are considering these options:
@flovilmart: If someone were to create a PR to add transaction support using Fawn, would you consider merging it, or is that a feature that you don't want to support period? |
I’m always cautious about integrating 3rd party frameworks. While this is a great idea, stuffing more features into the main repository is perhaps something that will be costly in the long run. If we support transactions for mongo, then we’ll need the same level of support for Postgres. I’m curious of what the REST interface would look like, where it would live, wether we support cross class transactions, wether we force id based identification of the affected documents etc... I’m not against evaluation, as I believe there’s some value in it. If the implementation is just a wrapper upon Fawn, then an adapter design is perhaps more suited. A priori, i’m Not against it as it’s a quite requested feature, i’d Be willing to help with the design of the feature, and discuss the interfaces, and help with SDK client implementations. Is it something that would be only available for the masterKey at first only exposed as a REST endpoint and possible to the JS SDK? What do you think? Is it something you’d willing to invest some time in? |
Thanks for your thoughts. I think an adapter pattern would be best to maintain independence from Fawn or any other specific implementation. I think it should support cross-class transactions. It should be available only for the masterKey at first since I think a significant portion of transactions would modify data related to multiple users. As I'm currently the sole developer (tech co-founder) of a startup with a quickly-approaching MVP deadline, I would only be able to invest time in the feature starting in 6 months or so. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Ok to close this for now, even if it would be great to have this feature. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Not to start this up again, but I thing given the fact that mongo is implementing transactions and that postgres support is fully fleshed should further the argument for transactions. Pretty much any and all applications that want to take themselves seriously and promote data integrity will utilize such a feature. It is crippling parse that there is no current support for this. |
I think you mean: 'To start this up again'. ;). Do you have some ideas on how we might implement? What SDK do you use primarily? |
@flovilmart lays out some good questions for a starting point: |
To begin to answer these questions, let me give my (somewhat) uneducated thoughts. It's no longer required to use any third-party package or integration. MongoDB supports transactions as of 4.0 (I checked, it looks like we are already version compliant for this feature set). Postgres obviously has supported such transactions for a while. As for what the rest interface would look like, I don't know yet. I think that it would be prudent to begin with support on the expressjs side of things, building out the javascript client, as that is likely where most of your users reside. Specific design details have not been well thought out by me - I made this post over 3 years ago, and have not had a look at how parse-server is architected in recent days. I will take a look and work on understanding where this could fit in, but no longer are third-party packages necessary. Feature parity between the two DBs is doable without any additional integration. Another way of phrasing what I am saying, to be clear, is only implementing transaction support on the business-logic side of things. Obviously there is little to no secure use-case for transactions from the client perspective. |
The JS SDK has a |
Excellent idea @davimacedo |
Another good starting point is supporting an atomic update operation including Supporting atomic |
Feature Request
For a while now, parse has lacked transaction/commit support. Due to upcoming Postgres support, transactions should be very easy to implement, and provides a much-needed way to secure many api requests in a row with adequate rollback.
No workarounds presented thus far have been nearly as efficient as ACID transactions. I think that if Parse wants to consider itself a top-tier open source package, it needs to have this feature for database integrity.
The text was updated successfully, but these errors were encountered: