Altinn / altinn-studio

Next generation open source Altinn platform and applications.
https://docs.altinn.studio
BSD 3-Clause "New" or "Revised" License
115 stars 70 forks source link

Implement Lock for POST and PUT endpoint within the Designer Backend #12508

Open framitdavid opened 8 months ago

framitdavid commented 8 months ago

We need to implement support for locking files that create or manipulate files. This is to avoid multiple endpoints working on the same files simultaneously.

Note: Can we implement our own locking mechanism initially without considering whether the locking is local or distributed? So we can add distributed caching in the next step once we figure out where to store the distributed cache?

### Tasks
- [ ] https://github.com/Altinn/altinn-studio/issues/12509
- [ ] https://github.com/Altinn/altinn-studio/issues/12510
- [ ] https://github.com/Altinn/altinn-studio/issues/12498
- [ ] https://github.com/Altinn/altinn-studio/issues/12536
mirkoSekulic commented 7 months ago

Since we already using a posgress database we can use advisory locks to create our distributed locking mechanism implementation.

mirkoSekulic commented 1 month ago

Currently not being able to scale Designer is a fundamental issue in our solution. I suggest adding this to sprint 51 or 52.

We can start with creating abstractions and implementations both for Postgres (distributed) and in-memory (non-distributed) and see how it behaves.

@nkylstad @framitdavid