Documente Academic
Documente Profesional
Documente Cultură
Abstract—Database is nowadays a crucial data storage for Generally, database could only be run with online mode.
application needs. Currently, there are several existing popular Nonetheless, the connection to database could not be always
databases such as relational database like SQL and non- guaranteed, as there might be possibility to lost connection
relational database (i.e. NoSQL). However, both types have their especially for mobile client. If the offline mode is permitted
own drawbacks which could not be utilized in both online and
between replicas, consistency and integrity issues will rise and
offline modes concurrently. Therefore, the authors develop a
database that supports both modes especially availability in conflicts might appear. Currently, very few databases provide
offline mode without sacrificing consistency. The database is offline mode. One of the examples is Riak, with the replication
integrated with CRDT (conflict-free replicated data types) and synchronization attached on the server. Whenever one of
algorithm to handle and solve conflicts in synchronization the server replicas should fail to connect, it still responds to
process. Some tools and technologies are used in the database incoming requests. Until the connection is recovered, Riak will
development including Apache Thrift for middleware, LevelDB perform synchronization.
for server database, and IndexedDB for temporary client Based on the useful advantages for offline usage, the
database. The purpose of this development is to build a CRDT authors aim to develop a scalable yet consistency-safe database
database with usable API for developer users. Finally, it is tested
with scenarios to satisfy essential operations: add, remove, and
that could be utilized in both online and offline modes, and the
update. replicas persist on client sides. In order to support the
development, an algorithm is used to solve the potentially
Index Terms—availability, CRDT database, offline update, emerging conflicts. CRDT, which stands for conflict-free
synchronization. replicated data types, is exploited for its ability to handle
conflicts. The database is designed and equipped with API for
I. INTRODUCTION developer users.
Database is an organized collection of data [13]. There are II. RELATED WORKS
popular databases used nowadays, for instance, relational and
non-relational database. Relational database [6] essentially uses A. CAP Theorem
the principle of ACID, which is atomicity, consistency, CAP theorem or known as Brewer Theorem stands for
isolation, and durability [8]. Nonetheless, some properties consistency, availability, and partition tolerance. Brewer claims
could not be satisfied completely in the real-world application. that it is impossible for a distributed system to guarantee all of
Relational database is basically designed to run on a single the characteristics at the same time. Two out of three
server. Hence, it is relatively not scalable. But then, further characteristics could only be satisfied as a trade-off [4][5]. If a
improvements came to develop distributed database with the system provides consistency and partition tolerance, it should
use of transaction. This indeed still does not solve the lose the availability aspect. This applies to the other two
scalability issue. possibilities. The illustration is shown in Fig 1.
On the other hand, there is non-relational database which
uses BaSE (basically available, soft state, and eventual
consistency) principle. This kind of database is intentionally
designed to be scalable, as opposed to relational database.
However, non-relational database is severely criticized for its
consistency. It guarantees the consistency no more than
relational database does.