Web Service, Admin Interface, different applications or same application?

I know this question doesn't technically have a 'right' answer, but I'm hoping to get some input on what would be considered best practice.

Lately I'm building a lot of Web Services that are to be used by mobile applications, most of which also require a web interface to be able to manage the data.

I've been building the admin interface and api as part of one PHP application, whereby both the API and the admin interface have direct access to the SQL database.

I'm wondering if separating them and having the admin interface talk to the API, and only the API talk to the database is a more appropriate way of doing things?

Any suggestions or advice would be appreciated.
SheppardDigitalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kanti PrasadCommented:
Hi

Good practice is Admin interface to API to DB as it will
           Reduce  tight(er) coupling.
           you can change\replace  technologies\ API's  easily.
           Loose coupled code will help protect you better from attacks

     Split your code as below
            Presentation logic - the user interface (UI) which displays data to the user and accepts input from the user.
            Business logic - handles data validation, business rules and task-specific behaviour.
            Data Access logic - communicates with the database by constructing SQL queries and executing them via the relevant API.

The below link will help you understand the layer split better
http://www.tonymarston.net/php-mysql/3-tier-architecture.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SheppardDigitalAuthor Commented:
Thank you for the link, very informative and just what I was looking for.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Services

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.