Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
quinthar
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
quinthar
10y ago
Every write transaction ever committed to the database is assigned a unique ID, and the most recent few million transactions are kept in a "journal" table. This is what allows nodes to figure out what happened while they were off
32.
▲
by
quinthar
10y ago
To be clear, my sense is that every replica would receive every transaction, and would be free to commit the transactions inside each batch in any order. Now I do agree that it's tricky to avoid "gaps" in the failure cases.
33.
▲
by
quinthar
10y ago
Well, perhaps "new" is relative. But yes, I think strong application design moves the queries into stored procedures that execute inside the database, exposing a higher-level interface to the application layer. This not only mai
34.
▲
by
quinthar
10y ago
The Paxos is only used to elect the master (or re-elect if the master fails). Once a master is established, it coordinates all distributed transactions centrally, which is very fast.
35.
▲
by
quinthar
10y ago
Hm... thanks for the head's up. I thought that SQLITE_CONSTRAINT would detect both read and write conflicts, but I'll dig deeper there. As for how much contention there will be, I'm not sure: that's one reason we have
36.
▲
by
quinthar
10y ago
Incidentally, if anybody has experience with this I'd love to know: 1) What happens if "mysqlfailover" itself dies? For example, if I have 6 servers split equally between 2 datacenters, and the datacenter running mysqlfailov
37.
▲
by
quinthar
10y ago
Oh, neat! That one seems to replace SQLite's storage engine with a custom one. But yes, also similar. Cool! Again, what is the largest real-world user? We've found a lot of the theories tend to break down when they are subjec
38.
▲
by
quinthar
10y ago
Here's a quick overview of how to configure in multiple zones: http://bedrockdb.com/multizone.html Security isn't provided by Bedrock (or really, any database, at least not well). Rather, with Bedrock security is
39.
▲
by
quinthar
10y ago
Thanks for all these links, I have some reading to do! Also, to clarify one point, we're not doing multi- master writes/replication -- just multi- threaded writes/replication. Incidentally, the latest plan is to use http:
40.
▲
by
quinthar
10y ago
I should get better stats. 4.5M users, 6 nodes split between 3 datacenters. Each node has 16 CPUs. 2158341079 total write transactions (over 8 years); not sure how many read (10-100x more?). I'll try to get better stats on peak rea
41.
▲
by
quinthar
10y ago
Yes, SQLite has transactions, and Bedrock runs all stored procedures in transactions. However, the Bedrock::DB plugin (which is just a single stored procedure: "query") doesn't expose transactions to the caller. So you coul
42.
▲
by
quinthar
10y ago
Re: SQLite -- Yes, Bedrock is just the replication layer, SQLite does all the SQL and storage. Re: Paxos -- It's our own implementation. Split brain is prevented by the master refusing to stand up unless a majority of configured (no
43.
▲
by
quinthar
10y ago
Cool, thanks! It looks like that came out in 2012? Neat, I'll take a look!
44.
▲
by
quinthar
10y ago
Haha, Bedrock has been in continuous development and production use (remember: this powers all of Expensify's and has since day one) for about 8 years. However, the public repo is very new. I'm not actually familiar with Rqlite,
45.
▲
by
quinthar
10y ago
Our PHP library has the concept of a primary and failover host. We recommend configuring a local Bedrock node as the "primary host", and then setting up a load-balanced pool of all nodes to be used as the "secondary host&quo
46.
▲
by
quinthar
10y ago
Thanks, strong comments welcome!
47.
▲
by
quinthar
10y ago
Yes, I think it does speak for itself. Thanks!
48.
▲
by
quinthar
10y ago
The Bedrock::Status plugin returns full status on its internal state, as well as the state of the other nodes it sees. We have Icinga monitor this to make sure the serve is not merely up, but in the correct state.
49.
▲
by
quinthar
10y ago
Re: SQLite's performance -- Can you point to anything that shows SQLite isn't the fastest for some class of query? In my experience (though admittedly I haven't formally benchmarked) it's at least as fast, and generally
50.
▲
by
quinthar
10y ago
Thanks for asking! Re: "SQLite can be beat really easily by the client/server systems since each SQLite instance only supports one concurrent writer" -- That's not actually true, sqlite supports concurrent writers via th
51.
▲
by
quinthar
10y ago
Out of curiosity, what specifically do you find idiotic about the document you linked to?
52.
▲
by
quinthar
10y ago
Well, with respect to stored procedures, I think C++ is a far more powerful language than MySQL's SQL-based approach -- especially since Bedrock plugins can also encapsulate schema changes. I think Bedrock's replication is definit
53.
▲
by
quinthar
10y ago
Incidentally, sqlite doesn't provide stored procedures, but Bedrock does (using a C++ plugin capability). Otherwise, SQLite is actually very feature rich; a subset of features are here: http://sqlite.org/fullsql.html
54.
▲
by
quinthar
10y ago
Yes, we've made a lot of good progress on this front, though nothing ready to demo. Multi-threaded replication is really exciting stuff. As it stands, our "selective sync" capability already gives a lot of headroom for wr
55.
▲
by
quinthar
10y ago
Agreed, benchmarks would be helpful to back up these claims. Good suggestion! I think the argument in favor of it being more reliable is an easier one, however, as Bedrock is specifically designed (and used, at scale, for 8 years) to provi
56.
▲
by
quinthar
10y ago
Heh, there's a lot of detail to be captured I agree. But in short: - All nodes connect to all other nodes - Each node has a priority; a Paxos algorithm is used to identify the highest priority node, which "stands up" to be t
57.
▲
by
quinthar
10y ago
Consistency is only an issue if you switch database servers mid session. Just "stick" to a node by issuing all subsequent requests to the same server and there are no consistency issues.
58.
▲
by
quinthar
10y ago
Discuss in real-time here: https://gitter.im/Expensify-Bedrock/Lobby
59.
▲
by
quinthar
10y ago
There's a bit of that here: http://bedrockdb.com/multizone.html But yes, lots more details to add over time. Thanks for asking!
60.
▲
by
quinthar
10y ago
Thanks for all that Latin! Yes, it's been open sourced for under 24 hours. Those are all good suggestions.
More ›