Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [transaction]

Questions about maintaining consistency between a set of related operations, in a way that either all succeed, or the state of the system remains unchanged.

Filter by
Sorted by
Tagged with
2 votes
1 answer
231 views

Problem with data consistency in Microservice architecture(2pc transaction) when external dependency envolved

I have microservice architecture. I implement a distributed transaction flow (2-phase commit), kafka, and 1 coordinator service. So, my problem is in each step of preparation I am calling an outside ...
babak abadkheir's user avatar
1 vote
1 answer
92 views

Handling Distributed Transactions with CompletableFuture in Spring

I'm looking for an opinion about an approach for dealing with distributed transactions. In a Spring Boot program, how can I implement the following business process without sacrificing to code ...
hjoly's user avatar
  • 21
2 votes
1 answer
127 views

Handling Back-dated Transactions and "Online" Transactions on ERP/Banking Systems

I was currently developing a PoC of a "core banking system" in my current company, a pawn shop that generally offers lending services to retail customer and deposit services. We've built a ...
jeremy__'s user avatar
0 votes
0 answers
40 views

Looking for patterns for instantaneous data consistency for DB transactions that span multiple schemas in a Aurora postgres instance

We are currently developing a product in the AWS environment that requires instantaneous data consistency for DB transactions that span multiple schemas in a Aurora postgres instance. Each schema will ...
Jeff Prisco's user avatar
2 votes
2 answers
195 views

When should I be worried of Time of check time of use vulnerabilities during database queries?

I am having difficulties on understanding when I should be worried about TOCTOU vulnerabilities and how to avoid them because yes, we can use database transactions but there are different level of ...
Alessandro's user avatar
0 votes
4 answers
199 views

How to handle a scenario where server fails to respond in time with some arbitrary response, but later the transaction is processed?

Client sends request to deduct his account balance for registering with a service. balance=balance-fee Server takes a lot of time to process the request. Since server was taking lot of time, client ...
tuck_y's user avatar
  • 181
1 vote
1 answer
166 views

Reserving Unique, Sequential Group Numbers in ASP.NET Core with EF Core and GraphQL

I am developing an API backend using ASP.NET Core Minimal API (.NET 7) with Entity Framework Core, HotChocolate (for GraphQL), and a Microsoft SQL Server database. I've encountered a specific ...
bealtis's user avatar
  • 19
3 votes
1 answer
142 views

Should I use transactions in this scenario?

I am writing a API endpoint in NodeJs, The code is roughly like this: function myApi(myUserId, userIdToDelete){ if ( checkIfIAmAdmin(myUserId) ) { deleteUser(userIdToDelete); } } Now,...
Alessandro's user avatar
2 votes
1 answer
230 views

two diffrent database in unit of work

I will explain my problem in the form of an example. Suppose we want to use both databases in a transaction. Data is edited in database 1 (for example, Postgres) and then added to database 2. Finally, ...
Amir Hosein's user avatar
1 vote
1 answer
110 views

Moving Transaction Logic to Middle Layer: Pros and Cons

We have an event booking system that allows patrons to add themselves to a waiting list if an event is fully booked. When somebody cancels, the system moves the first person from the waitlist into a ...
Anatol5's user avatar
  • 13
2 votes
1 answer
2k views

Clean Architecture Use Case and db transactions/unit of work

I've started working on a LoB application (as a learning exercise) while trying to express business logic with use cases from Clean Architecture. First use case is customer onboarding where client can ...
milan's user avatar
  • 21
5 votes
3 answers
965 views

Group set of commands as atomic transactions (C++)

We're designing the architecture of an embedded device (esp32). One of the tasks is that the device should connect to the internet and use a preprovisioned redeem code to register itself with our web ...
glades's user avatar
  • 419
2 votes
1 answer
2k views

Build a Rust project using Clean architecture and DB transactions in the same DDD bounded context

This is just an example of an (still incomplete) real-world project written in Rust using a clean architecture: https://github.com/frederikhors/rust-clean-architecture-with-db-transactions. Goals My ...
Fred Hors's user avatar
  • 139
1 vote
2 answers
167 views

Strategies to abstract away technical details when dealing with transactions

I like programming in such a way that every component/injectable of the applications I build, has a clearly defined scope, and it's easily tested. With years working as a Developer I've come to ensure ...
caeus's user avatar
  • 129
1 vote
2 answers
58 views

adding optional code for bad protocol state check

I've got a GRPC API that I'm designing. It includes an RPC method that requires the caller follow-up with another API call. Some pseudo-code a client might write: val apiInstsance = makeAPIInstance() ...
Groostav's user avatar
  • 257
0 votes
2 answers
396 views

How to model transactions in a client-side functional DDD?

I'm new to DDD and I would like to clarify some concepts. I'm thinking about DDD in the client-side. The first one is regarding transactions: My understanding is that transactions are a responsibility ...
João Otero's user avatar
-1 votes
2 answers
307 views

