Unique limitation in RESTFul architecture

Thanks to 15 years of experience in developing a client-server state (and its inherent problems), I'm still trying to understand the concept of statelessness in the RestFul architecture.

Suppose I have a common interface for sending business objects to my REST service. For example, user resources. My user resource must have a limit on the uniqueness of its email address. My initial reaction was to use the underlying databases for garantuee. The second reaction would be to introduce some kind of locking or transaction mechanism.

But my restoration college answers: "No!" The client must check whether the email is unique for the new user, and you just have to accept the fact that there is a small time window into which the duplicated email address can be inserted. The client application must be able to deal with this conflict.

This, in turn, contradicts everything that I have learned, and generally do not feel natural. Please enlighten me ...

+5
source share
2 answers

I see no reason not to return the corresponding HTTP code : 409 Conflict. This can be returned if errors are received from your database.

, , ( ), . - .

+13

. , , (http://en.wikipedia.org/wiki/Stateless_protocol).

- , . , ( ), , . , POSTing , , , . , , POST , POST - . , , POST ( HTTP, , , ).

: "", , , .

+3

All Articles