user8781988
user8781988

Reputation: 1

Server for app and website

I am a begginer when it gets to back-end development.

I already have a front and website (html cuss javascript) and I am considering to make an app version of my website.

My website is a multi category blog.

I had a problem of understanding how can I connect a server to my website AND my native app. I know basics of php.

I read articles and q/as , all I could understand is that mobile apps and website use seperate server.

        Web server      and     application server

-- -- is there a way to make a server for both, or is it better to use seperate servers?

-- -- if I use seperate servers for seperate platforms how do I make them show same content without changing it on both servers ( one database for two?)

-- --I heard about a system of creating a main database and a copy of it . Then I sync the copy to the main. How do I do that.

-- -- are there any doc's I can read on this subjects: 1) server for all platforms (browser,ios app, android app) 2)databse system for seperate servers

Upvotes: 0

Views: 63

Answers (1)

Jude Fernandes
Jude Fernandes

Reputation: 7527

From my general experience and the most basic solution, you have a single server in the backend which houses the database as well as the code required to fetch data from the database and supply it.

For example assume that you wrote a function called fetch all users that fetches users from the db and gives back a list of users as its results.

Now irrespective of which platform you are on, you would be able to call that function fetch users and get the data back, if you're on a mobile app, you would need to make an http request to that function, if you're on the web ie, front end you would be making an ajax request. So yes all your code is in one place in the backend. You do not need to make 2 servers for 2 different platforms.

P.S. when you code for the backend use a framework.

Upvotes: 1

Related Questions