architecture

abdullahibra 2019-07-25T10:30:28.000600Z

Hello guys

abdullahibra 2019-07-25T10:31:27.001700Z

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

abdullahibra 2019-07-25T10:33:22.003900Z

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

abdullahibra 2019-07-25T10:34:39.005300Z

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

abdullahibra 2019-07-25T10:35:06.005900Z

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

seancorfield 2019-07-25T11:29:49.008500Z

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.

👍 1