设计和服务器端技术
有一个用 Java (Swing) 编写并使用嵌入式数据库 (derby) 的开源桌面程序。现在我需要开发一种机制,用户可以将其数据与服务器同步,这样在任何操作系统或硬件崩溃的情况下都不会丢失他/她的数据。
首先我想知道哪种服务器端技术符合需求。例如,该软件可以直接连接到远程数据库还是通过对某些 URL 的 http 请求发送和接收数据?
如果使用某种服务器端编程更好,那么应该是接收参数并提供 XML 文档的简单 URL,还是使用 Web 服务更好?
由于该软件是开源的、非商业性的,用户无法返还任何费用,什么样的Web服务器才算合理(经济)呢?
如果您需要了解更多细节以便提出好的设计,请询问我。我现在无法在这里提供更多细节。 :)
There is an open source desktop program which is written in Java (Swing) and uses an embedded database (derby). Now I need to develop a mechanism that user can synchronize its data against a server that (s)he doesn't loose his/her data in the case of any OS or hardware crash.
At first I want to know which server-side technology is matching the needs. For example is it ok that the software connects to a remote database directly or send and receive data by http requests to some URLs?
If it is better to use some sort of server-side programming, should it be simple URLs which receive parameters and give XML documents or it is better to have web services?
As the software is open source and non-commercial, there is no money back from users, what kind of web server could be reasonable (economical)?
If you need to know more details in order to suggest a good design, please ask me. I can't give more details here right now. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先也是最重要的一点,鉴于用户群足够大,此类内容的所有托管选项都很昂贵。如果你开源集中存储技术供用户自己托管是一回事,如果你免费为用户托管所述技术则是另一回事。但这是一个业务问题,而不是技术问题。
在技术方面,您肯定需要在服务器上有一个数据库,但您可能应该考虑将其隐藏在 RESTful 服务后面。这将使您能够更好地控制安全性、监控和可扩展性。它还为您以外的客户提供了访问的可能性。
从 Spring-MVC 3.0 版本开始,Spring-MVC 拥有一些优秀的资源来完成此类工作。查看此链接以获取更多信息: http:// blog.springsource.com/2009/03/08/rest-in-spring-3-mvc/
First and foremost, all hosting options for something like this are expensive given a large enough userbase. It's one thing if you open source the centralized storage technology for users to host themselves, it's another if you host said technology for users free of charge. But then that's a business problem, not a technical one.
On the technical side, you'll definitely want a database on the server, but you should probably consider hiding it behind a RESTful service. This will allow you to have finer control over security, monitoring, and scalability. It also opens up the possibility of access from clients other than your own.
As of version 3.0 Spring-MVC has some excellent resources for doing this kind of work. Check out this link for more info: http://blog.springsource.com/2009/03/08/rest-in-spring-3-mvc/