简体   繁体   English

建立键值存储

[英]Build a Key-Value Store

I'm thinking of building a distributed data storage with a client/server architecture. 我正在考虑使用客户端/服务器体系结构构建分布式数据存储。 I want the client to associate keys (String) to values (byte[]), like a Map does. 我希望客户端将键(String)与值(byte [])关联,就像Map一样。 I want to do this in Java using sockets, threads and files. 我想使用套接字,线程和文件在Java中执行此操作。

How can i do this as simple as possible? 我如何做到这一点尽可能简单?

Thanks 谢谢

You really want to reinvent that wheel? 您真的想重新发明轮子吗?

If you're absolutely determined to do this, at least take a look at previous attempts (Cassandra for example is a distributed key-value store written in Java), and see what mistakes were made so you can improve on the effort. 如果您绝对愿意这样做,请至少看看以前的尝试(例如,Cassandra是用Java编写的分布式键值存储),并查看犯了什么错误,以便您可以改进工作。

To do it as simple as possible, use distributed hash table . 要使其尽可能简单,请使用分布式哈希表 You can implement your own, of course, but there is no easy way to do that. 您当然可以实现自己的实现,但是没有简单的方法可以做到这一点。

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

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