How to create a server database for my application

I am new to server side programming with background in iOS. So I want to know where to start.

Here I tried to list some specific questions:

  • Can I just create a local database and work on it?
  • Do local databases and databases on a remote server work the same?
  • If not, how can I choose which server I can use? (I looked at the AWS cloud service web pages and found they were really overwhelming.)
+3


source to share


3 answers


Arslan's answer is great, but I would like to add a little to it. You mentioned Chatroom, so in this case you should look into socket programming

. The reason I am explaining this, until no one has said it, is not to create a chat server by reading / writing to the database. It's much better to just keep in memory and enter the database as needed.

AWS is a fantastic solution and they have many different solutions for different situations. You should look at using EC2, which is their server program. They have a free tier for you to use and / or test locally. I suggest testing locally and then clicking on the free level each time to make sure everything is working correctly.

Also I would consider using CloudKit to store the database. If you don't need instant connectivity, it's much easier to use Apple's built-in system rather than setting up and managing a server.



links: CloudKit , AWS EC2 Free Tier

The way it is, I am actually working on the ChatRoom Server program, here's a link to github . It's written in C++

, so I recommend using it as a reference unless you want to write your own socket in C++

.

+2


source


Can I just create a local database and work on it?

Sure. You can install the server locally on your computer (there are many available), and through "localhost: 3000" or "localhost" you can access the root of your server depending on what you are using on the server. Then you can configure the server to respond to a specific message.

Do local databases and databases on a remote server work the same?



Of course, their work is almost the same. The difference you stated yourself: remote .

If not, how can I choose which server I can use? (I looked at the AWS cloud service web pages and found they were really overwhelming.)

I suggest you start with a local server. But first you need to choose a language: PHP, Ruby, Python - it depends on you and your personal preference. You can also use something like Parse.com . Parse.com is free up to 30 requests per second, and you can use Objective-C to send and receive data from the server in a few very easy steps. And of course parse.com handles the singing and user registration for you, you only need to write a few lines of code in the iOS app.

+2


source


Download Apple's free Server.app from the Appstore, it wraps one of the best database management systems: PostgreSQL. Start it with this terminal command:

sudo serveradmin start postgres

      

More information on these pages:

http://support.apple.com/kb/HT5583

http://www.postgresql.org

0


source







All Articles