27. Multifetch endpoints
Suppose you have an API
- GET api/users, api/users/:id
- GET api/customers, api/customers:id
- GET api/countries etc
GET api/fetch?users=api/users&customer=api/customers/23&countries=api/countries
should return {“users”: [..], “customer”: {..}, “countries”: [..] }
35. Conclusion:
- Streams save your memory
- Streams speed up data transfer
- Streams are not blocking your main thread
- Use streams every time you are working with data