[CareerCup] 10.1 Client-facing Service 面向客户服务器

简介:

10.1 Imagine you are building some sort of service that will be called by up to 1000 client applications to get simple end-of-day stock price information (open, close, high, low). You may assume that you already have the data, and you can store it in any format you wish. How would you design the client-facing service which provides the information to client applications? You are responsible for the development, rollout, and ongoing monitoring and maintenance of the feed. Describe the different methods you considered and why you would recommend your approach. Your service can use any technologies you wish, and can distribute the information to the client applications in any mechanism you choose.

这道题是一道设计题,说是有一些数据信息要给1000个客户端应用访问,问我们的用什么样的面向客户服务器来实现所有的功能。根据树中描述,我们的服务器需要易于用户使用,也要易于自己使用,可以易于未来需要的变更修改,高效和可扩展性好,那么主要有以下三种实现方法:

1. 使用txt文件,这是最简单的方法,用户在FTP服务器上下载这个文本文件,这可能一定程度上方便了维护,因为文本文件易于浏览和备份,但是访问解析起来很麻烦,尤其是添加了新数据之后。

2. 使用SQL数据库,让客户直接对数据库操作。好处是我们可以利用数据库强大的检索功能找出我们想要的一些条件搜索结果,数据库可以回朔,且备份方便,便于客户集成现有的应用程序。坏处是可能过载了,我们需要整个SQL数据库的东西来维护,还需要实现额外层来浏览和维护数据,尽管数据库很安全,但是我们不能让用户访问一些他们不应接触的数据。

3. 使用XML,如果我们的数据里固定的格式和固定的大小,例如company_name, open. high, low, losing price. 那么XML可以写出如下这样:

<root>
    <date value="2008-10-12">
        <company name="foo">
            <open>126.23</open>
            <high>130.27</hight>
            <low>122.83</low>
            <closingPrice>127.30</closingPrice>
        </company>
        <company name="bar">
            <open>52.73</open>
            <high>60.27</high>
            <low>50.29</low>
            <closingPrice>54.91</closingPrice>
        </company>
    </date>       
    <date value="2008-10-12">
    ...
    </date>
</root>

本文转自博客园Grandyang的博客,原文链接:面向客户服务器[CareerCup] 10.1 Client-facing Service ,如需转载请自行联系原博主。

相关文章
|
存储 缓存 网络协议
Web客户/服务器程序
Web客户/服务器程序
|
存储 监控 C++
OPC服务器与客户程序设计
OPC服务器与客户程序设计
|
8月前
|
存储 监控 API
【Azure App Service】分享使用Python Code获取App Service的服务器日志记录管理配置信息
本文介绍了如何通过Python代码获取App Service中“Web服务器日志记录”的配置状态。借助`azure-mgmt-web` SDK,可通过初始化`WebSiteManagementClient`对象、调用`get_configuration`方法来查看`http_logging_enabled`的值,从而判断日志记录是否启用及存储方式(关闭、存储或文件系统)。示例代码详细展示了实现步骤,并附有执行结果与官方文档参考链接,帮助开发者快速定位和解决问题。
238 22
|
Linux 应用服务中间件 网络安全
【Azure 应用服务】查看App Service for Linux上部署PHP 7.4 和 8.0时,所使用的WEB服务器是什么?
【Azure 应用服务】查看App Service for Linux上部署PHP 7.4 和 8.0时,所使用的WEB服务器是什么?
133 0
|
XML 数据格式
【应用服务 App Service】如何移除App Service Response Header中包含的服务器敏感信息
【应用服务 App Service】如何移除App Service Response Header中包含的服务器敏感信息
129 0
|
域名解析 网络协议 数据中心
【应用服务 App Service】当遇见某些域名在Azure App Service中无法解析的错误,可以通过设置指定DNS解析服务器来解决
【应用服务 App Service】当遇见某些域名在Azure App Service中无法解析的错误,可以通过设置指定DNS解析服务器来解决
221 0
|
网络协议 Java
Java Socket编程 - 基于TCP方式的客户服务器聊天程序
Java Socket编程 - 基于TCP方式的客户服务器聊天程序
216 0
|
弹性计算 安全 Ubuntu
ECS(Elastic Compute Service)中选择镜像
ECS(Elastic Compute Service)中选择镜像
260 4
|
存储 网络协议 Java
编写UDP版本的客户-服务器程序(echo server 和 echo client)
编写UDP版本的客户-服务器程序(echo server 和 echo client)
254 0
|
弹性计算 容灾 定位技术
ECS(Elastic Compute Service)地域和可用区的选择
ECS(Elastic Compute Service)地域和可用区的选择
355 2

热门文章

最新文章