Realm Mobile Platform是否适合管理小公司的服务?

时间:2022-10-31 02:42:47

I am developing an application to manage small companies (1-2 managers and 20-100 employees). A manager has a Mac application for managers. Each employee has iPad with an app for employees. I would like to try use Realm Mobile Platform for this purpose. But I can't imagine architecture. The idea is the following:

我正在开发一个管理小公司的应用程序(1-2名经理和20-100名员工)。经理有一个管理员的Mac应用程序。每位员工都有iPad,员工可以使用应用程序。我想尝试使用Realm Mobile Platform来达到这个目的。但我无法想象建筑。这个想法如下:

  • Manager can create some common data shared with all employees (shared realms with access granted to all employees?).
  • Manager可以创建一些与所有员工共享的公共数据(具有授予所有员工访问权限的共享领域?)。
  • Each employee can create private data (private shared realm with ~ symbol?).
  • 每个员工都可以创建私有数据(带有〜符号的私有共享领域?)。
  • Manager can see in his app all common data as well as all private data (all common realms and all employees' private realms?)
  • 经理可以在他的应用程序中查看所有常见数据以及所有私人数据(所有常见领域和所有员工的私人领域?)

E.g. I create these 2 applications and distribute them to small companies (e.g. 300 companies). Should I set up a separate Realm Object Server for each company (not best solution) or I can use one Realm Object Server containing Realms for all companies? And how in this case to grant access to the company specific Realms only to its managers and employees?

例如。我创建这两个应用程序并将它们分发给小公司(例如300家公司)。我应该为每个公司设置一个单独的Realm对象服务器(不是最佳解决方案),还是我可以为所有公司使用一个包含Realms的Realm对象服务器?在这种情况下,如何仅向其经理和员工授予对公司特定领域的访问权限?

As Realm replicates the whole database, manager will have all Realms on his Mac and each employee will have common Realms and 1 private Realm on his iPad, right? I am wondering because each Realm may have size ~40 Mb. Therefore I don't want to replicate all company's data (actually all common and private Realms) to each iPad.

当Realm复制整个数据库时,经理将在他的Mac上拥有所有Realms,每个员工将在他的iPad上拥有共同的领域和1个私人领域,对吧?我很想知道因为每个王国的大小都可能达到40 Mb。因此,我不想将所有公司的数据(实际上是所有常见和私有领域)复制到每个iPad。

1 个解决方案

#1


2  

Manager can create some common data shared with all employees (shared realms with access granted to all employees?).

Manager可以创建一些与所有员工共享的公共数据(具有授予所有员工访问权限的共享领域?)。

This could be a single realm shared with all employees.

这可以是与所有员工共享的单一领域。

Each employee can create private data (private shared realm with ~ symbol?).

每个员工都可以创建私有数据(带有〜符号的私有共享领域?)。

Using the ~ tilde in front of the Realms URL is just for namespacing (it get replaced with the userid). It is similar how you would address the users homedir in a filesystem. By default users can only create realms in their own namespace.

在Realms URL前面使用~tilde只是用于命名空间(它被用户ID替换)。它与您在文件系统中解决用户homedir的方式类似。默认情况下,用户只能在自己的命名空间中创建领域。

But even if realms are created in the users own namespace (where only they have access to it by default), you can still add extra permissions to share it with others. So in your case you would just add permissions to allow the manager to read them as well.

但即使领域是在用户自己的命名空间中创建的(默认情况下只有他们可以访问它),您仍然可以添加额外的权限以与其他人共享。因此,在您的情况下,您只需添加权限以允许管理员也读取它们。

Should I set up a separate Realm Object Server for each company (not best solution) or I can use one Realm Object Server containing Realms for all companies?

我应该为每个公司设置一个单独的Realm对象服务器(不是最佳解决方案),还是我可以为所有公司使用一个包含Realms的Realm对象服务器?

You can do both. Using one server per company will make scaling easy (and you can host it in an availability zone close to their actual location), but you could also host it all on one server.

你可以做到这两点。每个公司使用一台服务器可以轻松扩展(您可以将其托管在靠近其实际位置的可用区域中),但您也可以在一台服务器上托管它。

Since the individual employees all stores their realms under their own namespace (realm://host.com/~/myrealm) there will be no conflicts there. For the managers shared realms you could just put them each under a company namespace (realm://host.com/companyname/sharedrealm).

由于各个员工都将自己的领域存储在自己的命名空间(realm://host.com/~/myrealm),因此不存在任何冲突。对于管理员共享领域,您可以将它们分别放在公司名称空间下(realm://host.com/companyname/sharedrealm)。

As Realm replicates the whole database, manager will have all Realms on his Mac

当Realm复制整个数据库时,经理将在他的Mac上拥有所有Realms

The manager does not need to have all the employee realms on his Mac all the time, they can be opened on demand when needed.

经理不需要一直在他的Mac上拥有所有员工领域,他们可以在需要时按需打开。

how in this case to grant access to the company specific Realms only to its managers and employees?

在这种情况下,如何仅向其经理和员工授予对公司特定领域的访问权限?

Currently you need the Enterprise edition to control individual permissions like that (but it is coming to the Developer Edition as well), so you should contact us

目前,你需要企业版来控制这样的个*限(但它也会发布到Developer Edition),所以你应该联系我们

#1


2  

Manager can create some common data shared with all employees (shared realms with access granted to all employees?).

Manager可以创建一些与所有员工共享的公共数据(具有授予所有员工访问权限的共享领域?)。

This could be a single realm shared with all employees.

这可以是与所有员工共享的单一领域。

Each employee can create private data (private shared realm with ~ symbol?).

每个员工都可以创建私有数据(带有〜符号的私有共享领域?)。

Using the ~ tilde in front of the Realms URL is just for namespacing (it get replaced with the userid). It is similar how you would address the users homedir in a filesystem. By default users can only create realms in their own namespace.

在Realms URL前面使用~tilde只是用于命名空间(它被用户ID替换)。它与您在文件系统中解决用户homedir的方式类似。默认情况下,用户只能在自己的命名空间中创建领域。

But even if realms are created in the users own namespace (where only they have access to it by default), you can still add extra permissions to share it with others. So in your case you would just add permissions to allow the manager to read them as well.

但即使领域是在用户自己的命名空间中创建的(默认情况下只有他们可以访问它),您仍然可以添加额外的权限以与其他人共享。因此,在您的情况下,您只需添加权限以允许管理员也读取它们。

Should I set up a separate Realm Object Server for each company (not best solution) or I can use one Realm Object Server containing Realms for all companies?

我应该为每个公司设置一个单独的Realm对象服务器(不是最佳解决方案),还是我可以为所有公司使用一个包含Realms的Realm对象服务器?

You can do both. Using one server per company will make scaling easy (and you can host it in an availability zone close to their actual location), but you could also host it all on one server.

你可以做到这两点。每个公司使用一台服务器可以轻松扩展(您可以将其托管在靠近其实际位置的可用区域中),但您也可以在一台服务器上托管它。

Since the individual employees all stores their realms under their own namespace (realm://host.com/~/myrealm) there will be no conflicts there. For the managers shared realms you could just put them each under a company namespace (realm://host.com/companyname/sharedrealm).

由于各个员工都将自己的领域存储在自己的命名空间(realm://host.com/~/myrealm),因此不存在任何冲突。对于管理员共享领域,您可以将它们分别放在公司名称空间下(realm://host.com/companyname/sharedrealm)。

As Realm replicates the whole database, manager will have all Realms on his Mac

当Realm复制整个数据库时,经理将在他的Mac上拥有所有Realms

The manager does not need to have all the employee realms on his Mac all the time, they can be opened on demand when needed.

经理不需要一直在他的Mac上拥有所有员工领域,他们可以在需要时按需打开。

how in this case to grant access to the company specific Realms only to its managers and employees?

在这种情况下,如何仅向其经理和员工授予对公司特定领域的访问权限?

Currently you need the Enterprise edition to control individual permissions like that (but it is coming to the Developer Edition as well), so you should contact us

目前,你需要企业版来控制这样的个*限(但它也会发布到Developer Edition),所以你应该联系我们