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
-1 votes
0 answers
37 views

my technique for storing edits could use suggestions

I've developed a bootstrap webapp that allows add/edit/delete of a group of related data elements. It's the intent to allow the user to save changes but I don't want to commit them to the database ...
user avatar
-2 votes
2 answers
75 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 ...
user avatar
-1 votes
2 answers
82 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 ...
user avatar
  • 15
-1 votes
1 answer
75 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 ...
user avatar
  • 1,183
0 votes
1 answer
65 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 ...
user avatar
  • 183
1 vote
1 answer
105 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 = ...
user avatar
1 vote
1 answer
33 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 ...
user avatar
7 votes
4 answers
430 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 ...
user avatar
4 votes
2 answers
1k 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 ...
user avatar
  • 379
3 votes
3 answers
447 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" ...
user avatar
  • 5,281
1 vote
1 answer
148 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)....
user avatar
  • 5,281
1 vote
3 answers
735 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 /...
user avatar
0 votes
1 answer
51 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 ...
user avatar
  • 357
0 votes
1 answer
78 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 ...
user avatar
3 votes
3 answers
139 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 ...
user avatar
2 votes
1 answer
1k 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 ...
user avatar
  • 427
4 votes
2 answers
2k 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 ...
user avatar
  • 311
7 votes
2 answers
2k 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 ...
user avatar
  • 1,080
-4 votes
2 answers
199 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 ...
user avatar
  • 5,281
0 votes
1 answer
230 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 ...
user avatar
  • 11
1 vote
1 answer
30 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 ...
user avatar
1 vote
0 answers
133 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 ...
user avatar
  • 427
0 votes
1 answer
807 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 ...
user avatar
  • 291
0 votes
1 answer
171 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 ...
user avatar
3 votes
1 answer
225 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 ...
user avatar
  • 139
1 vote
2 answers
119 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 ...
user avatar
2 votes
2 answers
616 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 ...
user avatar
  • 427
1 vote
1 answer
176 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/...
user avatar
0 votes
1 answer
536 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: ...
user avatar
2 votes
1 answer
483 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 ...
user avatar
  • 131
2 votes
1 answer
63 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 ...
user avatar
2 votes
2 answers
1k 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. ...
user avatar
10 votes
4 answers
4k 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 ...
user avatar
0 votes
1 answer
717 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 ...
user avatar
  • 103
5 votes
1 answer
311 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 ...
user avatar
4 votes
3 answers
1k 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 ...
user avatar
  • 2,704
1 vote
1 answer
85 views

Is it ok to have transaction at Presentation level?

Let's assume that I have an Order object that has a List<OrderItem> , the user goes to page and creates his order, now I should save his selection to the database, I have two data service ...
user avatar
  • 359
0 votes
2 answers
459 views

Optimistic locking with business constraints [closed]

Consider this simple example: Tables (in a restaurant) can be booked for a period. Business constraint: No two table bookings for the same table may overlap in time. How might one prevent business ...
user avatar
  • 123
1 vote
2 answers
3k views

Web API : Centralize business transaction logic : Good Idea?

We develop on a ASP.NET Web API where we use the "Unit Of Work / Repository" pattern : Our Controllers looks like that : public class MyController : Controller { private IUnitOfWork _unitOfWork; ...
user avatar
  • 173
2 votes
1 answer
440 views

System design: transactional inserts at application level

I have a system which hits a API on daily basis and collects data. This data is divided into logical groups, with a logical group defined as all data belonging to a particular user. A user has 30 ...
user avatar
  • 193
3 votes
2 answers
97 views

Guaranteeing transactions with multiple Listeners

Recently my team has inherited a code-base with an interesting problem. The system keeps historical records by having multiple listeners on the same event. These listeners execute serially, so if we ...
user avatar
  • 141
1 vote
0 answers
49 views

idempotency and store with notify

I would like to ask what is a prefered way when you have such a code, (this is distributed transaction since I cannot delete the item and publishToKafka atomically), and I don't want to have event ...
user avatar
2 votes
0 answers
416 views

Distributed transactions and recovery with stateless microservices

I suppose I have the following use case: I want a synchronous service if possible (in case of machine crash I want to finish it in background, by some other node) I want to save something in my ...
user avatar
1 vote
3 answers
3k views

How to handle parallel requests, different response time and atomicity of transactions

I have a table of data and I can create , update and delete rows. I have apis to do these operations. The following steps happen I create a row and send a create request to server. I update some ...
user avatar
7 votes
2 answers
583 views

Information sharing in event-based systems

I'm developing a software system, which provides HTTP REST API, and I want to achieve a very modular and flexible design. So, there is a core functionality and feature modules, which handle only the ...
user avatar
1 vote
1 answer
95 views

Transaction with web services

I am wondering how transactions with web services are achieved. Let's take an online store for example that needs to deal with 3 services: Inventory management SaaS Delivery management Saas Payment ...
user avatar
  • 119
-3 votes
2 answers
158 views

How to deal with small frequent transactions

I have been given the task to create a system in which users can buy intellectual property (broadly categorized, hard to explain what they are really buying) from the system and can transfer funds ...
user avatar
  • 2,154
4 votes
2 answers
2k views

TransactionScope in business or data/repository class?

What is the best place to use TransactionScope class? Is it in the business logic or data/repository classes? Example if used in business logic class: using (var scope = new TransactionScope()) { ...
user avatar
1 vote
1 answer
509 views

Does separating Domain model and Persistence model have impact on transactional aspect?

In this post, there is: For example, with your own persistence model, you are not able to benefit from the built-in change tracking functionality. And that means you will not be able to ...
user avatar
  • 3,758
6 votes
1 answer
1k views

How can I avoid a cross aggregate transaction?

Consider this simplified example: In an online ticket sale website, tickets have variable prices that change over time. User searches for tickets. Once he finds a ticket he wants, clicks "Buy" and ...
user avatar