We are building order processing system. We have a cluster of processing servers. We need to assign readable numbers to the orders (e.g. ORD-000001, ORD-000002).
Main problem that this is hard for us to implement system wide lock. I am thinking about schemas with lock expiration. But everything comes in mind still have bottlenecks.
We are approaching DDD, so direct access to database is hard. We are using NHibernate. And we use UnitOfWork.
Pls, help with some ideas. Every idea will be valuable. Any links to something to read on topic?
UPDATE: I want to stress, that I need sequential numbers. And so cannot use hi/low algorithms. At this time I am ivestigating scenario when
- I assign "probably good number";
- Push it to database;
- If fail, try to assign another "probably good number";
- If success, commit;
But I cannot find goot technology for it.