Comments (4)
Hi @jeffagostinho,
This means you have a concurrency issue. Such issues are out of scope for EventSauce itself but I can help you deal with them if you like. What kind of service layer does you application have? Do you have service classes or a command handling setup? Additionally, what kind of database are you using?
from eventsauce.
Eae @frankdejonge, all right?
This is real, we have the concurrency problem. I ended up identifying when I ran tests on a microservice that we are developing in PHP Swoole using Hyperf, at first I thought it was some detail of this new way to build PHP apps, but I ran some tests on another microservice in Lumen and noticed that we have the same problem
These Lumen microservices run on infra k8s and we are using MongoDB
Thanks for helping
from eventsauce.
I didn't understand the first sentence. What does eae
mean?
For concurrency problems you need some kind of concurrency control. Normally in SQL databases you can do a couple of things, like forcing a row lock using SELECT x FOR UPDATE or the GET_LOCK/RELEASE_LOCK functions. You can also use a general purpose mutex on a shared piece of infra like a redlock. The "problem" with the redlock is that your operation could exceed the lock time for long background jobs.
I'm not overly familiar with MongoDB, but from what I remember it does not have locking capabilities that allow you to explicitly lock documents like SQL databases do. So in your case, probably best to implement a general purpose mutex. When you have this in place, you can decorate your service layer or command bus with the locking mechanism to prevent concurrent access to the underlying document.
from eventsauce.
Sorry @frankdejonge, eae
would be hey
kkk
I understand what you said, I will research more about it. Thank you very much for your availability and congratulations on the project
from eventsauce.
Related Issues (20)
- Message::withHeader() no longer allows array value HOT 2
- Isn't replaying domain message events by default slow as hell HOT 15
- Examples of persisting snapshots to a database HOT 2
- Aggregate root HOT 3
- Projections
- Structure table
- Suggest snapshotting change HOT 2
- AggregateRootBehaviour should have a template on AggregateRootId HOT 3
- Use lambdas insterad of command objects? HOT 4
- DefaultHeadersDecorator order parameters deprecated HOT 6
- Move all tests to separate folder tests HOT 2
- Reconstituting a specific version HOT 8
- Missing "id" reference in docs HOT 1
- DoctrineOutboxRepository reserved words escaping HOT 1
- Type mismatched... Expected `AggregateRootId` found `AggregateRootIdType` HOT 1
- Storing messages in MongoDB HOT 2
- Help needed... Preconditions are not working in test scenarios HOT 2
- Your inputs on this would be very helpful
- PayloadSerializerSupportingObjectMapperAndSerializablePayload does not work recursively
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eventsauce.