0

I'm learning about SQL and NoSQL databases in Spring Boot projects. And I have a question about transactions in databases. I know that when you use @Transactional at a method, all the queries from that method are taken as a single transaction and if there is no exception when that method is executed all the changes will be committed to database, otherwise the changes will be rolled back. What I want to know is if that thing is happen only if I use an SQL database? Do they happen in a NoSQL database as well. From what I know ACID is only for SQL databases. Thank you!

@Transactional
public void businessLogic() {
 // create customer resource
 // update customer resource
 // other create/update
}
2

1 Answer 1

1

What I want to know is if that thing is happen only if I use an SQL database?

Yes.

You described the behaviour which is primarily associated with SQL databases, and it does not apply uniformly to all NoSQL databases.

Do they happen in a NoSQL database as well. From what I know ACID is only for SQL databases.

NoSQL databases typically do not support ACID transactions in the same way as SQL databases. If you switch to a NoSQL database, you may need to handle transactions differently. You need to consider the specific transaction support of a particular database.

Not the answer you're looking for? Browse other questions tagged or ask your own question.