WWDC22 SALE: Save 50% on all my Swift books and bundles! >>

Sharing backend DB between iOS and Android app

Forums > Server-side Swift

Hi, I’m designing a data driven app.

The UI deliberately simple, reflecting the state of remote data.

The app, potentially thousands+ users, will be able to share/publish into the backend.

The app will be iOS, iPadOS, macOS initially but I want to also create an Android version. (There might be a supporting webapp also. )

Please advise on the most appropriate components.

I’ve been researching.
On the Apple side it’s definitely Swift (Xcode). On the Google side - Kotlin. For them both (and the webapp) the shared backend - Vapor perhaps?

Any thoughts will be greatly appreciated. Thanks.


Do you have experience with some other web frameworks? Vapor might be cool but other technologies are more mature and have tons of tutorials, SO answers available. For example with Django Rest Framework you can create basic REST API in one evening


Many thanks for your reply.

I have mainly Java background, learning Swift. (Hence here :-)

Just been reading some more, perhaps going in the web framework direction might be a bit of an overkill right now. Might cloudKit be good enough for my needs? Or to be used as a starting point, encapsulated so that it can be replaced if necessary.

Also, there seems to be a way of coding Swift for Android, so perhaps no need for Kotlin either.

Many thanks in advance for any thoughts .


Hacking with Swift is sponsored by RevenueCat

SPONSORED You know StoreKit, but you don’t want to do StoreKit. RevenueCat makes it easy to deploy, manage, and analyze in-app subscriptions on iOS and Android so you can focus on building your app.

Explore the docs

Sponsor Hacking with Swift and reach the world's largest Swift community!

CloudKit could work very well and you wouldnt have to manage your own backend but it wont work on Android I think. On the other hand there is CloudKit JS for frontend so maybe you could somehow use it for Android


Thanks again, very useful insight.

I'm still reading and some say that Firebase is the bees knees. Going to read some more.

Any experience/thoughts anyone? Thanks in advance.


And another one just cropped up - Amazon Web Services.

Any thougts? Thanks. (going to continue reading :-)


After some deliberating I've decided to run my own DB, probably integrated within a web framework. New questions - which one and how/where to host it. Again, thanks for any thoughts/advice.


I am running my stuff on DigitalOcean. It is not the cheapest but they have very pleasant admin UI where stuff is easily accessible and also tons of helpful guides.

Since you have Java background it seems like finding good REST framework for it could work well? I am really fond of Django as I mentioned but Python is quite a departure from languages like Swift and Java.


Looking again in the direction of Vapor. I’ve a spare old iMac (mid 2011) that I want to use as a server, to deploy Vapor to run my RESTfull app.

It seems that Vapor needs Swift toolchain installed, to be run. And Swift cannot be installed on macOS without Xcode. And Xcode won’t install on this iMac. Where am I wrong?

The development is done separately on brand new MacBook.

Some Linux could be used but I can’t wipe off the macOS, for hysterical reasons ;-)

Thanks for any thoughts.


You want to have the iMac as a production server? I would not recommend that. Normal computers arent designed to run as a server and it could cause you a lot of headache. Plus what if your app explodes in popularity and your server suddently cannot handle that? You also need pretty fast internet connection.


No, this is for protoyping only. Thanks.


You would build a vapor app to handle the routes for requests and then hoist it into Heroku cloud hosting. It will live up there and you can shut all your computers off and sleep peacefully. This app will interface with the DB that is inside of your Heroku account.


Hacking with Swift is sponsored by RevenueCat

SPONSORED In-app subscriptions are a pain. The code can be hard to write, hard to test, and full of edge cases. RevenueCat makes it straightforward and reliable so you can get back to building your app.

Explore the docs

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.