Skip to content
Denis Tapyshpan edited this page Mar 22, 2015 · 9 revisions

Datastore Library

Motivation

We have many different widgets and sources of the data(social networks, alarm clock, day planner, etc.). They have to communicate with each other and with system(in both way, they can send and receive messages. For instance, somebody has wrote to us message in facebook, we have to reflect this event in corresponding widget and make some noise). This is place, where appear Datastore Library. We need it, to serialize message in some appropriate format while we sending it. And, to deserialize it, while we receiving it.

Goals

  1. Simple C++ API to store structured data in a storage and network neutral way.
  2. Handle data concurrency locally and remotely.
  3. Support Multiple Storage formats such as (XML/JSON/RDF/SQL/iCal.etc) and Storage handlers like (File system, DropBox, WebDav, iCloud .etc).
  4. Fast Async monitoring, notifications about data using C++11 features(lambda base event handling).
  5. Build relationships and Model Data without worrying about the storage type.
  6. Fast Searching and Link lookup.
  7. Handle concurrency and constancy of structured data.
  8. Platform independent and pure C++..
  9. Light weight and fast, directly embeddable within any application.

Use cases

  1. Save session data to disk or a network service.
  2. Cache Remote data.
  3. Sync data between remote instance of plexydesk.
  4. IPC (Inter-process communication).
  5. Save Application data to disk or network (Contacts, Calendar), settings, .etc
  6. Build relations ship between application data.
  7. Create application backups.
  8. Cloud messaging and Notifications

TODO

  1. Meta data attachment.
  2. Object level encryption.
  3. Variant type to easily handle common data types like strings, int, char, float, bool.

Technical Problem Statement

Input Format

std::string, that have inside JSON, XML, RDF, SQL, iCal, etc.

Output Format

DataObject, that we can use for interwidgets communications.

Solution

Architecture

Realisation

JSON(JSON Standart)

JSON Automaton

JSON Elements

  • 6 Structural Characters
  1. { - begin object
  2. } - end object
  3. [ - begin array
  4. ] - end array
  5. : - name separator
  6. , - value separator
  • Values
  1. numbers
  2. strings
  3. {false, null, true}
  4. array
  5. object
  • Object

An object structure is represented as a pair of curly brackets surrounding zero or more name/value pairs. A name is a string. A single colon comes after each name, separating the name from the value. A single comma separates a value from a following name. The names within an object SHOULD be unique.

  • Array

An array structure is represented as square brackets surrounding zero or more values. Values are separated by commas.

  • Coding Guidelines

Clone this wiki locally