r/DatabaseHelp • u/itsdeandre • Mar 23 '18
Basic DB question 2: The API
Database question part 2 -- The API
So earlier in the week I asked a question and u/wolf2600 answered it perfectly. I think I've finally finished building my very basic 'hello world' level database. I've hit another snag. This time google, documentation, or stackoverflow don't seem to have any tips or explanations. It's just install this and congratulations.
I've tried this one, this one, and this. My new question this time is what am I doing wrong? Should I try and code my own API? I've seen examples where people have their applications talk to the api which talks to the database and then the api gives you a JSON blob back. That's where I want to be. Manipulating JSON is something I know really well and can make it work in Xamarin. It's just getting there.
What do you think I should do? Do you have any solutions you have tried and worked?
View all comments
Show parent comment
1
u/chrwei Mar 25 '18
I agree, for public endpoints BUILD an API, don't use a generic db proxying API. that was my main point.
you need to validate that the app requests make sense for your data model. you should also minimize what's requested and what's returned. you'd have one API handler that gets all user details and preferences in one request and one response, where with the generic DB api you might have to make a request for the user, and more requests for each pref, which would be very inefficient.