3 ms·
Quite a few webapps just shouldn't be using a db for most things. It's lazy programming.
by axod 18y ago
Quite a few webapps just shouldn't be using a db for most things. It's lazy programming.
- bmj 18y agoCare to expand on this?
- mixmax 18y agoWhat then? Asking out of curiosity/ignorance, not trolling
- mynameishere 18y agoI think this website (hacker news) just uses persisted hash tables. I'm not sure why he thinks databases indicate "lazy programming" though.
- axod 18y agoIt's really easy to just throw everything in a db, and then start worrying when you scale. It takes more programming to think how best to organize things - what stuff should be in memory? How best to store it in ram for performance/size? What should be on the disk as flat files? What needs to be in a db? Should parts of the db be cached in ram and just used for writes etc. Also does everything need to be in a db? Or are some things better dealt with by just passing messages around, queuing them up if needed etc.
- ars 18y ago> Should parts of the db be cached in ram and just used for writes etc. You are working way too hard. Let the OS figure out what needs to be in ram - it does it automatically anyway, and it does a better job that you an since it's caches what actually used, and not what you think should be used. You should not use flat files for web apps - they don't handle concurrency very well. > Also does everything need to be in a db? Or are some things better dealt with by just passing messages around, queuing them up if needed etc. Message passing, and db are not interchangeable, so that's a false question.
- abstractbill 18y agoYou are working way too hard. Let the OS figure out what needs to be in ram - it does it automatically anyway, and it does a better job that you an since it's caches what actually used, and not what you think should be used. So why does memcached exist?
- ars 18y ago> So why does memcached exist? To cache the results of complicated joins (or queries without indexes). It's pretty much pointless if all you are doing is caching the result of a simple query using an index.
- abstractbill 18y agoIt's pretty much pointless if all you are doing is caching the result of a simple query using an index. Not if your database is under heavy load, and you can easily shift some of that load by putting frequently accessed things in memcached instead.
- ars 18y agoThat's if you have two machines. The comparison was vs keeping stuff in a hash table in memory, and I was saying databases are no worse.
- abstractbill 18y agoThe comparison was vs keeping stuff in a hash table in memory, and I was saying databases are no worse. But that's clearly not true. In the most extreme case, that hash table is referenced simply by a variable in your program - it's already in your program's address-space! There's no way a database can come close to that.
- gnaritas 18y agoNot to mention that you can hash arbitrary objects in a hash table with no mapping of any kind. hash at: key put: anObject Databases are vastly more complicated and require me to completely disassembly the object graph anObject may contain into a set of tables and rows to store it, and then reassemble the graph from tables and rows back into their object form when fetching. The second one commits to using a relational database, one often easily triples the size of the code base. There's nothing simple about that.
- michaelneale 18y agoyeah but if you get its going quick - is that really lazy? If you value more getting it done and working over getting things "right" from the start - for many cases that is a good enough approach. Although what I find interesting is the data store in google app engine - if you can work within that sort of database, you have a much better chance of scaling if you need to (and like you said, you rarely need the relational part of a RDBMS anyway).
- omouse 18y agoYou have to be more specific. What do you mean exactly by "db"? a relational DBMS? a file-based one? a tree-based one? document-oriented maybe? column-oriented?
- axod 18y agoMost websites are likely to be using mysql/postgresql.