I need your help. I think about design of backend API for mobile application. Should it be REST-like or something else?
For example imagine that we create some social network app. There is one page. The page contains:
- User information (some fields from User domain)
- Collection of user messages (not all fields from Message domain)
- Numeric value - count of guests
- Numeric value - count of posts on user wall
I see this options:
Create endpoints for all 4 domains and call 4 requests:
GET /users/111?fields=id,name,email GET /users/111/messages?fields=id,text,date_created GET /users/111/guests/count GET /users/111/posts/count?filter=news
Create one method for getting all this information by one request
GET /GetUserProfileInfo?userId=111
Other options
That do you think? Which variant is better? What about performance? What is the best practice for it?
Thanks.