iOS database programming - ios

I am looking for something that would act as a database for an iOS application. I have read about SQLite, but this seems to be only useful if you want to store the database locally. I want to have multiple people be able to write to the database from multiple phones.
Does anyone have any information? Can you just use a MySQL database?
Not looking for any code, just to be pointed in the right direction, brand new to the topic!

You might want to look at Couchbase Lite which is an embedded lightweight, document-oriented (NoSQL), syncable database engine.

Related

CMS, Backend for iOS App

My question might be too easy. But i come from web development background and just started creating iOS app by learning from here and there. I have made 2 prototypes, but the second one need backend, cms.
From my prev experience i used php, mysql, html, css. I custom made the cms to organize my content and all user data, etc would be stored into database and can be maintained from the cms.
I use swift, but i seem to miss something important. in ios area what are the tools to develop the db (not local storage, coredata, and such) and maintain that; like what i used to use in web dev area? i dont even know how to ask the right question, but i really hope you guys would understand
can you guys give me direction? a link to basic knowledge of this will be fine
thanks
I think usually it will be database on a server and you will send requests and get answers in JSON format. You will have to parse them and use in your app.

ejabberd: manage adding / removing friends

Serious headaches, trying to get ejabberd to integrate into an existing Rails app to support the chat part. Hope anyone wich has gone true this could share some insights on how to best approach cause currently everwhere there are issues.
My goals:
1. Store all data in mysql database for easy backup
for this I have setup mysql usage for ejabberd using the mysql drivers so far so good
2. Easy add and remove users from each others roster ( add and remove friend connections ) for this I have setup module rest and mod_admin_extra to be able to do restfull calls to ejabberd from the rails app. The ejabberd admin module allows to add and remove users BUT ( overflow: https://stackoverflow.com/a/5229902/355281 ) This author says its not possible to store data in mysql Mnesia is always used by mod_admin_extra
3. Temporarily add users to each others list or preferrable have some temp room to add 2 users to so they can chat as long as this group exists. No idea how to approach this
Problems with all this
Seems not all data can be stored in mysql, so data shattering Mnesia & Mysql , very bad to have data in 2 places and be unable to easy backup the mysql database
Have to use rest module to do stuff to the database wich is on itself fine, but how to add 2 users to each friendlist is unclear to me.
Although ejabberd seems to be the most complete out of the box xmpp server I might need to look for another server that tackles above issues. This part of my project has been big headaches hope someone can clarify, provide some suggestions on how to approach.
for example:
If facebook used ejabberd how did they tackle these issues?
Is there a clean rewrite of ejabberd that tackles above problems? perhaps a commercial xmpp server with decent api and ways to add/ remove users and store data in 1 central location?
Since you're already using MySQL, you can just manage the roster using Rails/MySQL Directly.
If you don't wanna do it directly in the DB, which is totally understandable, you can connect to the server through bosh (http://xmpp.org/extensions/xep-0206.html), where you can do all you're asking for. There is a JS bosh client that you might be able to use as a guide to implement it in Rails, it's called http://strophe.im/
Regarding having the data in two places, you should have (or be able to have) all the roster specific tables in MySQL, additionally you can configure pretty much every persistent piece of data to be on mysql, I'd need to know more about your specific concerns and configuration to be able to elaborate more on this though.
eJabberd is highly configurable and extendable, in my experience (over 8 years working with eJabberd) you can basically achieve any kind of behavior one way or the other.

Simplest way for understanding MongoDB iphone

What is the simplest way of understanding about mongoDB? i know there's something called as NuMongo wrapper to to interact with mongoDB, but yet its not yet clear in my head. Can some please share the knowledge ?
Thanks
Directly accessing a MongoDB database from a mobile device is probably not a good idea. The main limitation is that the Mongo wire protocol has no encryption.
You can build an application server as middleware, in almost any language you like.
That said, ObjCMongoDB (of which I'm author) has support for iOS, so if you decide you want to give it a go anyway, you can.
If you want to write an application server on Mac OS using Objective-C, you can also use ObjCMongoDB for that, along with something like CocoaHTTPServer.
An very simple way is to set up a Rails Application with some mongoDB PlugIn, e.g. mongomapper and in Rails you can define the web service to communicate with the iPhone.
These links are very good to understand Rails and mongomapper:
Rails Guides
MongoMapper Documentation

using postgreSQL and jsondb in the same web app

My site is written in ruby (rails) and it's very easy to persist the results of an offsite json feed with using jsondb, so I have an app that would benefit from this, but I think I'd like to keep the rest of the site running on postgrs
Would I be better off moving everything to one database (jsondb?) or does rails easily allow me to use multiple ORM's in the same app
# just notes, ignore if you like cos the answers are subjective
# Perhaps I should build two web apps?
Sometimes it is practical to use multiple databases.
I'd take a hard look at the tenacity gem, which was introduced recently as a way to manage multiple databases within Rails .. and even relationships between them.
It doesn't look like it currently supports jsondb, but given its architecture, it should be possible to write your own adapter (... and then contribute it back?)
It's really better to have only one database. If it's better to use postGresql use it or only jsondb.
Having more than one database can be complicated to understand where is really your data.

Using MongoDB for a calendar web app

I have been doing web programming for few years. All this time, I have been using RDBMS. As a side project, I would like to create a web application and would like to use NoSQL. I have never used NoSQL. So I would like to use a NoSQL solution. Web app is going to be a calendar and article list that are going to be shared among a project group. I would be using Ruby on Rails.So would it be fine to use MongoDB for this web app? or do you have any other recommendation?
MongoDB should be fine. I can't think of a particularly compelling reason as to why it'd be superior to an RDBMS or one of the other key-value stores out there for this particular problem, but I can't think of a reason not to use it, either. For a learning project, it should be more than fine.
As far as interfaces go, I'm currently using MongoMapper and am happy with it, and Mongoid is picking up a lot of steam. You can even just use the Mongo driver directly - it's very usable.
Candy looks quite nice as ruby lib. There are other like MongoMapper and Datamapper + do_mongo and likely more.

Resources