Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Korea raises data breach fines to 10% of revenue(koreajoongangdaily.com ↗)
    20comments
  2. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    93comments
  3. Cloudflare Quick Tunnels(cloudflare.com ↗)
    192comments
  4. Saving another 100TB of RAM with math (and Rust)(cloudflare.com ↗)
    10comments
  5. Apple releases iPhone Duo simulator and Xcode 27.1 beta(developer.apple.com ↗)
    31comments
  6. Cache-to-Cache: Direct Semantic Communication Between Large Language Models(arxiv.org ↗)
    6comments
  7. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    35comments
  8. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    59comments
  9. OpenJev(openjev.com ↗)
    233comments
  10. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    10comments
  11. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    141comments
  12. Our brain evolved from two primitive nervous systems that merged: Study(newscientist.com ↗)
    37comments
  13. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    17comments
  14. Border agents can search cellphones without a warrant or reasonable suspicion(lawandcrime.com ↗)
    71comments
  15. I vibed a proof of Conway's conjecture(overreacted.io ↗)
    164comments
  16. How SpaceX streamlined the Raptor engine(construction-physics.com ↗)
    13comments
  17. North Korean nuclear test sets off years of earthquakes(science.org ↗)
    135comments
  18. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    84comments
  19. Minimal Phone 2(minimalcompany.com ↗)
    105comments
  20. Show HN: Ax-check.com – Can agents use your product?(ax-check.com ↗)
    22comments
  21. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    8comments
  22. A search-and-inference database from scratch in pure Zig(antfly.io ↗)
    6comments
  23. US Military had close call after using AI for hallucinated intelligence report(cnn.com ↗)
    224comments
  24. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  25. How to Write with an LLM(sockpuppet.org ↗)
    212comments
  26. Show HN: Scry, programmable internet search w/ congestion pricing(scry.io ↗)
    15comments
  27. "From Geometry to Algebra and Back Again: 4000 Years of Papers" by Jack Rusher [video](youtube.com ↗)
    discuss
  28. Jemalloc 5.4.0(github.com/jemalloc ↗)
    85comments
  29. Mathematicians Build Long-Awaited Graph Sandwich(quantamagazine.org ↗)
    16comments
  30. The scourge of x86 emulation(fex-emu.com ↗)
    73comments

The Architecture of Schemaless, Uber Engineering’s Trip Datastore Using MySQL

29 pointsby 10y agoeng.uber.com
21 comments
10y agoHN ↗

Apologies if you're just linking that for reference, but this is a 2nd article in the series.

10y agoHN ↗

Anyone want to weigh in on whether or not Postgres is a viable option for this?

10y agoHN ↗

Might be a case of MySQL natively supporting multi-master replication, whereas with Postgres you have to use a third-party/commercial solution.

Especially if you're not using any particularly advanced Postgres features, the operational simplicity of having built-in multimaster replication might outweigh any PG benefits.

10y agoHN ↗

Are they actually using multi-master replication? I gleaned from the article series that they have many small independent MySQL clusters, each with one master and two slaves, and that their worker layer handles requesting data from the correct cluster for whatever shard a request routes to. Writes to a cluster can only go the master. So this seems more like a single-master design, just replicated a bunch but without the masters communicating with each other.

That said, I haven't used MySQL much at all. Am I just missing something or misunderstanding what multi-master means in the context of MySQL?

10y agoHN ↗

Only semi-related, I've discerned a Postgres > MySQL/MariaDB sentiment on HN for the last year or so. Is that just my imagination? If not, why is that? MySQL in my experience is a very powerful RDBMS, maybe I just haven't run up against its limitations.

10y agoHN ↗

There's probably a couple reasons, but I'll summarize my experiences with them.

I haven't dug into MySQL for a few years (last I really worked with it was 5.5), but out of the box, it does a lot of things that are pretty unsafe or encourage bad practices, such as truncating data when it's longer than the column size, inserting the zero-value for a NOT NULL column rather than erroring when a NULL is inserted, confusing timestamp column behavior, no DDL-level transactionality, etc. Additionally, and not necessarily a bad thing, but it has made some odd implementation and feature decisions that can be (IMHO) counter-intuitive or have a large impact, particularly with regards to how foreign keys get implemented, but also with things like not having schemas (database > tables, rather than database > schemas > tables), not having a boolean type, its datatype specification (int(1) means an integer that displays only a single digit, rather than denoting storage sizes), or the fact that every ALTER TABLE causes a complete on-disk table rewrite.

