DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

OrigoDB


OrigoDB is an in-memory event-sourced database engine for NET/Mono environments. It allows users to design custom data models to fit their needs. It is not optimized for performance, and prioritizes simplified commands over performance in some cases.[04][01][05]

Source Code
https://github.com/DevrexLabs/OrigoDB[02]
Developer
Country of Origin
SE
Start Year
2011 [25]
End Year
2016 [26]
Former Name
LiveDB
Project Types
Commercial, Open Source
Written in
C#
Embeds / Uses
MySQL
Operating System
Windows
License
MIT License

Database Entry

OrigoDB


OrigoDB is an in-memory event-sourced database engine for NET/Mono environments. It allows users to design custom data models to fit their needs. It is not optimized for performance, and prioritizes simplified commands over performance in some cases.[04][01][05]

History[06][07][08]


OrigoDB was last updated in December 2016 and is no longer active development. However, in June 2017, DevrexLabs created a new database (MemState), which it describes as a redesign of OrigoDB. MemState is still under active development.

Checkpoints


OrigoDB does not support checkpoints. However, it has the ability to take snapshots, which are similar to checkpoints. Snapshots can only be taken between writes and store a copy of the database in a file on disk. Unlike checkpoints, these are optional and are not needed to persist data.

Concurrency Control[09][10][11][12]


Transactions

OrigoDB has implicit transactions. Each read and write is treated as a separate transaction, and access to the database is controlled by a reader/writer lock. Writes are strictly sequential and take an exclusive lock on the database, and reads run concurrently using a shared lock. A custom command class can be used if several reads and writes need to be executed as a single transaction. OrigoDB supports fully ACID transactions on a single node. However, atomicity, isolation, and consistency are not guaranteed when data is partitioned across several nodes.

Immutability

OrigoDB has the option to use only immutable data structures in memory. Using this model, a write takes the state of the database as input and outputs a new state, which becomes the current state. When a read begins, it takes the current state as input, and uses this state for the duration of the read. Therefore, each transaction maintains its own copy of the database. Using this model, a read can occur concurrently with any other transactions (reads and/or writes), and at most one write occurs at a time.

Data Model[13]


OrigoDB supports several built-in data models. The built-in models are relational, document/XML, key-value pair, graph, Redis clone, and JavaScript. In addition to these generic data models, users can specify a custom data model using any .NET language. A custom model includes custom commands and queries. All data models are stored as strongly typed graphs.

Indexes[14][15]


Indexes can be created using C# collections, which are implemented as arrays, hash tables, or red-black trees.

Isolation Levels[16]


Queries are executed serially in the order they are received.

Joins


OrigoDB has no defined join operation for the pre-defined models. Users can choose to implement a custom in-memory join.

Logging[17][04][01]


Logging is determined by the configured persistence mode. In the default mode, commands are written to a log. When the system is launched, it must redo all logged commands to restore the previous state of the database. These log files can become very large, and the amount of time required to load the system is directly proportional to the size of the logs. Therefore, unless logs are regularly truncated, the time needed to load the system can increase significantly over time.

OrigoDB also supports two other persistence modes that take snapshots of the entire database rather than logging commands. In one mode, the user must explicitly specify when to take a snapshot. In the other, the system automatically takes a snapshot each time a command completes. While the snapshot is being created and stored, the system is temporarily read-only to ensure consistent snapshots. Even if one of these modes is selected, the system will still generate logs. Snapshots cannot be used with non-serializable data models.

Query Interface[18][12]


Queries can be written in C# or LINQ. Parametrized LINQ queries can be passed to a C# function, which fills in the arguments and executes the query.

Storage Architecture[19][20][21]


OrigoDB is completely in-memory. When the system starts, the entire database is loaded into memory. Because of this, the size of the database cannot exceed the amount of RAM available.

Data Persistence

All information about the database is stored in memory, with periodic writes to disk. Information is stored using write-ahead logging, with the option of also taking snapshots of the state of the entire system. When the system starts, this information is used to load the database into memory. If snapshots are being used, the most recent snapshot is loaded. Otherwise, the logged commands are replayed to restore the state of the database. The time needed to load the database is directly proportional to the size of the snapshot or the size of the logs, so the amount of time needed can increase significantly over time.

Disk Storage Options

By default, data is stored in a user-specified directory in the file system. Each snapshot is stored as a single file. Logs begin with a single file, and more files are added as needed.

The logs can also be stored as a relational database using MySql or OleDb. Some of the documentation indicates that there is also support for MongoDB, RavenDB, and Azure, but there is no support for these in the source code. However, users can define a custom object to use other databases. This option is not available for snapshots.

Stored Procedures[22]


System Architecture[09][23][24]


When multiple nodes are used, one node functions as the primary node, and all others are replicas. Each replica can be configured to sync with the primary synchronously or asynchronously. In addition, each replica is specified to be in either read-only or on standby. A read-only replica can complete read-only queries, and a standby replica cannot process any queries. A replica can be promoted to primary manually if the primary fails or needs to be taken down for maintenance. However, a replica will not be promoted automatically if the primary node fails.

Citations

26 sources
  1. Start - OrigoDB origodb.com
  2. GitHub - DevrexLabs/OrigoDB: In-memory event-sourced database engine for NET/Mono · GitHub github.com
  3. OrigoDB Documentation - OrigoDB origodb.com
  4. FAQ - OrigoDB origodb.com
  5. Performance - MEMSTATE memstate.io
  6. Commits · DevrexLabs/memstate · GitHub github.com
  7. Commits · DevrexLabs/OrigoDB · GitHub github.com
  8. memstate/README.md at master · DevrexLabs/memstate · GitHub github.com
  9. Partition Client - OrigoDB origodb.com
  10. Immutability - OrigoDB origodb.com
  11. Transactions - OrigoDB origodb.com
  12. Authoring commands - OrigoDB origodb.com
  13. Modeling - OrigoDB origodb.com
  14. What data structures the .NET collections use - Growing with the Web growingwiththeweb.com
  15. Basic Modeling - OrigoDB origodb.com
  16. OrigoDB from an RDBMS perspective - OrigoDB origodb.com
  17. IMDB showdown - comparing OrigoDB, Redis and SQL Server Hekaton - Robert Friberg | Videos & Movies on Vimeo vimeo.com
  18. Compiled Linq Queries - OrigoDB origodb.com
  19. Storage - OrigoDB origodb.com
  20. Introduction - OrigoDB origodb.com
  21. IMDB Showdown - OrigoDB, Redis and Hekaton | PPTX slideshare.net
  22. Conference and user group presentations - OrigoDB origodb.com
  23. Replication - OrigoDB origodb.com
  24. 509 Bandwidth Limit Exceeded herdingcode.com Dead — Check Archive
  25. Initial check in github.com
  26. fixed markdown highlight bug in docs github.com
Revision #16 Last Updated: