when to create different hubs vs group in azure web pub sub - azure-web-pubsub

I am bit confused about the right approach or what are the deciding factors to consider when creating separate hubs vs separate groups within a hub.
In my app there are 2 cases where are are using pub sub:
Multiple user have access to same data. In order to avoid overriding changes done by one user by another we use locking mechanism so that only 1 user can edit the data at my given point. Pub sub notifies users if data they are viewing is locked.
We have some long running report generation process and we use pub sub to get state update of the long running process
We currently have single hub created("MY-APP-HUB") for the entire application, and for both of these use cases have separate groups created "LOCK-DATA-[IDENTIFIER OF THE DATA]-GROUP" and "REPORT-[IDENTIFIER OF THE REPORT]-GROUP". Works well no issues there.
However I am wondering if I should create separate HUB for each action so "LOCK-DATA-HUB" and "REPORT-HUB", and then have separate groups created for each data unit. So for eg within "LOCK-DATA-HUB", create a group "DATA-1-GRP", "DATA-2-GRP", similarly "REPORT-1-GRP", "REPORT-2-GRP" for "REPORT-HUB".
I am honestly not sure if I am doing things correctly. At one hand having all messages associated with an app going through a hub makes sense to me and managing just single token is simpler.
But creating hub per action/feature is not bad either. My only concern here would be if multiple application sharing same pub sub have similar actions going on but that could be avoided by adding some application identifier to the hub name I suppose.

Related

Asana developer

we use Asana as our internal project management platform. We would like to use it to interact with our clients so they can see the progress of their projects - which is the same per year. We created the Kanaban view and move the cards through each process. We would like to show this to our clients, but have them only see their card.
Is there a way of doing this?
Thanks
There isn't a way that I'm aware of to have only certain tasks show up to certain people within a project - our access control is limited to the project level, so everyone who can see a project can see all tasks in a project.
One thing you might consider as a workaround is to multi-home the tasks into multiple projects (that is, add them into multiple projects). In this way you can limit membership to the second project to only the people in that set of clients, and have your original project as a master board with just your team in it.
You will have to keep these projects in sync, but this is possible in our API. Our tasks/addProject endpoint accepts both a project and a section (which is admittedly a bit unintuitive). If you maintain a mapping of each section, that is, "ID of Column A in the master board view maps to ID of Column B in the client board view", you can periodically iterate over all your tasks and re-insert each task in the client board view in the correct column based on where the task is in the master board view. (addProject is idempotent across requests, so re-insertions into a project are OK).
This is an interesting use case, thanks for sharing it! Hopefully this workaround will prove to be usable.

How to split functionality into separate apps iOS?

I am working on an app that serves two different types of user. Both users have some common functionalities.
One group is the general public, who uses the app to navigate basic events or request for new events.
The second group is who can provide services to the general public (can be paid or unpaid). They primarily access the profiles created by general users. They can add details, e.g. notes about conversations with them.
Now we want to divide both the users because the app is getting quite large and at any time user can be part of one group only.
How can I create separate apps?
Using different targets for each group is it a better solution? I tried this but it is not helping us to reduce app size.
Creating separate project will make maintaining challenge because both uses have some common functionalities.

How to manage one repository of Xcode iOS app for multiple companies with slighly different requirments?

I have a mobile app developed for number of different companies on AppStroe. Each company is using different endpoint to server/icon/logo. I have managed to add this in custom plist file and according to companies endpoint, I switched to different build setting.
Now these companies are going to different ways of authentication. One is using another app to authenticate and one is using server calls. Also for one company I am receiving datas one from server call and other one from local files.
I have to handle different login behaviour for different projects. It is mostly display/disable some extra views. I don't want to have two repositories or branches. Because almost %85 of functionalities are same. I want to add functionalities same time to both and some times to only one of them and run my tests and all.
I am looking for some way way to manage this app to maintain most functionalities and keep it only one app. How can I do that? Any suggestion?
This is a very old problem. Basically you have two options: build time and run-time; from your description it may be that you need a both (I would not trust configuration to drive my authentication code).
Build time means using conditional compile (e.g. Which conditional compile to use to switch between Mac and iPhone specific code?) and a different build profile for each customer. I assume that Xcode Targets (see How to manage the code of multiple, very similar Xcode projects) allows you to define different build profiles.
Run-time checks maps to Feature Toggling.
I suggest not using version control to manage nuances of the same application because it quickly becomes a merge nightmare, even with Git.

