简体   繁体   English

用于管理应用的应用(架构)

[英]App for managing apps (architecture)

I know it's gonna be a very broad question and I'm pretty sure this is not anything new in todays world, but I really don't now where to start on this one. 我知道这将是一个非常广泛的问题,我很确定这在今天的世界里并不是什么新东西,但我现在真的不知道从哪里开始。

I've started working on a rails-based service that would allow users to create, configure and manage their projects (basicaly copies of a single app with customization). 我已经开始研究基于rails的服务,该服务允许用户创建,配置和管理他们的项目(具有自定义功能的单个应用程序的基本副本)。 The projects would be run on a subdomain with an option of connecting their own domain. 这些项目将在子域上运行,并可选择连接自己的域。 (Quite similar to how SquareSpace and Wix and many other website building services handle their websites) (与SquareSpace和Wix以及许多其他网站构建服务处理其网站的方式非常类似)

I want these projects to be as flexible and customizable as possible (including the visual design, some additional features etc) while maintaing ease of setup and updates for the codebase itself. 我希望这些项目尽可能灵活和可定制(包括可视化设计,一些其他功能等),同时保持代码库本身的易于设置和更新。

So the questions I start with: 所以我开始的问题:

  1. Should each project be a separate app (basicaly a copy out of the same repo) with its own configs, database, nginx and unicorn configs, etc. or should I keep all in 1 app and differenciate them with different configs and maybe databases and assets? 每个项目应该是一个单独的应用程序(基本上是同一个回购中的副本),它有自己的配置,数据库,nginx和独角兽配置等,或者我应该将所有内容保存在1个应用程序中,并将它们与不同的配置和数据库和资产区分开来?
  2. If it's better to keep everything separated... 如果最好保持一切分开......
    1. ... what's the best setup process (provided that I have basic configuration to start with)? ...什么是最好的设置过程(假设我有基本配置开始)?
    2. ... how would I be able to update them all (with bugfixes, new features, performance improvements etc.) from one place? ...我怎样才能从一个地方更新它们(包括错误修正,新功能,性能改进等)?
  3. If I keep all the projects in the same app... 如果我将所有项目保存在同一个应用程序中......
    1. ... how should I manage the configuration concurency between projects? ...我应该如何管理项目之间的配置可靠性?
    2. ... how do I separate the data and assets? ...如何分离数据和资产?

As always, I'd be grateful for any sufficient help I can get. 一如既往,我会感激任何足够的帮助。

I have no experience building these kind of things and maybe there is an easy solution I'm not aware of. 我没有构建这类东西的经验,也许有一个我不知道的简单解决方案。 But my answer may give you some ideas/pointers to start with. 但我的回答可能会给你一些想法/指针。

1) It's hard to give an accurate answer but based on the high personalization criteria and the "copies of a single app" you talk about, I would go for an architecture more PAAS-like than SAAS-like . 1)很难给出准确的答案,但基于高个性化标准和你所谈论的“单个应用程序的副本”,我会选择比SAAS更像PAAS的架构。 So separated apps. 所以分开的应用。

2.1) You may want to consider a setting using: 2.1)您可能需要考虑使用以下设置:

  • A main rails app , with a main webserver and a main nginx conf. 一个主要的rails应用程序 ,带有主要的web服务器和主要的nginx conf。 A wildcard domain. 通配符域。
  • A bunch of dynamically managed docker containers . 一堆动态管理的docker容器 Each container is initialized from your single app , and then personalized by the user. 每个容器都从您的单个应用程序初始化,然后由用户进行个性化。 User is associated to its containers through the main rails app. 用户通过主轨道应用程序与其容器相关联。 When a container is created from the main app, the main nginx config is updated (ie by adding a file in sites-enabled which define a new 'server' that bind the open port of the new container, and the right 'server_name'). 当从主应用程序创建容器时,主要的nginx配置会更新(即通过在启用的站点中添加一个文件,该文件定义绑定新容器的开放端口的新“服务器”,以及右侧的“server_name”) 。
  • Each contained rails app ship an unique and shared rails engine . 每个包含rails应用程序都附带一个独特的共享rails引擎 The rails engine is shipped by adding the corresponding gem in the Gemfile so it can be updated. 通过在Gemfile中添加相应的gem来运送rails引擎,以便可以更新它。

2.2) You update the 'shared rails engine' gem. 2.2)您更新'共享轨道引擎'宝石。 You can then run bundle install in each containers. 然后,您可以在每个容器中运行bundle install。

People interested in these kind of setups may consider tools like dokku and deis . 兴趣在这些类型的设置的人可以考虑类似的工具dokkuDEIS

Consider a multi-tenant architecture. 考虑一个多租户架构。 We've used it effectively for fleet-genius.com. 我们已经有效地将它用于fleet-genius.com。

The following link provides a good overview of the architecture from a Rails point of view. 以下链接从Rails的角度提供了对体系结构的良好概述。

http://blog.elbowroomstudios.com/zero-to-multitenant-in-15-minutes-a-rails-walkthrough/ http://blog.elbowroomstudios.com/zero-to-multitenant-in-15-minutes-a-rails-walkthrough/

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

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