Transactional and eventual consistency together -- which operations MUST be transactionally consistent?

I find a lot of resources regarding strong consistency versus eventual consistency, and when to choose one or the other. I'm wondering how and when you would have both together. Consider this specific ...
AleksG's user avatar
  • 115
-1 votes
1 answer
94 views

How to black-box test transaction atomicity?

Suppose we need to ensure that a sequence of database operations - currently implemented as A followed by B followed by C - executes either all together, or not at all. We can achieve this using a ...
Robin Green's user avatar
  • 1,273
0 votes
1 answer
599 views

Domain Driven Design one change per transaction

Why do they always say you can only change one aggregate per transaction? Decoupling? Is it a rule you can break or is it more of a strict thing? Does it also matter if we are in a monolith vs ...
Jesse's user avatar
  • 193
2 votes
1 answer
2k views

Implementing transactional entity lockouts with Spring and JPA

Spring Boot/Java 8/MySQL here. I have a widgets table in my MySQL DB that is modeled by a JPA entity like so: @Entity @Table(name = "widgets") @Data public class Widget { @Column(name = ...
hotmeatballsoup's user avatar
1 vote
1 answer
38 views

Failed uploads layer

I am trying to find an optimal way to handle the following scenario: I have an application where there are a lot of file uploads on a certain endpoint, but the validation is rather strict as per the ...
Daniel Pop's user avatar
8 votes
4 answers
729 views

DB transactions necessity

I have recently come across a concept of transactions. Seems like they are a crucial feature for production applications, yet I have never heard about them except once in a university. I can't ...
Petro Ivanenko's user avatar
4 votes
2 answers
6k views

Alternative To Generic Methods where Type is known at runtime

I've written a class that synchronizes a table between two databases using Dapper. The public and private Methods in the class are generic and the generic parameter is the POCO class that is being ...
GisMofx's user avatar
  • 379
4 votes
3 answers
1k views

Do critical section and atomicity imply each other?

Is it correct that In concurrent programming, a critical section is a sequence of statements which can't be executed by more than one processes/threads at the same time. Atomicity (as "A" ...
Tim's user avatar
  • 5,485
1 vote
1 answer
279 views

Does a transaction have the effect of a critical section?

A transaction has ACID properties, where "I" stands for isolation: Transactions are often executed concurrently (e.g., multiple transactions reading and writing to a table at the same time)....
Tim's user avatar
  • 5,485
1 vote
3 answers
2k views

How to keep front-end models in sync with REST API/DB without any UI delay?

Here's my problem. I want to make fast, subsequent requests to a REST API endpoint (/todos/:id/position) that have side effects on other resources. As an example of 5 fast subsequent requests: PATCH /...
Maxime Dupré's user avatar
0 votes
1 answer
88 views

Distributed processing of a large number of queues

I have a rather basic application hosted on Kubernetes, which connects to a Mongo database. The app has a wallet feature. A user can put money in their wallet using real-world payments (e.g. via ...
Avius's user avatar
  • 397
0 votes
1 answer
132 views

Microservice Two-Phase Commit: Transaction coordinator is down in the middle of process

I've just read this article, about handling distributed transactions in the microservices world. In the article, the author explained two possible solutions available. I'm familiar with SAGA. But ...
novalagung's user avatar
3 votes
3 answers
317 views

What is the best way to model transactional system with a need to read holding/balance?

I have a data model that is similar to the bank transactions. Simplified version looks like this: 01.01 +1000 01.02 -300 So I will have all the transactions stored in the database. Users will of ...
Ilya Chernomordik's user avatar
4 votes
1 answer
3k views

When to publish domain events when handling transactions in the application service

This is something that has been bothering me for quite some time, I tried different approaches over the past year but I always come back to reflect on this, so I'll throw myself out here ! So, first ...
TanguyB's user avatar
  • 467
5 votes
2 answers
3k views

Alternatives to distributed transactions in .NET?

Lately, I've been working on a project which basically is a huge rewrite in .NET Core F# + Event Sourcing + PostgreSQL of an old sub-ledger legacy app written in .NET 4.6 C# + SQL Server. Since the ...
Natalie Perret's user avatar
8 votes
2 answers
3k views

Are bank transactions run with DB transactions?

The classic example for a transaction is withdrawing money from a savings account and depositing it to a checking account in the same bank. Yet I have the suspicion that DB transactions are actually ...
Joshua Fox's user avatar
  • 1,100
-4 votes
2 answers
314 views

What are distributed transactions supposed to satisfy?

I am lost when reading Design Data Intensive Applications. In a nondistributed database system, nondistributed transactions are to satisfy ACID. In a distributed data store, what are distributed ...
Tim's user avatar
  • 5,485
0 votes
1 answer
358 views

Is event-sourcing and event-driven design works in scalable architecture for a wallet?

considering you need to design a simple wallet service that keep tracks of transactions, and give balance for each account. I started designing the solution using event-driven architecture, so every ...
Masoud's user avatar
  • 11
1 vote
1 answer
48 views

Transaction management on mobile applications

While there are prescribed methodologies for the middle layer when it comes to transaction management like Saga pattern etc. I want to know what's the advice on handling such on a mobile application ...
AppDeveloper's user avatar
1 vote
0 answers
323 views

Commiting transaction in the repository instead of the application service

After quite some time thinking about it, and testing both methods, I'm really struggling with choosing the right manner to commit my transactions. To shape the context, we are in the context of ...
TanguyB's user avatar
  • 467
0 votes
1 answer
2k views

Best way to prevent duplicate payment of order in multi user environment?

I have an application in which users can create an order and payonline using stripe.js When the order is created it's status is set to unpaid. The user then has the option to review the order on a ...
adam78's user avatar
  • 291
0 votes
1 answer
174 views

Seperation of concerns: Submitting a form to create an email, store it and send it

Context I have a workflow that has an email form. The requirements are the following: A user completes the form that contains email fields and submits it. If everything goes well then an email model ...
Andreas Andreou's user avatar
3 votes
1 answer
277 views

What is the typical best practice methodology around transferring money between two distinct systems?

I got this question on an interview the other day and was clueless to what the best practices are for solving it. It's the issue where you have to transfer money between two systems and want to avoid ...
Dave's user avatar
  • 139
1 vote
2 answers
174 views

Should transaction id's skip?

In my application, the transaction id's sometimes skip i.e. 3314, 3315, 3317 ... I think this happens when a payment is made, but mysql rolls back the transaction because of an error down the line. I ...
Emmanuel's user avatar
  • 121
2 votes
2 answers
772 views

CQRS and Transactional Event Sourcing, problem while recreating Read DB

I'll first explain the context of my problem. The backend of my current project is using DDD, CQRS and Event Sourcing as a stack (the read DB being a MongoDB, my write DB being an event store). At ...
TanguyB's user avatar
  • 467
1 vote
1 answer
243 views

Avoidance of Lost Update in DB2 for z/OS

I have a question concerning the "Uncommitted Read" Isolation Level under DB2 DBMS for z/OS. In this article https://www.ibm.com/support/knowledgecenter/en/SSEPEK_11.0.0/perf/src/tpc/...
Monty Burns's user avatar
0 votes
1 answer
968 views

Efficiently processing millions of records every minute

I am trying to improve the architecture of a system where data flows between 3 systems. Every minute, there are thousands of items generated on App 1, which are sent to Midpoint in the following way: ...
DemCodeLines's user avatar
2 votes
1 answer
1k views

DDD: Re-assign an entity from one aggregate to other

Let's pretend I have an 'Book' entity, that can contain many 'Chapter' entities, having both their own unique IDs. A chapter must belong to a book, it cannot exists on its own (ie: there is a required ...
Vlad's user avatar
  • 131
2 votes
1 answer
69 views

Is there some solutions that enable to perfrom sub transactions on business model?

My question is in the header. I would like to know is there architectural solution that enables to perform nested transactions on the business model. Let me to explain - the standard flow for web ...
Oleksandr Papchenko's user avatar
3 votes
2 answers
2k views

How are transactions on ATMs and their banks typically synchronized?

There are points of failure: ATM gives money then send a deduction request to it's bank. What happens, if the request will fail? the user got the money but his account hasn't been deducted - fail. ...
arminvanbuuren's user avatar
12 votes
4 answers
6k views

How to handle transactional operations in an event-driven architecture?

I'm trying to flesh out an eCommerce system using microservices (.NET Core and Kubernetes), event sourcing (Kafka), and CQRS. The particular use case I've been thinking about is as follows. There is ...
Ray Saltrelli's user avatar
0 votes
1 answer
887 views

Dealing with eventual consistency when persisting and publishing events

Currently working on a DDD application that is using event sourcing with redis as my main persistence store. So unfortunately I do not have built in rollbacks should something fail. The application is ...
Josh L's user avatar
  • 103
5 votes
1 answer
344 views

Achieving scalability and ACID with a RDBMS to NoSQL streaming solution

My understanding is that the main feature Cassandra has to offer is linear performance at any scale; meaning that if I know 1 C* node can handle 500 queries or commands per second from my app, then I ...
hotmeatballsoup's user avatar
7 votes
3 answers
3k views

DDD: deciding when to lean towards eventual vs transactional consistency

I am reading Vaughn Vernon's series of articles about effective aggregate design. On the subject of deciding between transactional vs eventual consistency, it states the following: Discussing this ...
blubb's user avatar
  • 2,764