Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6938035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:26:26+00:00 2026-05-27T12:26:26+00:00

Hi have the following interface: public interface KeyValueStore { public void put(String key, byte[]

  • 0

Hi have the following interface:

public interface KeyValueStore {
    public void put(String key, byte[] value);
    public byte[] get(String key);
    public void putAll(Map<String,byte[]> pairs);
    public Map<String,byte[]> getAll(Collection<String> keys);
}

And I have the following client that implements the previous interface:

public class Client implements KeyValueStore{

    @Override
    public void put(String key, byte[] value) {
    }

    @Override
    public byte[] get(String key) {
    }

    @Override
    public void putAll(Map<String, byte[]> pairs) {

    }

    @Override
    public Map<String, byte[]> getAll(Collection<String> keys) {
    }
}

How can I implement the Client in order to interact with the given interface? I want to do this with a client-server architecture.

Another thing I want is a “name server” that knows where the data is stored (basically it has the mapping of keys to “storage servers”), and several other servers where the data is actually persisted.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:26:26+00:00Added an answer on May 27, 2026 at 12:26 pm

    This is quite an open-ended question. I’ll take a shot at it.

    I think you need to keep three different concepts in mind:

    Interface
    Implementation
    Client

    Let’s look at each one.
    You have the interface already, so it’s all good on that part.

    What you’re calling the client, I believe to be the implementation, meaning: it’s the actual code that implements the behavior of the methods defined in your interface.

    A client (in my interpretation), would be yet another piece in your system, that interacts with your Interface through the implementation that you’ll write.

    Addressing your question:
    First step would be figuring out how you’ll persist the data introduced through put and putAll. If you just want to keep some stuff in memory, then a Map will probably suffice. If the number of entries is expected to grow alot, then you probably want to make the implementation interact with a database (or other form of persistence).

    Does this add some light on your question? Add some more details, and I’ll give more insight if I can.

    Hope it helps.

    Edit:

    A distributed storage system has quite a few variables brought to the table.

    Do you have a centralized endpoint that then chooses where the data will be stored in some way (round-robin or some more complex algorithm)?

    How will the clients interact with your system? Is it a web-based system, RMI, something else?

    I think you need to focus on the basic architecture before thinking of the actual implementation, since the main problems with a system like this is robustness and handling flaws.

    One possibility is having a “name server” that knows where the data is stored (basically it has the mapping of keys to “storage servers”), and several other servers where the data is actually persisted. You need to choose how these will communicate between them, or if each server will be both a “name server” AND a “storage server”… there’s really a lot of possibilities here!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following: public interface ICartItem { string Name { get; set; }
I have the following interface: public interface ILogger { void Debug(string message, params object[]
I have defined the following interface: public interface IHaveAProblem { string Issue { get;
I have the following interface: public interface Iface { void Sample1(); void Sample1(bool value);
Consider I have the following interface: public interface A { public void b(); }
I have the following Interfaces: public interface ITemplateItem { int Id { get; set;
Say I have the following: namespace SomeProject { public interface ISomething { string SomeMethod();
I have the following code: import com.apple.dnssd.*; public interface IServiceAnnouncer { public void registerService();
Let's say that I have the following interface: public interface IMyService { void SimpleMethod(int
I have the following interface public interface DeviceKey { String getKey(); } I also

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.