2 Copyright (c) 2018-2019 Nokia.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
20 * @section introduction_sec Introduction
22 * Shared Data Layer provides a lightweight, high-speed interface for accessing shared
23 * data storage. The purpose is to enable utilizing clients to become stateless,
24 * conforming with, e.g., the requirements of the fifth generation mobile networks.
26 * @section concepts_sec Concepts
28 * @subsection namespace_sec Namespace
30 * A shared data layer connection is instantiated to a namespace and data is always
31 * read and modified within the namespace. Namespace provides data isolation across
34 * Namespace management is planned to be moved under a managing entity, a shared data
35 * layer manager of sort, which handles the namespaces within a cluster, enforcing
36 * some control over how the namespaces are created, utilized and load balanced as well
37 * as dynamically scaling the underlying data storage resources. For now, however,
38 * namespace naming needs to be manually coordinated between clients.
40 * @subsection data_sec Keys and data
42 * Clients save key-data pairs. Data is passed as byte vectors, any structure that
43 * this data may have (e.g. a serialized JSON) is meaningful only to the client itself.
44 * Clients are responsible for managing the keys within a namespace.
46 * @section compiling_clients_sec Compiling clients using shareddatalayer APIs
48 * The necessary compilation flags and libraries needed for compiling using shareddatalayer
49 * APIs can be acquired with the <code>pkg-config</code> tool:
52 * pkg-config --cflags libsdl
53 * pkg-config --libs libsdl
56 * @section usage_sec Usage
58 * @subsection async_api_sec Asynchronous API
60 * shareddatalayer::AsyncStorage API is used to access SDL data asynchronously.
62 * Instance is created with shareddatalayer::AsyncStorage::create() function.
64 * Functions shareddatalayer::AsyncStorage::fd() and shareddatalayer::AsyncStorage::handleEvents()
65 * are used to integrate SDL to client's event loop.
67 * Optionally client may verify/wait that SDL (the database service in practice) is ready
68 * with shareddatalayer::AsyncStorage::waitReadyAsync() function.
70 * @subsection sync_api_sec Synchronous API
72 * shareddatalayer::SyncStorage API is used to access SDL data synchronously.
74 * Functionally it is similar to AsyncStorage, with an exception that functions are blocking while
75 * waiting response(s) from database.