TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

ActorDB – Distributed SQL database

284 pointsby iamd3vilalmost 7 years ago

25 comments

atombenderalmost 7 years ago
ActorDB is a neat project. Simplified, it&#x27;s a distributed SQLite where consistency is guaranteed by the Raft protocol.<p>However, it has a unique and initially confusing data model where the database is divided into &quot;actors&quot;, which are self-contained shards. For example, a database modeled on Hacker News would probably have an actor per user and an actor per story, and probably an actor per thread.<p>Every actor acts like a self-contained database, with its own set of tables. When you want to query or update data, you first tell it which actor(s) to operate on; but unlike systems like Cassandra, the sharding is explicit, in that the shards have identifiers, and there&#x27;s no automatic sharding function. Indeed, you can have actors that act like a basic database, e.g. a global, shared list of lookup values could be a single actor.<p>You have ACID transactions within actors, and you can also do transactions across actors, and queries can also span multiple actors. You can&#x27;t do joins across actors, as far as I recall. Schema migrations also become interesting, since each actor has its own, entirely separate schema.
评论 #17333389 未加载
评论 #17333298 未加载
评论 #17336177 未加载
thanatos_demalmost 7 years ago
Digging through the docs, I can&#x27;t find any actual information of the consistency and isolation guarantees other than &quot;consistent&quot; and &quot;ACID&quot;. That&#x27;s an immediate red flag for me. What are the actual isolation characteristics of the database?<p>Does it use snapshot isolation? Is it serializable? Is it linerizable? With all the great work Kyle Kingsbury (aka Aphyr) has done on the Jepsen tests, it&#x27;s pretty clear that claiming to be &quot;ACID&quot; with no additional info isn&#x27;t sufficient for a modern database.
评论 #17332763 未加载
评论 #17333426 未加载
malisperalmost 7 years ago
ActorDB sounds like an interesting piece of software. It looks like it&#x27;s good for simple applications that have large amounts of data. Some thoughts I have based on the docs:<p>ActorDB has no concurrency at the actor level. This makes it a poor fit for applications that have lots of concurrency around the same pieces of data. A long running read or write on a single actor will lock out any other reads or writes.<p>Likewise, distributed transactions lock all actors involved in the transaction until the transaction completes.<p>It seems like reads have to go through a round of Raft. This increases latency for reads. It also decreases throughput, although I&#x27;m not sure how big of a deal that is given the lack of concurrency.<p>It&#x27;s unclear to me how ActorDB guarantees serializability for multi-actor transactions. You need some way to guarantee two multi-actor transactions will execute in the same order on every actor. Based on the docs, Raft is performed at the actor level and not across multiple actors. ActorDB does use two-phase commit to guarantee atomicity across multiple actors, but there&#x27;s no description of how it handles serializability.<p>Based on my reading, ActorDB is good if you have lots of data and your queries have either low concurrency and you don&#x27;t require high throughput. If you have high concurrency or require high throughput, my guess is ActorDB will be a poor fit.
gregwebsalmost 7 years ago
They have an introductory blog post that explains the database fairly well (summary: it was designed for a shard per user): <a href="http:&#x2F;&#x2F;blog.biokoda.com&#x2F;post&#x2F;112206754025&#x2F;why-we-built-actordb" rel="nofollow">http:&#x2F;&#x2F;blog.biokoda.com&#x2F;post&#x2F;112206754025&#x2F;why-we-built-actor...</a><p>If you are looking at distributed SQLite solutions there is also rqlite&#x2F;dqlite and bedrock.
adamluzsialmost 7 years ago
I used to work with Pivotal&#x27;s Greenplum, which is also a distributed db, and I quiet liked it. Basically a postgresql with syntax sugar on partition , and distribution across servers. I had the pleasure to never need any index in the database.<p>This sounds to be an interesting project as well.<p>The question to me always about &quot;how this will makes the project that use it have little learning curve for the new recruits, easy to understand integration in the code level and low maintenance on the long run&quot;
codeadictalmost 7 years ago
Great to see more databases written in Erlang.
评论 #17332423 未加载
评论 #17332765 未加载
评论 #17332681 未加载
01walidalmost 7 years ago
How does this compare to CockroachDB?
评论 #17333829 未加载
评论 #17333163 未加载
mappualmost 7 years ago
Another popular SQLite + Raft project is rqlite ( <a href="https:&#x2F;&#x2F;github.com&#x2F;rqlite&#x2F;rqlite" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rqlite&#x2F;rqlite</a> ), but the goals seem slightly different (rqlite only uses distribution for fault-tolerance, not for sharding).
sessyalmost 7 years ago
Any idea if the creators will offer this &quot;as-a-service&quot; in the near future. How does this compare to Google&#x27;s Spanner?
评论 #17332126 未加载
pknopfalmost 7 years ago
What part of CAP is being sacrified here? I&#x27;m not seeing it.
评论 #17332194 未加载
thomasfedbalmost 7 years ago
An &#x27;explicitly sharded&#x27; SQL database - effectively as many databases as you need with some special sauce to let you run transactions across multiple shards. Neat.
评论 #17332743 未加载
评论 #17332159 未加载
crudbugalmost 7 years ago
I think the data model is similar to virtual actors [0] which have persistent state. There is also CLR and JVM specific implementations of this model.<p>[0] <a href="https:&#x2F;&#x2F;www.microsoft.com&#x2F;en-us&#x2F;research&#x2F;project&#x2F;orleans-virtual-actors&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.microsoft.com&#x2F;en-us&#x2F;research&#x2F;project&#x2F;orleans-vir...</a>
vincentmarlealmost 7 years ago
&gt; Think of running a large mail service, dropbox, evernote, etc. They all require server side storage for user data, but the vast majority of queries is within a specific user.<p>I have this exact use case for a new project I’m working on so I’m fine with the 1-db-per-user approach. ActorDB definitely sounds very interesting, but are there any alternatives to compare it with?
评论 #17333117 未加载
coleiferalmost 7 years ago
Anybody using this in production? What particular problem were you solving with actordb?
gigatexalalmost 7 years ago
The readme sounds like it promises the end to all databases. I’d like to play with it.
评论 #17333659 未加载
评论 #17332836 未加载
tybitalmost 7 years ago
How do schema upgrades work? It looks like a specific actor type is tied to a specific schema but I assume the schema upgrades must be eventually consistent unless they are using 2 phase commit across all actors of the type?
评论 #17336204 未加载
aisoftengalmost 7 years ago
SQLite with Raft. Nice project.
EGregalmost 7 years ago
ActorDB might be great for distributed systems. How does it compare to CocktoachDB? The latter does transaction planning across shards?<p>None of these DBs seem to be byzantine fault tolerant, though. Any examples of BFT databases?
评论 #17333942 未加载
gigatexalalmost 7 years ago
Building on SQLite means no windowing functions which is a deal killer for me.
aleccoalmost 7 years ago
&gt; with the scalability of a KV store, while keeping the query capabilities of a relational database.<p>So not doing good query performance for OLAP&#x2F;DS. And &quot;core&quot; DB is in Erlang.
评论 #17332720 未加载
nine_kalmost 7 years ago
I wonder how hard would it be to replace SQLite with Postgres or Maria. It would add interesting in-actor query capabilities.
polskibusalmost 7 years ago
I wonder what are the benefits in comparison to using Akka Persistence with whatever database you want?
评论 #17332216 未加载
nickmancolalmost 7 years ago
jacksmith21006almost 7 years ago
Another option for scaling SQL is the Vitess OSS. Might give it a look. Uses a similar pattern of using an actor up front and then scaling MySQL on the back-end.<p><a href="https:&#x2F;&#x2F;vitess.io&#x2F;overview&#x2F;" rel="nofollow">https:&#x2F;&#x2F;vitess.io&#x2F;overview&#x2F;</a><p>Would like a similar solution but with Postgres on the back end instead.
yeukhonalmost 7 years ago
Yet another distributed database. How many more do we need? <i>Time to just hide in the cave again.</i> ¯\_(ツ)_&#x2F;¯