Rails communication with web services

I am developing a Rails web shop application and I have the following system set up:
2 separate web services (very simple Rails apps with the same code but different databases)
Main Rails application which stores information from both web services.
The main application gets some information from both web services (in JSON format) and has to choose items (based on price). For testing purposes I currently take all items from both and add them to the main application's database. However, when items are being stored in the main database (with a simple .create and a hash with all parameters it seems as if it's adding on item multiple times and thus it takes a very long time.
First, what is generally a good strategy for doing this type of thing - getting data from the web services and storing it? Also, at what point do I want to ask for an update of the main database? It seems too much if it is every time a user connects.
I assume there is a key value for id in the data... if not you should define one. Most likely an auto incrementing integer ID since this is tagged as rails. Although you'll probably want a UUID (perhaps SecureRandom.uuid) since the two data sources are independent of each other, which adds significant complexity in a rails app
In that case you could use #model = Model.find_or_create_by(key_value: value) to avoid duplicates being created, and #model.update_attributes (essentially use an update action) to only modify what has changed.

Core Data Sync With Multiple Users

I would like to sync a core data app with a user with a different iCloud ID and I am trying to figure out the most graceful way to do this. I do not want the data to sync with all users, but want to be able to sync among family members for instance. From the research I have done, I do not think I can do that using iCloud Core Data sync because it only syncs between devices with the same iCloud ID. I have looked at this stackoverflow answer and read a little bit about Ensembles, Parcelkit and TICoreDataSync, Parse etc., but it is not clear to me if any of those options will allow me to sync with multiple users. Does anyone have a good method for syncing a Core Data app with multiple users?
Ensembles and TiCoreDataSync might work. They can use Dropbox file syncing, so in principle they should work with Dropbox shared folders. I don't think these are the main intended uses, so I suggest contacting the developers and/or doing some good testing yourself before assuming this would actually work.
You'll need to think about the user experience, though. At a minimum, your users would both need Dropbox accounts and would have to set up a shared folder before beginning to sync data this way.
Parcelkit probably won't work. It uses Dropbox's data store API which, unlike other Dropbox services, doesn't appear to support shared data.
Services that do support this kind of sharing exist-- for example, Parse and Firebase-- but make sure to review their pricing carefully before using them. Also of course, there have been any number of projects that have their own custom server back end, but that obviously requires having someone on the team who can do that kind of work.
You need to think about other device types (Android at least) if you want your application to be reaching more users.
I'm doing the same now by the following way:
Setup an online database with proper web services (careful with implementation for security matters - DB should NEVER be exposed by anything other than the web services).
Create a Class for your communication with the server (using Class methods with security handling like authentication and authorisation).
Use the class in your app to communicate with the server (SQL operations are done on the server).
To integrate with CoreData you need to create the model in your app similar to the structure in the backend database. Then you need to create a similar class for the app that deals with only local CoreData.
A higher level class might be required if you want to make sure that operations done on both server and local data storage.
Besides, you have to implement a lot of conditions to make sure that data written in local ONLY after making sure that it is stored online (or create an engine for differed operations to run later).
Another Way if you are familiar with notifications:
Use structured notifications between devices for data operations in order to keep everything in sync with other users. The problem with this is the "Autonomy" of the operations. If two operations were done in approximately the same time, you have to find a way to make sure the order of the operations is done properly (maybe timestamp or something).
I'm looking into the same thing for my app and I 'think' you can do a fairly unsecured version of what you are after using using the public folder in cloud kit as mentioned in this question (no accepted answer at time of posting) : Private data sharing using CloudKit
You would need to find a way to differentiate between data that is truly public and those shared among the users you need and some level of authentication.
I'm going to try exporting a permission file with access permission in it to whomever I want to share with combined with a unique identifier located in that permission file.
Keep in mind, as mentioned in the comments of the linked answer, my implementation will be security by obscurity (thanks for that phrase) unless you find a way of adding proper validation to it but my data is relatively insensitive.
Hope this, or any ridicule in the comments, points you in the right direction : )

Resources