Developing backend Webservice and Database for iPhone App for Standalone person - iphone

I want to develop my iPhone app but I am not sure what could be the options I have for hosting database and webservice to communicate with my iPhone App. Could someone please suggest me what could be the best way to go for this?
I know how to build everything but never come across this situation. I have been working in environment where we ask Admin to give us Server where we host everything but if I want to do it myself and don't have server infrastructure what could be the options do I have? Do I need to purchase from web hosting provider?
Thanks.

From my experience, I've developed back-end part for iPad client. It was REST, ASP.NET Web API (WCF Web API) and as database on back-end MS SQL Server and MySQL.
Anyway for mobile clients you can freely use REST. It can be ASP.NET Web API from .NET or other libraries that help to make REST services for example from Java.
REST is good consumed by mobile client applications. And then from client application perspective, it's no matter what database back-end will have.
Speaking about hosting it also depends from requirements to back-end. When you have no server infrastructure, you can use cloud PaaS like Amazon AWS (EC2) for example. Or host server it by yourslef.

Related

Hosting REST api in web server or application server

I would like to know if there is any difference in hosting REST web service APIs in a web server or application server, is there any reason one is preferred over the other?
So i think you are confused about what are application servers and web servers.
Application Server is the name of a machine/server which is running any application used by an organization and it depends of any other servers to run the application functionalities correctly, like Database Servers, Caching Servers and other kind of servers.
Web server is a software which puts an application online for being accessed by clients through the web.
An application server commonly has a web server running inside it, as part of a stack needed to run the application in the server, like libraries and other sofwares need to execute the application objective.
So you can run a REST api inside of an application server with help of the web server application.
Some examples of web servers are Apache, Nginx, LightHttpd, etc.

Standalone ServiceStack service for Web & Native Mobile App

Our architecture consists of several backend (non-ServiceStack) services and applications that send data to our system via ServiceStack service hosted in asp.net - this is currently a standalone ServiceProject project containing our required Services/Repository/DTOs following the structure of all the provided ServiceStack samples.
With our backend complete we're now designing our two front-end requirements consisting of a web application and native mobile application. For the web application I'd really like to continue leveraging ServiceStack by using the Razor plugin to create the application's layout/views from our existing DTOs, for our mobile app we will only rely on the ServiceStack service for authentication and data - as it is native it's layout/views will come from it's own SDK.
Can I leave my standalone ServiceStack service as is and:
Create a separate web application project that authenticates
against our existing standalone ServiceStack service and uses the
Razor view plugin?
Have our native mobile app clients
authenticate against the same standalone ServiceStack service?
Most of the examples ie. RazorRockstars I've seen have the services embedded in the web project so I'm not sure if this distributed type of setup is supported. Any guidance or feedback on this is greatly appreciated!
It is very much possible. You can consume the web service from both, web and native mobile application. I worked in a ASP.NET MVC web application which used to make call to Web API service hosted at different server. The Web API service was shared among multiple applications. We were consuming it by making AJAX calls from client.
Something similar to your scenario is done at below link but they are using cloud to host service:
http://www.codeproject.com/Articles/529109/Mobile-2fWebplusClient-2cplusWebplusAPIplusandplus
If you have opportunity to make a web app for mobile instead of native app, then in a single solution both mobile and desktop app can be created. The exemplary solution can be found here: http://nopcommerce.codeplex.com/
Thanks and free free to discuss more in case of further questions.

Do we need dedicated webservers or can we simply use modern application servers?

I am planning to design an application which will require both web server and application server (Java EE based). Modern application servers like Weblogic, Websphere, JBOSS can provide support for both application server and web server. However I have seen many applications where the deployment architecture provides a segregation of web server and application server as a separate entity.
I would like to know:
What is the architectural benefit of segregating the web server and app server as a separate entity?
e.g. Assuming we are going to use weblogic as a web sever and app server do you think if there is any concern for large applications?
There is several resons to use a dedicated web server for static content:
In most case a web server is already present infront of the application server (reverce proxy), it is needed if the app server is clustered. So as it is already present.
If the static content is important (size and trafic), puting it in web server allow to scall the content and the application separeatly.
Historicly pure Java app server was slower that native web server, now NIO allow the same access to system call sending file directly to a socket without going back and forward between system and user mode.
So I think you should start with the contend delivered by the app server and complexify the system if it help you to solve issues you actualy enconter.

Common web service for asp.net, iPhone and Android

What are the necessary points that we should keep in mind while developing web service .NET that can be accessed by ASP.NET and mobile phones like iPhone and Android?
Web services by design are platform agnostic, which means that you should be able to access them from any application. However depending upon the relevant framework options available different implementations might be easier to access that others (XML/SOAP via .NET as an example).
Building a REST service serving up JSON could be your best option for an easy adoption on multiple platforms.
REST vs SOAP
Web Services
1.It Can be accessed only over HTTP
2.It works in stateless environment
WCF
WCF is flexible because its services can be hosted in different types of applications. The following lists several common scenarios for hosting WCF services:
IIS
WAS
Self-hosting
Managed Windows Service
For mobile application check http://www.c-sharpcorner.com/UploadFile/sry_143/4010/
For ASP.Net application check http://geekswithblogs.net/nestor/articles/108042.aspx
Happy coding!!

Preferred database management system for Objective-C (iPhone apps)

What would you say is the best candidate for a DBMS for use in iPhone apps? The database would be online, not on the device, so a back-end updating administration interface would be most beneficial (like phpMyAdmin is for MySQL).
I only know of MySQL (not sure if it can be used for iPhone with satisfactory results), and SQL Lite, are there any other managements systems that would be great for performance as well be reliable.
Thanks in advance.
the choice of the DBMS has nothing to do with the iphone .. likely the iphone will connect to a web service (weither SOAP or REST). the web service will be the one using the database not the device.
If the database is online, I wouldn't recommend any kind of management system on the device. I would probably recommend implementing some kind of web service and communicate to the database server and its own DBMS via the web service.
Anriƫtte, I seem to have bumped into two common scenarios
For my corporate clients, they use SQL server as their database and .Net as their server API.
For my non-corporate clients, we usually use MySQL with a PHP or a Ruby on Rails server.
In both cases, I use JSON on the iPhone to talk to REST services on their servers. This works great.
Both DBMS above have good management tools. I usually use the MySQL GUI tools or SQL Server GUI tools to administer the database. Lots of people (not me) like the PHP MySQL admin tools because they are web based. Please do not use a personal database on the server like SQLite, Access of FileMaker, they do not scale.
I did once write an Objective-C program that accessed MySQL using its C++ libraries, not a good idea.
My advice: Ruby on Rails REST using JSON on top of a MySQL database on the server side.