Code Monkey home page Code Monkey logo

kora's Introduction

Kora

Build Status

What is it?

Kora is a programmable, real-time database that allows you to store and sync data across all clients both online and offline. Clients (iOS, Android, Web, Servers) can directly connect to Kora and securely read and write data from the system. Data can also be persisted locally so it is available even if the device goes offline and once it regains connection, Kora will synchronize the missing changes and resolve conflicts automatically.

The major difference between Kora and other systems like Firebase or CouchDB is its Interceptor Framework. This framework provides a way to extend the database by adding hooks that take care of typical API challenges like validating/authenticating input, denormalizing data, and triggering events like Push Notifications or mirroring data into other sources. This allows for a generic backend while still preserving the ability to keep shared logic on the server instead of duplicating it on the clients. Since this framework is low-level it can be extended by building a rules engine on top that allows for permissions or denormalization rules to be specified using markup instead of code.

Data Model

All data in Kora is stored as one huge tree. It can be thought of as one big object. Fields can be merged in or deleted and clients can subscribe to sections of the tree and will be notified of any changes underneath them. Subscriptions can also be stored in the tree for automatic bootstrapping of connections.

Example

{
	'user:info': {
		'dax': {
			name: 'Dax',
			company: 'ironbay',
		},
		'yousef': {
			name: 'Yousef',
			company: 'ironbay',
		}
	},
	'company:info': {
		'ironbay': {
			name: 'Ironbay',
			city: 'New York',
		}
	},
	'company:employees': {
		'ironbay': {
			'dax': 1493337757300,
			'yousef': 1493337757300,
		}
	}
}

As you can see Kora encourages proper NoSQL data modeling through denormalization. That means data is written in multiple ways for all the ways it needs to be queried to avoid costly query scans. If we want to find all the employees of company ironbay we maintain a list of that result instead of scanning user:info and filtering. While this may seem tedious at first, the Interceptor Framework greatly reduces the boilerplate needed to build well denormalized data models.

Kora also supports multiple storage modes and can store data in Cassandra, Postgres, or MySQL.

Setup

Kora is written in Elixir and built on top of Erlang OTP to provide a fault tolerant distributed system that doesn't lose data. You can read more about why erlang matters here. This means today we support extended Kora through Interceptors written in Elixir, however there are plans to support other languages. That said Elixir is an awesome language with a lot of great ideas that is worth learning.

Kora is provided as a library that you can add to your elixir project like any other library.

{:kora, github: "ironbay/kora"}

Configuration

TODO

kora's People

Contributors

thdxr avatar vaprdev avatar janajri avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.