简体   繁体   English

iOS AWS SNS集成

[英]iOS AWS SNS integration

We are in the development of messaging application in the iPhone. 我们正在开发iPhone中的消息传递应用程序。 The backend we are developing in Rails. 我们在Rails中开发的后端。 And we are planning to upload the backend in AWS. 我们计划将后端上传到AWS。

The features in our application are; 我们应用程序中的功能是; • When a user sends a message (pictures, videos) to other users, we will keep the attachments in the Amazon S3 and keep the entry in the data base. •当用户向其他用户发送消息(图片,视频)时,我们会将附件保留在Amazon S3中,并将条目保留在数据库中。 • The backend should send a notification to the receivers and in the iPhone app the received notification should be shown. •后端应将通知发送给接收方,并且应在iPhone应用程序中显示收到的通知。 • When a user logs in to the iPhone application the other users needs to know the online/offline status of the users. •用户登录到iPhone应用程序时,其他用户需要知道用户的在线/离线状态。 • In the contact view of the application, users needs to know the online/offline status of the contacts (presence management) •在应用程序的联系人视图中,用户需要了解联系人的在线/离线状态(状态管理)

We are planning to use Amazon SNS for sending notification from AWS backend to iPhone apps. 我们计划使用Amazon SNS从AWS后端向iPhone应用程序发送通知。 Does the SNS supports presence management (online/offline status of the friends)? SNS是否支持在线状态管理(朋友的在线/离线状态)? Can somebody point out any example for SNS iPhone application development? 有人可以指出SNS iPhone应用程序开发的任何示例吗?

Asking Sorry if I am asking too generic question. 问对不起,我问的是太笼统的问题。

For the intended use you are planning to make, both the SNS and the SQS do not have the necessary requirements, they do not have the selector feature, which if existed, could be used to filter the messages according to certain metadata, such as recipient or sender, similar to Java JMS, for more information on the term SELECTOR look javadoc javax.jms.Message . 对于您打算进行的预期用途,SNS和SQS都没有必要的要求,它们没有选择器功能,如果存在选择器功能,则可以使用该功能根据某些元数据(例如收件人)来过滤邮件。或类似于Java JMS的发送者,有关术语SELECTOR的更多信息,请参见javadoc javax.jms.Message

In addition, there would also need a way to restrict user access based on metadata, currently permissions are based only on the operations available from the SNS and SQS individual queues, which is not granular enough. 另外,还需要一种基于元数据来限制用户访问的方法,当前权限仅基于SNS和SQS单个队列中可用的操作,不够精细。

So I think the ideal solution would be to implement the service in EC2, to coordinate the flow of all messages and online status, using a backend database for long term storage message storage, and optionally Elastic Cache to provide lower latency responses for messages and onine status. 因此,我认为理想的解决方案是在EC2中实施服务,以协调所有消息的流和在线状态,使用后端数据库进行长期存储消息存储,并可选地使用Elastic Cache为消息和onine提供较低的延迟响应状态。

In order to achieve better scaleability and reduce coupling, you should also consider using an internal SNS topic to postpone the update of the intermediate cache and the database. 为了获得更好的可伸缩性并减少耦合,您还应该考虑使用内部SNS主题来推迟中间缓存和数据库的更新。

It is also worth remembering that you can make use iPhone database as a local cache of messages available on the server. 还值得记住的是,您可以将iPhone数据库用作服务器上可用消息的本地缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM