Fork me on GitHub
#architecture
<
2019-07-25
>
abdullahibra10:07:27

is adding validation layer between rest API and storage layer good?

abdullahibra10:07:22

so this simple architecture for restful service should be 3 layers: 1- rest APIs which has the business logic and full control 2- validation layer which is another layer to ask about the input and output data 3- storage layer

abdullahibra10:07:39

so the flow should be: 1. input should hit the rest API layer 2. rest API layer should ask validation layer 3. if validation layer success then ingest the data, else return error

abdullahibra10:07:06

4. if ingesting of data success return success, else return error and roll down.

seancorfield11:07:49

This is the sort of thing we use clojure.spec for. So I wouldn't say it's another layer but it is very structured and we have some macros to reduce boilerplate.

👍 4