4 ms·
> actually need a middle layer to carry out operations on the data before it is presented. I'm of the school that says you should fetch the data you want becau
by justintocci 11y ago
> actually need a middle layer to carry out operations on the data before it is presented.
I'm of the school that says you should fetch the data you want because the database is optimized for data operations. can you give me an example of a data operation that's best done in middleware?
- jqm 11y agoJust about anything in which the SQL is considerably more complex or a lot longer than then the corresponding middleware code. Just about anything in which the SQL query is considerably more difficult to debug or get intermediate verification than in the corresponding code. SQL does many things well. So far, it doesn't do everything as well as middleware code. It isn't as easy to use for every use case as middleware code. Long complex SQL queries are a nightmare to unravel. Middleware code can more easily (in my experience) be broken up into smaller steps that can be manipulated and tested independently.
- justintocci 11y agoPostgis is an example of a very extensive code base in Postgres. I've listed a bunch of apps that Envelope is great for. You haven't given me an example of what you are talking about so I can't really respond to your comments.