[erlang-questions] Mnesia

zxq9 <>
Wed Oct 14 02:03:20 CEST 2015


On 2015年10月13日 火曜日 13:46:14  wrote:
> Hello,
> 
> During a break at the Chicago Erlang Workshop Fred Hebert mentioned that Mnesia is a fine database for the 1990s.
> 
> Mnesia was a major draw when I was first attracted to Erlang in part because I hate transiting syntactic boundaries when I'm programming.
> 
> I asked Fred what it would it take to upgrade Mnesia for the 21st century (or, at least, for the next decade). He didn't know.
> 
> Martin's list of negatives may be a good place to start. 
> 
> So, just how much effort and knowledge would it take to overcome or ameliorate these and other unspecified negatives of Mnesia to produce Mnesia2?

As with any view, perspective is what drives the perception of utility.

If we assume that the only thing that matters is web applications or server-oriented architectures where every potential user in the world is going to be pounding the crap out of a central data center or, even worse, a floating set of vaguely provisioned services within something like AWS, then sure. Maybe Mnesia isn't the thing for that, and certainly a LOT of development is focused on that case.

Most of that development is iterative rehashes of what everyone else has already done, though. This is a red flag to me. Social networks, messaging systems, click analytics, GIS frameworks for click analytics, and lots of other things called "analytics" but really boil down to adtech, adtech, adtech, adtech, and some more adtech, and marketing campaigns about campaigns about adtech.

The elephant in the room being that the ad market is falling apart because it isn't worth anything near like what we imagined. If views were what mattered it would be impossible for Twitter to be in such trouble, Arstechnica be struggling to maintain its editorial standards, or sites like Huffington Post and Forbes to be forced to display clickbait panels and load 40 ~ 70 third party plants per page load.

For this case -- the forefront of tech buzz and where a huge, and very publicly visible percentage of investment and development effort go -- maybe Mnesia is not the best tool.

But for other use cases it is immensely useful, *especially* as a live cache with db features. Small and medium business represents about ~ 90% of the activity in many economies. Here in Japan the figure floats around 92%; in the US it is something comparable. When small businesses latch on to a solution that *actually* helps them become more efficient (instead of shelling out for yet another upgrade to a spreadsheet program that will be used to do exactly what they would have done with a spreadsheet in the 80's -- or even funnier, for a version of that spreadsheet that still does the same things, but slower, in a browser), and that solution becomes widespread enough to have an actual impact *the entire economy* improves without anyone really noticing why.

That is AMAZING. This is much more interesting than chasing click statistics in the interest of brokering ad sales at the speed of light so that users can continue to ignore them.

I mention the SMB use case because it is one with which I am familiar. Fred holds his views because of the sector he deals with. Mnesia is by no means the *only* database useful in developing for the SMB market, but it is a profoundly useful tool among several necessary to make cross-platform development for SMBs a non-suicidal task. A hilariously low percentage of tech investment targets the SMB market (aiming instead at huge business, the web, and the consumer electronics tie-in (the only interesting part of the list)), and there are accordingly very few tools available to make development for that market reasonable.

[Insert rant about the deleterious effects of a legally enforced monopoly on small business software.]

So is mnesia a db for the 1990s? Maybe. I don't know. That is a very broad (and totally unqualified) statement to make, so it is hard to argue about. I suppose Postgres, Oracle, DB2 and anything else with a schema fall in the same category, but last I heard those were pretty darn useful for a wide variety of very real problems people experienced in the 1990s and continue to experience today. What I can say for certain is that I continue to find Mnesia to be of profound utility today, in 2015, whether or not it is "a good database for the 1990s". The *variety* of data I have dealt with in business is so broad that no single database paradigm, and certainly no particular database system, can manage it. Not reasonably, anyway. I'm not aware of any other systems that compare very well with Mnesia in functionality, especially interoperating with Erlang (or almost any language/runtime) the same way, so its hard to compare. That leaves Mnesia in the "unique tool" category, as opposed to the "easy to compare within a commodity market of similar alternatives" category.

-Craig


More information about the erlang-questions mailing list