duancanjiu3754 2019-06-18 10:40
浏览 216

Web项目:多个实例与单个实例

Team,

We are building a web project (like IT ticketing system). And we expect to have some big clients as soon we release the product. There should be three ways to raise a ticket: 1) via web application (forms), 2) via email or 3) via phone call to agent. According to our research 99% of tickets come via email and that means we shall be storing a lot of long messages etc.

The project is scoped so that we have two interfaces: agents (IT folks handling queries) and clients (people who ask for help).

The question here is what would you suggest us to do considering expected data and storage growth:

  1. centralize everything so that we have one app with a single huge database (easy to backup etc. unless we stuck with ex. data corruption or similar)...
  2. separate app in two parts one for IT agents and another one for clients. The idea is to split application in two: one centralized interface and back-end for IT agents and another one for clients. For each client we would create a separate database along with a copy of the PHP project (code syncing is easy to automate). Multiple client instances could be hosted on one or many servers. They would communicate via APIs. For example: IT agent opens a dashboard and the list of outstanding tickets is displayed. If that agent is working on 10 big clients back-end would need to contact 10 instances via API and request outstanding tickets. We can ensure only certain number of queries would be displayed...

Please feel free to add third option as well.

  • 写回答

1条回答 默认 最新

  • donglian8407 2019-06-21 09:07
    关注

    I am not quite sure that I understood everything correctly but from what I understood I can point out the following key points about your system requirement:

    • You are dealing with lot of data, and the data will grow fast
    • Most of traffic is coming from Email ticketing system
    • You have a multi-client system
    • You have an agent which can view data from multiple clients. Question is can this agent manipulate(create, update, delete) data from multiple clients? This is quite important point for future limitations of the architecture or not. I will assume that it can only read data from multiple clients.

    Your 2 suggestions:

    1. I would not recommend that as approach as many other problems could arise as the database grows. For example you will be forced to add Indexes to speed up queries on your db which will help in the beginning but later this will come to hunt you down especially if you have to add a lot of Non-Clustered indexes. You could make it a little better by using Read-only replicas but even with this you will at some point have issues. The problem will still remain in your 1 main database which will grow.

    2. Quote:

    separate app in two parts one for IT agents and another one for clients. The idea is to split application in two: one centralized interface and back-end for IT agents and another one for clients. For each client we would create a separate database along with a copy of the PHP project (code syncing is easy to automate). Multiple client instances could be hosted on one or many servers. They would communicate via APIs. For example: IT agent opens a dashboard and the list of outstanding tickets is displayed. If that agent is working on 10 big clients back-end would need to contact 10 instances via API and request outstanding tickets. We can ensure only certain number of queries would be displayed...

    You can split it to 2 separate apps as you said:

    1. Centralized Interface + back-end, would call the 1 or multiple databases

    2. Client application + back-end(monolith or multiple services), would call the same database as Centralized interface but only for current client

    As far as I understood your problem is not scaling Web-Servers(your back-end) but the db? If your problem is scaling the back-end as well then you can consider either scaling to multiple instances or splitting your domain to micro-services and scaling that architecture on micro-service level for each service independently.

    My Suggestion:

    1. Scaling your back-end: You can keep everything in one service(monolithic approach) and deploy it on multiple servers and scale the whole service together. There is nothing wrong with this. Like everything it depends of your Business/Domain requirements and what worked best for you. Although it is very popular these days to use micro-services they are not the best solution for every problem. I have worked with both types of architecture and they have worked fine for different scenarios. You can even have middle-ground solution between them to take on specific part which has high scaling demand and extract that to be a separate service(like creating Tickets sub-system service) and the rest of the application which has low demand would be one big service.

    2. Scaling your database: Considering the above points I would suggest you to use Data Sharding or Data Partitioning. You can read about data sharding here. In general it is a way to logically and physically split your data from one database to multiple based on some partitioning or shard key. This means that you can take one specific concept in your Domain as the Shard key to split the data based on it. In your case this could be CustomerId. This can only be done if the Business operations which include more then one Customer is not the case for your Business. Means if the all your operations are done within one Customer. The only exception here would be reading/viewing more customers together. This is fine as this does not need any transnational behavior. This really depends on your Business-scenarios and logic. If splitting your database to multiple databases based on shard-key CustomerId is not enough you can take a shard-key which is even more specific inside the Customer scope. Again it depends if your Domain allows this. In this case it could be for example the concept a CustomerA would have CustomerA-Europe shard CustomerA-USA shard, CustomerA-Africa and so on. This would represent the logical shard. The physical shard would be the physical database.

    The important point is that you pick your logical shard-key in the beginning so that you can easily migrate your data to different physical databases later when you need it based on that shard-key.

    Additionally to this you could include Historization for some heavy tables to separate the up to date data from your historical data. You can read more about this here.

    评论

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题