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.

Designing Schemaless, Uber Engineering’s Scalable Datastore Using MySQL

59 pointsby cosqlover 9 years ago

7 comments

pm24601over 9 years ago
The question I have is schema updates. The biggest pain I have had with things like Mongo is dealing with old data records.<p>Use case example for Uber:<p>1. In 2011, a driver joined. They made a bunch of trips<p>2. In 2012, Uber added more detail about the trip. Information not collected for the 2011 trips.<p>3. And so on, each year there are &#x27;just a few changes&#x27;<p>Given the above:<p>In 2016, Uber want to run a query to reward all drivers based on some piece of information that was only present in 2014 on.<p>At this point the historical trip information from 2011 is in a significantly different format than in 2016.<p>In a RDB, at least the old columns are there - or if the db was migrated to a new schema ( a pain ) the issue of the missing fields was addressed.<p>But dealing with data in old formats was an Uber pain. And the lack of visibility into <i>just</i> knowing the schema used to generate that JSON object is a PITA.<p>God forbid if you had <i>new</i> code that never even knew about the old 2011 format.<p>Lastly, what happens if a bug slips through and some JSON field is missing, has odd spelling ( capitalization wrong ), etc.<p>I would love to hear about how old data is handled in schemaless.<p>My experience with MongoDB was less than pleasant.
评论 #10898756 未加载
adrianbgover 9 years ago
Is it me or could they have done this way more easily by building some indexing and triggering functionality on top of Cassandra? Even two years ago when they started. Instead they built sharding, indexing, triggering and a Cassandra-like data model on top of MySQL.
评论 #10898662 未加载
评论 #10898594 未加载
评论 #10900379 未加载
bfrogover 9 years ago
Is it just me or is the reasoning behind the switch from postgres to mysql very vague? They describe a sharded mysql database... Sharding postgres isn&#x27;t necessarily any more difficult, instagram apparently uses it in a sharded manner with <i>many</i> shards. You&#x27;d think storing json in the pretty sweet jsonb column type in postgres would be a nice bonus for querying or indexing on.<p>I guess someone at uber must really like mysql, a good enough reason as any other I suppose. I&#x27;d love to hear about what other reasons as to why mysql turned out to be the choice here, as I&#x27;ve usually gone the other way (mysql to pgsql) for many of the great features and performance pgsql has.
评论 #10903417 未加载
wonkaWonkaover 9 years ago
God, what a name. A hyphen might be in order, as in:<p><pre><code> schema-less </code></pre> ...at first I read it as she-males.
评论 #10899786 未加载
评论 #10898724 未加载
NightMKoderover 9 years ago
An interesting system with very close semantics that Google built on top of bigtable: <a href="http:&#x2F;&#x2F;static.googleusercontent.com&#x2F;media&#x2F;research.google.com&#x2F;en&#x2F;&#x2F;pubs&#x2F;archive&#x2F;36726.pdf" rel="nofollow">http:&#x2F;&#x2F;static.googleusercontent.com&#x2F;media&#x2F;research.google.co...</a> . Since that&#x27;s built top of bigtable, you could in theory extend Schemaless to do 2PC for the cases that need it.<p>The implementation (using MySQL) seems very close to Vitess (<a href="http:&#x2F;&#x2F;vitess.io&#x2F;overview&#x2F;" rel="nofollow">http:&#x2F;&#x2F;vitess.io&#x2F;overview&#x2F;</a>) which manages mysql as a series of &quot;tablets&quot;, but exposes most MySQL features directly in the query language.
lobster_johnsonover 9 years ago
Odd that they chose MySQL, when they were previously using Postgres. In particular, Postgres&#x27; JSON support is so extensive (including indexing, which now is even more extensive [1]), and offers performance benefits over MySQL.<p>The advantage of MySQL in this situation is probably the support for multimaster replication.<p>[1] <a href="http:&#x2F;&#x2F;pgxn.org&#x2F;dist&#x2F;jsquery&#x2F;" rel="nofollow">http:&#x2F;&#x2F;pgxn.org&#x2F;dist&#x2F;jsquery&#x2F;</a>
trhwayover 9 years ago
main lesson - for a new generation of what would at first look seems like OLTP business, the OLTP pieces like transactional triggers and transactional indexes aren&#x27;t a requirement anymore. I.e. those requirements seems to go the same way - south - as the transactional consistency of search indexes had went several years ago.