10 ms·
Databases have failed the web
- fs111 10y agofailed the web? They made it big in the first place!
- artur42 10y agoLearn More About Hymenotomy http://www.thewomenschoice.com/learn-more-hymenotomy/ http://www.thewomenschoice.com/learn-more-hymenotomy/
- agentultra 10y agoI serve many, many millions of rows, collect real-time statistics, push real-time updates, and maintain data integrity and consistency... all from a single database server. If our workloads require it we're prepared to scale out horizontally. I'm really looking forward to PostgreSQL 10's new parallel query features for some of our analytics work. Stack Overflow runs everything across what, 4 MS SQL Servers in total? How has that "failed the web?"
- pg_is_a_butt 10y agobecause SELECT statements don't spawn UDP connections and AJAX service workers, because that is what a dataBASE is supposed to do. you're all idiots.
- dpark 10y agoThe argument is not that DBs failed the web for scalability, but that they failed the web for features. I don't fully agree but it is an interesting argument. DBs have auth systems already, but we mostly bypass those and reimplement auth in the stateless layer. DBs have programming capabilities but we mostly bypass that and build business logic in the stateless layer. DBs are great at storing and maintaining relations and relationships but much of the other functionality is little-used.
- WrtCdEvrydy 10y agoMaybe if there was better support at the connection layer, this might be better. If ActiveRecord (Rails) allowed you to pass a free-form ruby function and built a procedure and executed it in SQL, I'd be all for it, but I'm not writing a one-off procedure and mantaining it.
- tomc1985 10y agoWhat is there to maintain? It's not hard to directly emit SQL to ActiveRecord
- WrtCdEvrydy 10y agoI'm not writing a one-off procedure in RAW SQL. If ActiveRecord could turn functions into SQL equivalents, it would be awesome.
- tomc1985 10y agoI know, they're so scary aren't they?
- WrtCdEvrydy 10y agoNo, in terms of Return on Investment, it just isn't worth it for me. Noone cares if a large query takes 10 seconds or 11 seconds with ActiveRecord enough to blow developer time on it.
- throwanem 10y agoNo one cares until they do, because the dataset's grown nontrivial and the crap 10s query Active Record generates is now a crap 120s query and one of the server, the client, or the user times out before it finishes.
- vog 10y agoThe PostgrREST project is an interesting approach so fill this gap: https://postgrest.com/ https://postgrest.com/
- fragmede 10y agoThe articles point is that there's a bit more to Stack Overflow than the four database servers it sits on, and because MS SQL is treated as a monolith,a stupid amount of development time, the world over, goes into doing things the database, arguably, could be configured to do itself. I click the accept answer button on my web browser, stack overflow stack reads the cookie my browser presented, does a bunch of logic in the app server, then does a database lookup. It then takes the web request, does a bunch of other logic with it in the app server again, then... runs some more SQL against the database. Stack Overflow, and I, and presumably you as well, have written tons of custom code that sits between the web browser and database, but the article's thesis is this is stupid because if the database "just" spoke http, then it could do the majority of that natively, no Ruby/Python/JavaScript/.Net or anything needed.
- deleted 10y ago[deleted]
- laumars 10y ago> the article's thesis is this is stupid because if the database "just" spoke http, then it could do the majority of that natively, no Ruby/Python/JavaScript/.Net or anything needed. The issue then becomes scaling. Instead of having half a dozen database nodes you need to keep in sync you could now dozens or hundreds. Possibly even thousands on some applications. The point of databases is they're meant to be a monolithic repository of persistent data. The point of web servers is that they're supposed to "dumb" and interchangeable. You meant to be able to spin up new instances to scale to demand. This gets greatly more complex if your application is also your database. It's also not true that databases haven't evolved for the web. We now have NoSQL databases, JSON support in many RDBMS and in-memory databases for caching. Running your web application inside your database is already possibly. There have been posted on HN discussing people doing this. But it's really not practical for much beyond a small scale blog or private (IP whitelisted) API server. ie the kind of thing that the application be hosted on a single node instance and potentially with the DB sharing the same VM too. The moment you need to scale sideways, even just to a small few nodes, it becomes more advantageous to have your database separated from your application servers.
- ruslan_talpa 10y agoExactly! How about "developers have failed the databases" The majority of the developers don't use (or don't know how to) views/stored procedures/roles/triggers. Whenever you mention something like this you hear "omg, you put business logic in the db? everybody knows that does not scale" or "we deconstruct our request into a few simple queries instead of a join so we run super optimal"
- sk5t 10y ago> deconstruct our request into a few simple queries Makes sense if you can cache only portions of the result, and/or the query optimizer or database layout actually struggle with the join.
- cr0sh 10y agoI agree that more business logic needs to be "closer" to the DB - if not in the DB itself (using those facilities you mentioned), then at a level very nearby. There's a very good reason for this: Showing a consistent interface for data update and query. When there are multiple teams developing against the same DB server, they might be able to see most or all of the tables, but they each might implement updates/selects (SQL queries) that exhibit extremely different results - which either present or update the data in potentially incompatible or inconsistent ways. This ultimately manifests itself as errors/bugs which can be very difficult to figure out what went wrong where and why (and correcting the data becomes a nightmare). Things get even worse when you have people querying the data via ad-hoc methods (like ODBC to an Excel file or something weird like that). Essentially, it is possible (likely) that every team sees a slightly (or greatly) different view from each other. Coupling the BL closer to the DB level would prevent this; whether via the tools mentioned (views, triggers, etc) or something else. Ultimately, app developers shouldn't be hitting the DB tables directly, but going through these interfaces. Of course - that brings up a host of problems on its own (table updates become an issue of coordination and conflict between teams, etc) - and there's also the issue of implementing versioning of the business logic (and how that relates to current/past DB structure)... ...but implementing it would solve a lot of headaches (and create more I guess). /sigh
- agentultra 10y ago
- PaulHoule 10y agoIt isn't that "everybody emulates the VT-100 for some reason" but that the VT-100 was the first terminal to support the ANSI standard for control codes and that that standard has been evolving ever since.
- dboreham 10y agoReal Programmers emulate a VT-52.
- takeda 10y agoYep, I also wanted to add that if you use Mac, or Unix you most likely don't use VT-100. Yes, they all support VT-100, but that's because it became a standard, and essentially any device understands it. For example if you connect to a network switch you know that it will at least support VT-100 so you have a common protocol to communicate with it, and be able to switch to a modern protocol if the device supports it. I feel like the author is a front end developer and just hates the fact that JavaScript in the browser can't communicate with a database server directly. I don't understand though, if there is a need for something like that, and it is also possible that database could provide a generic enough interface that would work, then there must be an application that you install together with the database which would do exactly what he wants. There's no need to add this functionality to a database, because it only adds a complexity that majority of people who use a database won't need.
- josephg 10y ago> I feel like the author is a front end developer and just hates the fact that JavaScript in the browser can't communicate with a database server directly. Author here. I hate the fact that here in 2017 we still write login code, again, for every application. I hate the fact that if I want to trigger re-renders, or run workers off database changes all my options suck. > it is also possible that database could provide a generic enough interface that would work Exactly. It doesn't have to suck - our databases could provide a nice interface to do all this stuff cleanly instead. We just need a resumable event stream, with versions and some other API tweaks and we can do computed views out-of-process of the database, written in whatever language I want. I'm firmly of the opinion that all databases should provide a Samza / Storm / Kafka / etc style event log.
- kuschku 10y agoThis is an interesting article. And he gets a lot of things right – having a way to do queries against a database directly, being able to get changes directly is useful. And GraphQL, for example, offers exactly that – there’s even a plugin to directly build a GraphQL API from your postgresql database. Although this still can’t send changes over the net, so you can’t have an always up-to-date view of the database. But while this and Firebase¹ solve the problem of offering an API directly for a database, he’s missing to address the other task frontend servers do: They can render stuff on the server, in case you actually do have just a dumb terminal. And that’s something that’s very useful for websites, as usually servers are more powerful than smartphones, and you need to do your computations somewhere. A web service applying deep dream to an image can’t run it in the phone, nor in the database – it has to run it on a specialized server But it’s indeed a good question why there’s little academic research into changing the way web applications work. We’re already making databases directly open via GraphQL APIs, we’re separating statically hosted content into CDNs, so how can we combine this, and work truly "serverless"²? [1]: Firebase is a great tool for prototyping your app, but if you want to run it it’s usually too expensive, and relying on proprietary Backend-as-a-Service technology has proven to be a bad idea already when parse.io shut down. [2]: Serverless here meaning that you have no specialized application server – you have a general database able to handle all your applications, a general CDN, and all special code for the app is handled within the database, or triggers of it.
- obstinate 10y agoTo be honest, this article seems pretty insubstantial. To the best of my ability to discern, the only concrete complaint is that access control is too coarse on modern databases, although it's not really specified in what way this is true.
- nileshtrivedi 10y agoAgree. Postgres now has row-level security and one could always apply custom access control using functions/triggers.
- pbnjay 10y agoI really disagree with this - separation of concerns is incredibly important. Why does the database server need to do everything my application server does now? I don't want to have to know about how my database works internally just to implement a new feature in my application. I don't want to worry about a junior dev corrupting data while building a login page. My "simple old-school" database is reliable and consistent BECAUSE it's been tested for years. My application server is not because it's solving a new problem (And that's OK, I won't lose customer data if someone can't login).
- dom0 10y agoFully agreed. The observation that SQL still works as well as it does today as it did in the 70s suggests that it's a good and valueable abstraction.
- hive_mind 10y agoLindy Effect.
- YCode 10y agoI can't tell if you're describing or disputing the comment you replied to. Are you saying SQL survived only because people have used it for so long and therefore its sustained use isn't an indicator of value?
- hive_mind 10y agoIf you read up on what Taleb writes about Lindy Effect, you should be able to understand. OP said that it's probably good because it has lasted so long. I would agree.
- geon 10y ago> SQL still works as well as it does today Or... It sucks as badly now as it did back then.
- brlewis 10y agoI agree with the article that modern middleware is too fat, and we could make more reliable systems by leaning on a full-featured database. I disagree with the three reasons he gives for why we have fat middleware today. PostgreSQL solves 1 and 3, and PostgREST solves 2.
- shanemhansen 10y agoI think databases have been so wildly successful because they were actually based on some reasonable research about data access models and set theory. I encourage anyone who wants to criticize the relational model to start with E.F. Codd's "A relational model of data for large shared data banks".
- thehardsphere 10y agoThe conceit of this article seems to be that all web applications are merely CRUD apps that do nothing but talk to the database, thus databses are "failing the web" for... not being more than just a database. I see a number of problems with this: 1. Not every web app is merely CRUD. Some of us work on apps that do quite a bit more than CRUD, and the CRUD part is relatively small and boring. 2. There's very little respect here for the idea that good utilities should do one thing and do that thing very well. Lots of people need relational databases. Not everybody needs a relational database that can automagically filter out XSS attacks and serve HTTP responses.
- josephg 10y agoAuthor here. I think CRUD apps are the most boring example. But think about something like Slack. There's some data and queries, sure - but the app also needs realtime feeds. It needs to have triggers running notification tasks off changes made. There's lots of stuff that need to happen as a result of data changes. Doing all that stuff purely at the application layer is an architectural mess. What you really want is an event log of messages, with workers and search indexes listening on that. Maybe later you'll want to add full text search via elasticsearch - and that needs to be kept in sync via the event log as well. Rolling your own version of all this stuff correctly is really hard. Either you do it inside postgres using triggers and stored procs, or you use kafka and invent your own complicated system to handle conflicting writes. Or you add hooks in all the places in your app where you do writes, but that introduces its own set of consistency problems. Samza, Datomic, Bottled Water, Couchdb and firebase all solve at least some of this stuff better than classic SQL stores. Its time for relational dbs to get on board. Being no more than a database isn't good enough anymore.
- cookiecaper 10y agoYour complaint is that SQL databases aren't message brokers? SQL servers have been abused as message brokers for decades. It's not the use case they're designed for, and while a plugin that integrates this type of functionality into PgSQL would be interesting, there's no reason to expect them to assume that problem space. If you want the database to handle the incoming message streams, then set your consumers to call a stored procedure. That should alleviate your concern with conflicting data models.
- masklinn 10y ago> Access control on modern databases is too course. You want to whitelist which queries a user is allowed to make and you want fine-grained permissions around updates Only allow direct access to stored procs, not queries. Or restrict access to specific views and use rules (https://www.postgresql.org/docs/current/static/sql-createrule.html https://www.postgresql.org/docs/current/static/sql-createrul...) but intuitively that seems more dangerous (with CTE, I believe SQL is turing-complete) and completely unnecessary. > Databases only talk custom binary TCP protocols, not HTTP. Not REST. Not websockets. So you need something to translate between how the server works and how the browser works. https://postgrest.com/ https://postgrest.com/ > You want to write complex logic for user actions https://www.postgresql.org/docs/current/static/plpgsql-structure.html https://www.postgresql.org/docs/current/static/plpgsql-struc... > with custom on-save triggers https://www.postgresql.org/docs/current/static/plpgsql-trigger.html https://www.postgresql.org/docs/current/static/plpgsql-trigg... > and data validation logic. https://www.postgresql.org/docs/current/static/ddl-constraints.html https://www.postgresql.org/docs/current/static/ddl-constrain...
- spacemanmatt 10y agoI gotta plug http://openresty.org/ http://openresty.org/ whenever I see postgrest mentioned. OpenRESTy is built on nginx, and is fairly battle-tested.
- deleted 10y ago[deleted]
- aug_aug 10y ago"Access control on modern databases is too course." - I think you mean "coarse" here.
- cookiecaper 10y agoI don't really understand his point. He says that SQL has been around for 40+ years, as if that's a bad thing, and doesn't really say anything else. I guess he is complaining about the idea that the user's input doesn't get insert directly into the database, i.e., the connection would be browser->db, and instead we need an application component that reads from the browser and shapes to the DB. At this point, we must ask if the author has ever worked with one of the thousands of applications that implements their "API" through stored functions. I won't condemn this method wholesale, but people have mostly moved on to more flexible representations for good reason. The whole article seems predicated on a belief that most work should be on the consumer workstation, which is why he starts by talking about how much better it is that people now have desktop computers instead of clients that connect to a mainframe in the basement. The author apparently doesn't grasp that the web acts just like those old terminal clients he refers to in beginning of the article. There's a big server running the application in someone's datacenter, and your browser is a thin client over the top of it, an interface into its inner workings. He blames this on databases. (???) The browser doesn't provide the mechanisms to directly connect to arbitrary protocols. I don't really think there's much substance here.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- Spooky23 10y agoI think the author failed to educate himself. Databases are a miracle product. If you think of an application as a car, the database is the engine. The idea that you have a platform that can do everything without the abstraction of a separate data storage/query platform, that exists too. I'd argue that FileMaker, Lisp, MUMPS, and a few others basically do this in different ways. I used to be a DBA at a company where the entire company ran on Informix 4GL code (which was sort of like the Informix version of PL/SQL) within the database. Also a similar approach. But... they also have significant drawbacks. You're permamently married to that app/database stack. If any component of the system doesn't scale... you're fucked. By chunking out the solutions to include databases, app tiers, etc, you gain complexity but lose a lot of risk. If you cannot afford Oracle anymore, you can invest in labor to move to Postgres. If you're hitting a limitation with MySQL, you can move to Oracle. If you wrote your app in PHP, it goes viral, and you cannot scale it, you can migrate to a Java Application Server layer.
- hive_mind 10y ago^ This reply is very good, and is an example of "Systems Perspective."
- josephg 10y agoPost author here. > Databases are a miracle product. If you think of an application as a car, the database is the engine. Yeah - you're totally right. Thats kind of why I'm complaining about them - because we use them so much I think the potential benefits from improving more them are massive. The modern web stack is a mess, and changes all the time. But there's a handful of features we need in just about every application - login, update feeds, data-based rendering (computed views), etc. But stored procs aren't good enough - they're inaccessible, hard to debug and usually require their own (non-standard, barely known) language to develop in. So lots of developers write functions outside of the database through multiple queries, and in doing so will often break the database's transactional consistency model. Databases have managed to stick around with us throughout the evolution of the web. I'm being critical, but I'm doing it out of love. I'm saying that databases have the potential to provide so much more to the modern web ecosystem than just data storage. They could do access control, and run stored proc-equivalent functions or computed views from whatever languages my app is written in. If I need some complicated data flow where data needs to be updated in realtime in a secondary db (like elasticsearch), that should be dead simple to do too. I didn't get into it in that article but I believe we should be able to extend our databases to share data flow logic between applications. Or just build a lot of this stuff into databases so its reusable between projects.
- ericHosick 10y ago> All because we're programming against a frozen database spec. Relational databases, unlike XML, JSON, Key/Value stores and ORMs, do not pre-suppose document structure. On top of that, it is very easy to create new relations (entities) using Views. On top of that, you get a real algebra to play with: relational algebra. SQL makes it crazy easy, in real time, to see your data in any hierarchal manner you like (via denormalized entities). The one thing SQL 'lacks', and JSON shines at, is a way to return data in a hierarchical format (aka: to return JSON directly). I have 'lacks' in quotes because there are SQL solutions that can consume/spit out JSON. An interesting idea then is to provide a way to easily convert between SQL and JSON. To that end, there is an open source project https://github.com/erichosick/sql-json https://github.com/erichosick/sql-json that attempts this. The results are promising but there is a lot of room to grow.
- josephg 10y agoHi, post author here. My point about the frozen spec doesn't have anything to do with the data format. Its that modern databases don't expose the API that modern web applications actually want, like: - Integrated access control - Realtime updates (sorta, kinda) - Resumable event logs - The ability to do computed views in my language (eg, make a computed view using a nodejs react static rendering process) Because databases lack these features, modern web developers often end up rewriting them at the application level, for every app.
- snuxoll 10y agoThe only part of this I agree with is his comment on database permissions. Every modern SQL database has a concept of users and permissions that are divorced from your application, you're left with three options all of which are flawed. 1. Handle security inside your application. This is the worst choice if users need to get a LIST of records they have access to and it's determined by something more than a simple WHERE owner_id = :user_id. Think multi-tenant applications where records can belong to a tenant, and users have access based on a org hierarchy or other criteria. Suddenly you're having to filter a whole list of records out in your application code, and this makes implementing pagination awful (do you requery until you fill up a page, or present a partial page?). You are also taking full responsibility for security, if you modify your queries to filter records out you open up to human error where someone forgets to filter this one query. 2. You implement a method to synchronize your application users with the database, and use the database engines RLS support to handle access control. This is probably the best approach for web applications, but the caveats that come from it still suck. You have to make sure the connection is set as the user performing the action, this is doable with PostgreSQL, MSSQL and Oracle at the least (SET ROLE / EXECUTE AS) without destroying your ability to use a single connection pool - but for all the security you get out of this your web application user still has all the keys and if that account is compromised or there is a flaw that can cause your application to not switch security contexts you just failed at protecting your data. 3. Just use the database directly, it's handles authentication and you never change security contexts for a session - you can safely utilize the RLS functions of your database without any real risk since that database session is fixed to the user it is handling. Downside, you just lost connection pooling and while pooling middleware like pgPool can help you still have Y more connections since you need to maintain a separate one for each user or tenant at best. Approach 2 is by far the best we have, and you can make it safer by doing things like utilizing pg_hba.conf to limit access to the application user to the servers hosting your applications - but maybe you're using docker and IP addresses aren't fixed anymore (well, shit!). Also, how are you going to ensure the database connection is in the correct state when you make a query? Where are you going to plug that into your request pipeline? I'd really like to see modern tooling around this problem, I don't know what exactly it would look like but it would be nice to have SOME improvement in the area.
- 10y ago
- ElatedOwl 10y agoI'm admittedly bias, I love SQL. That said, I think having the database server worry about being a database is a good thing. In my career I've had a few projects that I've been too ambitious with; by trying to do too many things it failed to do any of them well. >Databases only talk custom binary TCP protocols, not HTTP. Not REST. Let's pretend that the database can now talk via HTTP/Rest. Is the database now responsible for handling business rules? Is it responsible for per row authorization/authentication? How does this impact performance? What if we want to export the data in another format, say into an excel spreadsheet, should it be responsible for that as well and the formatting? Where is the line drawn? >protect against SQL injection attacks. I mean, how would the database know the difference between a legitimate request that should be allowed and one that shouldn't? This is the point of parameterization. >Check for XSS I think it's plenty legitimate for a database to return some HTML data, how would the database know when it's malicious or not? ------------------- In full I think the grievances the author raises are with middleware, not a problem of the database.
- matheweis 10y agoIt sounds like the author is unhappy with the fact that web apps have a middle layer that speaks with the database over a terminal emulation. Ignoring the fact that it happens to make a very nice boundary for an abstraction layer... > Databases only talk custom binary TCP protocols, not HTTP. Not REST I take it the author hasn't heard of SCIM?
- sbuttgereit 10y agoThe PDP-11 were considered minicomputers, not mainframes, like the IBM System/360. The notion of midrange computing still exists with IBM's iSeries (AS/400), as well mainframes like IBM's zSeries. One could argue that some of these definitions get mushy, but I haven't ever heard disagreements about where the PDPs, AS/400s, and System/360s of the world live in this hierarchy. This seeming error was an early red flag in this article; having some good facts but having an incomplete picture. While some of the historical observations of what computing was is warranted, this same sort of not having a complete enough picture to draw correct conclusions shows up again in some of the main theses presented. Consider the statement about the coarseness of permissions. In many modern database systems this simply isn't true. What is true is that is the fully set of security features offered database systems are 1) not widely understood; 2) not bothered with by developers that choose to implement security elsewhere. Clearly the author spent some time with article and it is well structured, it's simply a matter of the author not having spent as much time getting to the heart of the matter as he/she should have.
- majewsky 10y ago> What is true is that is the fully set of security features offered database systems are 1) not widely understood; 2) not bothered with by developers that choose to implement security elsewhere. That statement applies to the full feature set of modern RDBMSes, not just the security features in particular. I'm always surprised that I seem to be about the only one (or at least one of very few) on my devops team of ~30 who's comfortable with issuing SELECT statements on the production DB to investigate issues (and sometimes UPDATEs to clean up a mess that users made). And that's not even touching all the crazy stuff (stored procedures, triggers, access permissions), just CRUD (or in this case, INSERT-SELECT-UPDATE-DELETE).
- mybrid 10y agoFollow the money. The notion that databases have failed the web was put to Mike Stonebraker of Ingres fame at a seminar I attended back in the late 1990s. The actual question was this: "Why aren't database vendors building object oriented databases for the web?" Object oriented databases store binary objects as opposed to object-relational databases Mike pioneered with Postgres. The plan was for CORBA, common object request broker architecture, to shuffle versioned objects around the web and object oriented databases would store binary code objects. Mike's answer? "Because the money is in transaction processing. Banks pay millions of dollars for transaciton systems. Transactions are the meat-and-potatoes of database sales." In some sense database companies are wise for ignoring the web. Web companies are now hell bent on "move fast and break things." A transaction database is the antithesis of move fast and break. Transactions move deliberately with consistency. Durability says I can unplug my database at any time and bring it back up. This is the opposite mind set of move fast and break things. Here in the valley whole QA departments are being disbanded in favor of LEAN and move fast and break things. All of this is antithetical to the database world of transaction processing. At they say: you get what you pay for. What the enterprise companies are paying for is exactly what is being delivered. Open Source fits the every changing, move fast and break things of the web world. To whit, you might see database vendors move into the web space some day if in fact companies are willing to pay millions of dollars for them.
- thinkling 10y agoYour argument may hold for Oracle and IBM, but the web crowd produced MySQL and Postgres, investing effectively millions of dollars of developer salaries and sweat equity, and those systems have evolved more towards features already in the commercial RDBMSes than towards a new, web-oriented DB flavor. Apparently web backend developers said "we want more of Oracles features" and not "we want the DB to handle these web-specific issues". At least, not until NoSQL systems like Mongo came around.
- cr0sh 10y agoI haven't read all the comments here yet, but I'm going to throw this out anyway... My confidence in the author took a hit at the point he called a PDP-11 a "mainframe". One would think a computer scientist would know what computers fall into what "generation". I guess "history of computation" is just not taught as part of such a degree anymore...? But...I decided to read on, thinking maybe things would get better, and to give him the benefit of doubt. I think somewhere in there was maybe a few points to think about, but ultimately it almost looks like he has some weird problems with "separation of concerns", and maybe doesn't understand why that would be a bad thing for scaling... ...which again, I find odd for a computer scientist. Furthermore, he seems to ignore the great amount of improvements and changes which have occurred in the database software/engine and server world; today's DBs and DB systems are -nothing- like they were back in the early 90s when I started my career (as a fresh high-school graduate). Yeah, we still used VT-100 terminals (then quickly transitioned to PCs - running VT-100 terminal emulators, of course), and things were starting to transition to PC apps communicating to the servers - and I am sure there were SQL injection issues (and no, we didn't think about that) - but things have, over the decades (yeesh - getting old here!) have changed for the better! Could they be better? Certainly! Are there things the DB server could be doing to make life easier for the app? Yes (and some of this has been implemented - ie, when developed properly, your queries can be "sanitized" at the DB server level - but you know, you should still do this at the app and browser level too - just in case). Realtime updates and notifications? That's pretty much there as well - but ultimately, a lot still has to be done at other levels. ...and that's not a bad thing, imho.
- aykutcan 10y agoInteresting. Should humans interact each other over HTTP or REST too ?
- Animats 10y agoAnd, to fix it, he says, we need functional programming at the database level! What? Today's databases are probably the best part of the server side stack. The parts that talk HTTP, JSON, and do business logic are usually worse.
- spacemanmatt 10y agoI find the DB part to be the only sane part of my stack these days. It's funny though, I got the hang of functional programming by cross-training in SQL first. Writing attribute expressions is a lot like writing pure functions of immutable data.
- elchief 10y agoHow is a db with row and column security "coarse"? I mean, row+column security means you can secure down to individual cells. Sounds like the author doesn't know what he's talking about
- jandrewrogers 10y agoIn the mid-1990s, some of the most complex web applications were implemented inside the database! I was the technical lead for a production web app written in... 250,000 lines of PL/SQL. This model had some significant advantages and worked surprisingly well considering that Oracle was not designed with that (ab)use case in mind. So why didn't this model become common given that it was relatively elegant and capable? A few reasons: - It required developers to be sophisticated at both using the database and creating web front-ends, since they were inextricably mixed. Even today, most developers are strictly one or the other, not both. - The tooling inside the database was not designed for this use case, so while the architectural model was elegant, the development environment was piggybacking on functionality designed for reporting systems to drive interactive websites. This got better with time but by then no one cared. For a minimal website, hacking together a couple Perl scripts had a lower learning curve but was less capable. - At the time, only a couple databases had the level of sophistication and features to make this feasible. Like Oracle. The upfront licensing costs were outrageously high, so there was no cheap way to bootstrap or incrementally grow into your application. A 2017 version of this would work very well, database engines have much more sophisticated capabilities than back then that would make the development and operations experience pretty efficient and nice. As a practical matter no one designs web apps this way any more so there is no market for it.
- josephg 10y ago> As a practical matter no one designs web apps this way any more so there is no market for it. Well, the problem is that I'd say PL/SQL isn't a good choice of language to implement a web templating engine. And the web framework selection is ... lacking. And its hard to hire engineers who know PL/SQL. But even if the database has a native JS engine or something there's also a separation of concerns problem here. But if the database simply exposed an event stream and versioning information from queries, we could write our applications in whatever language we want. They can listen on the database's event stream and invalidate caches or eagerly re-render the app as data changes. And if you have a kafka-style event log they can live on other machines and run in separate processes. From any angle I think the samza/datomic model is simply a much nicer architecture to do this sort of thing. More ergonomic than the pl/sql approach, and certainly much nicer than what we have now using databases as dumb stores.
- dan31 10y agoNo plumbing is required in modern architectures such these of SAP HANA, Starcounter, or Tarantool. When the application server and database are combined, the access control is arbitrary, databases talk whatever you want, no need to torn the code apart into stored procedures, backend and frontend code. Plus to this, lots of unnecessary moving parts are removed in such architectures, so that the whole thing runs on 2 servers instead of 20, while the code is simpler than ever. The referred article needs clarification. What it really addresses are the flaws of conventional software architectures. Fortunately, this critique does not generalize.
- mamcx 10y agoThe traditional RDBMS have failed because are all-or-nothing. A lot of people here (and elsewhere) think is non-sense to build a full app with the full business logic inside the "db". WHY????? That is a VERY NARROW viewpoint. But when we say "let's build a full-app inside a Virtual Machine, yeah that actually is ok!" And why is ok to build a full app on lisp? Or in a OO language (a grah of objects)? Or a array language (a array is relation with 1 column!) If you think that: print([1, 2, 3]) Id OK. then YOU MUST ACCEPT THAT: print([Code = 1, 2, 3; Name= Miami, New York, Bogota]) Is ALSO OK. The relational model is just move from 1-columns arrays to 2 N-Columns (In rows of columns as internal storage) plus some universal operations. WHERE THE RDBMS FAILED EVERYONE IS: Because them (the guys at the DB side) insist in adding: transactions, triggers, Surrogate-Keys, Inter-Relation dependencies, storage, sub-query languages, catalogs, views, etc. So at the end, you get a full half/big semi-OS virtual machine tailored to a specific niche. ------ Was only when the artificial divide between the RDBMS and the front-end language appear (and the death by MS of Fox/Vb to only focus in .NET) that building database apps start to suck big time. I have talk about in HN before about this, and instead consider that make even MORE sense to build the logic inside the DB, however, is necessary to re-think how it look to make it more useful. Is not a novel concept. The dBase family was almost that, and the people like me that use it was very happy and productive. Why make more sense? Because Program = Data + Algo. Data is not to be treated as third-class citizen. Must be a first class. The relational model make it first class (as with lisp model and array). And what about separation of concerns and all that? That is pure architecture and is tangential to be or not inside a DB, the same is tangential inside a VM.
- carsongross 10y agoLook, kids. You are going to have to have an execution layer you can trust somewhere, you can't just expose your data store directly to the outside world or you run into an infinite number of security issues[1]. (Not that this is stopping people from doing exactly this these days.) That somewhere is going to be a server side execution environment, and it will be separate from your data store so you can scale these concerns independently. Additionally, you are probably going to want a DSL for your data access as well as a highly tuned indexing system for your data store. We have systems that do this, they are called databases. Are they perfect? No. Nothing is. But the idea that they have "failed the web" is so over-the-top childish that, like the author says at the end of his post, I'm not inclined to be charitable. [1] - http://intercoolerjs.org/2016/02/17/api-churn-vs-security.html http://intercoolerjs.org/2016/02/17/api-churn-vs-security.ht...
- dragonwriter 10y ago> Look, kids. You are going to have to have an execution layer you can trust somewhere, you can't just expose your data store directly to the outside world or you run into an infinite number of security issues The security issues your source points to in new, SQL-like (but not SQL) general query APIs (GraphQL, etc.) are actually already fairly completely addressed in modern relational databases, which are designed for multiuser access with users having different permissions. So exposing the datastore directly solves, rather than causes, the issues it raises with common generalized near-SQL query APIs.
- carsongross 10y agoYeah, no. You can't expose generalized query functionality without either encoding the security constraints in the datastore query layer (which is really, really hard, we are talking column-level security constraints and worse) or limiting the expressiveness of your query layer. That's the trade off and, in most real world systems, the data stores are wide open to the developer because expressivity wins. Yes, the technology is there to secure databases at the row level, for example, but people don't use it. They just use a user/pass with total access. A lot of folks are tossing HTTP endpoints on data stores without thinking through the security/expressiveness tradeoff.
- z3t4 10y agoSo you want to implement a new feature, and test it locally, then run tests to make sure you didn't break anything, and when you are done, upload the changes to the production server. This is sane devops, nothing fancy, yet impossible with todays databases. You basically have to manually do the same changes you did in development to the production database, then test if it works on live data in production. Then your finger might slip when writing an SQL query and you have to reset all production data from backup.
- majewsky 10y agoI for one would not let developers access ny production databases when they clearly don't have any idea how to copy a snapshot into the QA database.
- z3t4 10y agoMay I ask how much it would cost, in total man hours, to for example change the name of a field ? For example make "name" into firstName and lastName.
- majewsky 10y agoAnywhere between maybe 1-2 man hours and multiple man months, depending on how nice the data is right now, and how accurate it need to be split. The optimal case would be the application already enforcing values to look like e.g. "last, first", so that the migration can happen via a simple regex.
- mnm1 10y agoThis rant basically asks: why don't databases do, out of the box, all the custom functionality we program into our web servers? In other words, why don't databases program the app for me? What a waste of bandwidth.
- lstroud 10y agoI would argue that databases tried to do too much for too long. If you want a database that has a built in web server, rest apis, security, etc...well Oracle has had that for years. Problem was, that wasn't what people wanted (or wanted to pay for). The more recent trends have been to decompose the database into something that is great at storing and retrieving data...leaving all of the other stuff to products that do that well.