C
C#2y ago
peace

❔ Best architectural design choice?

If I have multiple instances of multiple apps all working to do similar things, and they all need these "accounts" I store in a MySQL database, but only one app can have one of them at a time, and once an app has used one it can't be used again for 30 minutes after being initially used last. What is the best way to implement concurrent thread-safe access? I feel like row or table locking the database via queries would cause a lot of issues?
3 Replies
Zendist
Zendist2y ago
Questions: - Is it just multiple instances of the same app, i.e. a bunch of workers? - Why can't the accounts be used for 30 minutes between each usage? What's the point? - How many accounts are there? - Is this a distributed system, or all running in a single machine?
peace
peaceOP2y ago
1. Multiple instances of multiple apps, all workers just different apps handle different stages. 2. We need to throttle usage to comply with rate limits of a separate API, we usually have a huge bank 1,000+ so we can pick some out, using the oldest first. 3. Maybe 500 - 2,000 accounts 4. Distributed, so it would be over network
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server