0

As a preface: I want to do this as a learning exercise. I'm not trying to produce a commercially viable app.

What are the layers/abstractions of an iOS application that is connected to a custom, self hosted backend? What technologies are needed to build this stack?

This post has helped my understanding a bit. I'm currently using Firebase as my backend but have found its NoSQL structure wrong for my app. The data I'm storing is relational, so I think an SQL database storing JSON would work better. The data is modeling Vehicles shared between Users. From my research, the Realm Platform looks like a good choice. Am I understanding the technologies correctly here? Does this sentence make sense?

General functionality:

  • Sign Up and Login of users
  • Upload/download vehicle data
  • Some server side logic
  • Pushing data updates to users in real time

So would the stack look like the following?

User Front End: iOS app written in Swift
Database: Realm Database (SQL)
Server: Realm Object Server

I'm really looking for an overview of the general architecture. I don't know anything about that, so I'm sure I have failed to provide many details that are necessary for a thorough answer.

I apologize if this question is redundant; most answers I've seen for similar questions typically end with "just use AWS, Firebase, etc".

Thanks!

4

1 回答 1

1

首先,您要构建自己的后端,并且应该创建自己的 API,您的 IOS 应用程序将连接到该 API。简而言之,这称为 REST api https://www.sitepoint.com/developers-rest-api/

您将需要使用更多的技术,而不仅仅是像 Apache 这样的服务器

创建后端 API 后,您需要将其连接到 IOS 应用程序,这可以使用 Apple 的 NSURLSession 内置框架或基于 NSURLSession 的 Alamofire 来完成,但如果您正在学习,它更易于使用

您将需要学习如何执行 http/https 请求以了解请求是如何发出的

检查这个 https://medium.com/@MuraliKathir/build-a-simple-api-search-with-alamofire-and-swiftyjson-80286e833315

现在到境界。Realm 是一个本地数据库,它将位于您的 IOS 应用程序中,它可以帮助您保存在线下载的数据,甚至是用户生成的 https://realm.io/docs/swift/latest/#queries

于 2019-03-22T15:08:17.150 回答