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 8107849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:54:33+00:00 2026-06-06T00:54:33+00:00

Although appengine already is schema-less, there still need to define the entities that needed

  • 0

Although appengine already is schema-less, there still need to define the entities that needed to be stored into the Datastore through the Datanucleus persistence layer. So I am thinking of a way to get around this; by having a layer that will store Key-value at runtime, instead of compile-time Entities.

The way this is done with Redis is by creating a key like this:

private static final String USER_ID_FORMAT = "user:id:%s";
private static final String USER_NAME_FORMAT = "user:name:%s";

From the docs Redis types are: String, Linked-list, Set, Sorted set. I am not sure if there’s more.

As for the GAE datastore is concerned a String “Key” and a “Value” have to be the entity that will be stored.

Like:

public class KeyValue {
 private String key;
 private Value value; // value can be a String, Linked-list, Set or Sorted set etc.
 // Code omitted
}

The justification of this scheme is rooted to the Restful access to the datastore (that is provided by Datanucleus-api-rest)

Using this rest api, to persist a object or entity:

POST http://datanucleus.appspot.com/dn/guestbook.Greeting
{"author":null,
  "class":"guestbook.Greeting",
  "content":"test insert",
  "date":1239213923232}

The problem with this approach is that in order to persist a Entity the actual class needs to be defined at compile time; unlike with the idea of having a key-value store mechanism we can simplify the method call:

POST http://datanucleus.appspot.com/dn/org.myframework.KeyValue
{ "class":"org.myframework.KeyValue"
  "key":"user:id:johnsmith;followers",
  "value":"the_list",
}

Passing a single string as “value” is fairly easy, I can use JSON array for list, set or sorted list. The real question would be how to actually persist different types of data passed into the interface. Should there be multiple KeyValue entities each representing the basic types it support: KeyValueString? KeyValueList? etc.

  • 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-06-06T00:54:35+00:00Added an answer on June 6, 2026 at 12:54 am

    Looks like you’re using a JSON based REST API, so why not just store Value as a JSON string?

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

Sidebar

Related Questions

Although I know there is already a Blob service for Appengine, I want to
Although I know that there are more idomatic ways of doing this, why doesn't
I have ran into 2 situations already that feel like they could be solved
I've created a filter to in my java webserver (appengine actually) that logs the
I need to store a large and dynamic undirected graph in google appengine, what's
I'm working with a app that has both online datastore(GAE) and an offline datastore(HTML5
I've already read how to avoid slow (cold) startup times on AppEngine, and implemented
Although this question fancies PostgreSQL, it is still a general DB question. I have
There are various method of appending text to files, although I was wondering if
Although I get it that $a = new b() would be initializing an object

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.