Live data from Hacker News

Now that people are considering NOSQL will more people consider no-DB

martinfowler.com

31–40 of 147 posts

Re: Now that people are considering NOSQL will more people consider no-DB

#31
post #9

I'd encourage everybody to try this out; building an app like this really broadened my way of thinking about system design. Compared with a database-backed system, many operations are thousands of times faster. Some things that I was used to thinking of as impossible became easy, and vice versa. Coming to grips with why was very helpful.

what implementation did you use? what others exist? thanks.

The first time I did it myself. The next couple of times I used what the other reply mentions: Prevayler.

Re: Now that people are considering NOSQL will more people consider no-DB

#32
I think that the best thing DB-s provide is the separation of skills. I can fully concentrate on the programming side and just be aware of the db side, and the DBA-s will handle setup, replication, migration, analytics, ad-hoc queries, backup, etc.

If, on the other side, I had to do it all myself, I'd most probably have lost my last hair.

Re: Now that people are considering NOSQL will more people consider no-DB

#33
post #4

...and on a mildly related subject: more people should consider LDAP.

You mean using data stores that support access through LDAP as general purpose databases?

Under certain circumstances using LDAP as a directory or data-store and not just for authentication alone can make sense, especially if you want to benefit from the very well standardized, open and stable interface or if some sort of multi-master scenario is needed or if you want very rigid control over who can see what portion of the data then the most popular LDAP servers offer a lot of very cool ways of "modelling" and managing your data.

One drawback to keep in mind is that LDAP is generally not meant for lots and lots of writes so it is by no means a substitute for DBs but it is great for looking up data and if that data somehow fits a sort-of "file card" paradigm anyway and there are way more reads than writes on that data and several different applications should be able to access it then all the better.

The major and most popular applications of LDAP, however, are certainly always somehow connected to authenticating users and that is also where it really, really shines and that was another reason I brought it up. If applicable, personally I would prefer managing users and their logins in an LDAP server over keeping all that in a database.

Luckily nowadays most (web) applications offer some sort of support for using LDAP anyway, however dodgy those implementations sometimes are. (One of my favorite examples here is netscape navigator/mozilla/thunderbird and the addressbook schema shenanigans...)

I just think it gets too little credit or news these days but that probably stems from the fact that it is a pretty stable system without lots of innovations and it has been around a looong time and it is not so "sexy" anymore and most HN hackers wouldn't have to deal with it most of the time anyway.

But I cannot recommend looking into LDAP and playing around with it and understanding how to get a directory going enough - it is a bit confusing (sometimes frustrating) at first because it is so different from typical databases but it is fun once you get the hang of it and learn to appreciate its simple and efficient beauty and some of the things you can do in huge directories with e.g. the Sun LDAP server are nothing short of amazing.

Re: Now that people are considering NOSQL will more people consider no-DB

#34
Nothing new here. I remember working with TED editor on PDP-11. The machine crashed some times. After restart TED would restore the text by replaying all my key presses.

Other example vector graphic editors: it replays vector graphics primitive instead of pixel bitmaps.

Re: Now that people are considering NOSQL will more people consider no-DB

#35

In many applications, data outlives code. This is certainly the case in enterprise applications, where data can sometimes migrate across several generations of an application. Data may also be more valuable to the organization than the code that processes it. While I'm no fan of databases, one obvious advantage is that they provide direct access to the data in a standard way that is decoupled from the specific applic…

And not the last thing is security and permissions to access different parts of data. I see no way to have it easily implemented in the event logging system.

Re: Now that people are considering NOSQL will more people consider no-DB

#36

In many applications, data outlives code. This is certainly the case in enterprise applications, where data can sometimes migrate across several generations of an application. Data may also be more valuable to the organization than the code that processes it. While I'm no fan of databases, one obvious advantage is that they provide direct access to the data in a standard way that is decoupled from the specific applic…

The goal is not to replace databases altogether. The goal is to solve some particular problems very well. Last time I used this approach, for example, we mirrored a bunch of data in a traditional SQL store for reporting and ad-hoc querying, things that databases are great at.

In my view, direct access to data decoupled from application code is a bug, not a feature. With multiple code bases touching the same data, schema improvements become nearly impossible.

I also think data integrity is easier to maintain with a system like this. SQL constraints don't allow me to express nearly as much about data integrity as I can in code. Sure, I could use stored procedures, but if I'm going to write code somewhere, I'd rather it be in my app.

Re: Now that people are considering NOSQL will more people consider no-DB

#37
This has limited use because of

Maintenance: I can easily give a 10% raise to everyone with a single SQL statement. Fowler's method requires that I first create an entire infrastructure (transaction processing, ACID properties) in code for this particular application. And it had better be as reliable as the transaction processing available in modern relational databases (so says my boss) or I'll be looking for a new job.

Support: you get to teach the new guy how "Event Sourcing" works for this application A and also applications B, C, ....

That said, I _have_ done this with great success. But the work involved a single application (a minicomputer-based engineering layout system). The ease with which versioning could be included was a selling point.

And don't get me started on reporting or statistics.

Re: Now that people are considering NOSQL will more people consider no-DB

#38
post #13

answering directly to the subject: i do hope so. SQL too often introduces only a layer of complexity between the server-side application and the storage, while most of times an application could be designed to just use the filesystem, which is a database on its own by the way: it's a big, usually efficient, lookup table that maps keys (file paths) to values (file contents). why store passwords through SQL when a serv…

> each file named with the username and containing his password (without any file format, just the password, possibly hashed or encrypted)?

Because your advertisers want to know how many users signed up last month, last six months, and last year. When you only consider one use-case for your data, it's easy to consider using NoSQL or the file system to store your data but in doing so you fail to imagine all the other ways you might want that very same data.

Re: Now that people are considering NOSQL will more people consider no-DB

#39

I didn't finish the article because I read the one on Event Sourcing ( http://martinfowler.com/eaaDev/EventSourcing.html ), pretty good pattern. I like that every time he describes a new one (to me), I feel like I have to use it.

Event sourcing has a lot of power, but it also offers up some unique challenges. If you are interested in applying it I'd check out CQRS: http://cqrsinfo.com, I've also got a few blog posts on the subject http://lucisferre.net/tag/cqrs/
Post reply on HN