PostgreSQL, on the other hand, makes every attempt to keep 100% data integrity at all times, has a lot of killer features (probably the best date/time math implementation I've ever used, typesafe operators, etc), is generally very extensible, and most importantly, is extremely predictable. True, it doesn't have the same scalability features out of the box that MySQL does, but that's getting better every release, and as mentioned elsewhere, there's plenty of adequate third-party tooling available (e.g. Slony).

I think MySQL is very much so the PHP of the RDBMS world - it does a lot of silly stupid stuff - mostly for historical reasons - but in the hands of someone who knows how to use it properly, it can be an extremely useful tool. Postgres just defaults to being an extremely useful tool out of the box without needing to know all the gotchas that come with it.

10y agoHN ↗

I haven't dug into MySQL for a few years (last I really worked with it was 5.5), but out of the box, it does a lot of things that are pretty unsafe or encourage bad practices, such as truncating data when it's longer than the column size, inserting the zero-value for a NOT NULL column rather than erroring when a NULL is inserted, [..]

This is no longer the default in MySQL 5.7.

10y agoHN ↗

The short version is, Postgres is developed under the "do it right, then make it fast" philosophy, for the most part. Early versions of MySQL were like, "ACID? Pbbbbbbbbbt." So they treated your data like it was essentially worthless and it could lose it at about any time. For a lot of applications built on hardware at the time and the needs at the time, the data really was kinda worthless and so people built stuff on it anyway. But a lot of people remember those early days when MySQL was a pretty crappy database that just happened to be fast and scale out well. MySQL has mostly caught up to Postgres in the whole "not losing data" sense, and is catching up in terms of SQL features as well (although I wish it had CTEs, among many other things). Postgres has made a lot of advances in speed and scalability too, but still lacks some of what MySQL has in terms of clustering and the like without using plugins or add-ons.

10y agoHN ↗

Part 1 of the article said: "Our new solution needed to be able to linearly add capacity by adding more servers, a property our Postgres setup lacked."

From that, I think we can presume that it was more straightforward to go with MySQL multimaster replication rather than the 3rd-party solutions required for PostGreSQL which are not as mature.

10y agoHN ↗

Can you please stop? Postgres is great and all. But people use MySQL for valid reasons, web scale is one. And InnoDB is a very very good DB engine for that task.

10y agoHN ↗

"web scale is one"

Does "web scale" actually mean anything? I thought it was just a piss take from the "MongoDb is web scale" cartoon.

10y agoHN ↗

i don't think people actually use the expression "web scale" seriously, but i can't tell if they're joking. poe's law or something.

10y agoHN ↗

He sounded pretty serious in that post. Maybe I missed the joke.

10y agoHN ↗

Since Schemaless uses MySQL asynchronous replication, the write will be lost if a master receives a write request, persists the request, and then fails before it has replicated the write to the minions (e.g., in a hard drive failure). To solve this problem we use a technique called buffered writes. Buffered writes minimize the chance of losing data by writing it to multiple clusters. If a master is down, the data is not readily available for subsequent reads but has nevertheless been persisted.

Postgres has the same replication semantics as MySQL async replication. So yes, if you want to build something like this, you could.

However, the question you should be asking yourself isn't "could you" but "should you".

The answer is probably not.

Multi-master setups are extremely difficult to build reliably and unless you understand them extremely well you can frequently shoot yourself in the foot with something that seems right but really is only right for a handful of use cases.

10y agoHN ↗

I've been following these Uber engineering articles, and I think this is a very neat architecture. Append only + boring technology = solid stuff.

I'm curious to know how many shards per storage cluster they use and how this mapping is done. Is it fixed or can it change? I imagine a startup trying to use a similar setup could start with a few storage clusters, but then add more clusters as needs grow...

They say they use 4096 shards (presumably generated based on some part of `row_key` which is the trip id), but I'm not sure this is a generally-applicable strategy. e.g. if sharding in a social netowrk website is performed based on `user_id` then won't be able to do joins across `user_id`s.