Example

Take the Notepad application as an example. This application supports data access through browsers and mobile clients. The following is a table design in reference to a relational database:

CREATE TABLE note (
  userId VARCHAR(64) NOT NULL,
  noteId INT8 NOT NULL, -- increment ID
  title VARCHAR(256),
  content VARCHAR(2048),
  version INT,
  mtime BIGINT, 
  category VARCHAR(16),

  PRIMARY KEY(userId, noteId),
  INDEX(userId, mtime), -- change time index
  INDEX(userId, category) -- category index
);

Assuming the application has 4 access modes:

  1. According to noteId, query on a note for detailed information

  2. Save details of a note according to noteId (conditions can be written to version to check for concurrent modifications)

  3. Based on modification time of the note to scan paging for query. Only title is shown. User can click to view further details of the note

  4. Query based on the category label of the notes

  5. Table definition

    For this application, it can be converted into the table definitions of SDS:

      • Entity group key - userId*, for starting hash distribution
    • Primary Key - noteId, reverse coding
    • Time modification index - mtime, reverse encoding, eager type index. Projection of title and noteId
      • Category index - category, lazy* Type index

This guide's API will use this table as a standard example for elaboration.

results matching ""

    No results matching ""