 So to make sure to ensure that you're having a good time. We're gonna start our keynote sessions You know, we're very fortunate. We have two speakers who you know You know, I who either don't go by their full name or have very hard names to pronounce and make sure that you don't ever pronounce them So we're actually going to introduce them separately, but you know real quick We have Rommel and Valentin who are going to talk about some really large things with Postgres and Some of it's gonna be philosophical and some of it's gonna take it to the applied world So let's kick it off So the first up's gonna be Rommel is really Robert Lefkowitz All it was really the first person that I ever met that went by something with a number in their name Which was kind of cool. I I first met Rommel back in Nashville, Tennessee of all places Where I went there talking about Postgres just Didn't expect to be there in a big company and talking to somebody that was so enthusiastic about open source I expected to go in there and we're in this is big corporate building And there's more typically a Microsoft shop, but I'm in there in a meeting with this guy That's running around the room talking all excited about open source. It was a kind of an eye-opening experience in Nashville, Tennessee of all places Might expect that in the Bay Area or something like that But I was really excited when when I saw a submission by by Rommel. That's to talk At this event today And then Jonathan and I looked it over a little bit and we're like Rommel's not we don't we like hearing one of the regular session talk But I think everybody at the at the at the conference will get a lot more out of them as being The keynote speak one of the keynote speakers It is he's a fantastic speaker He is now here in you in the New York area really New York City, right? So he's no longer flying down to Nashville all the time So it's great having him as part of being the part of the New York Postgres community here So it's fantastic and with that Rommel Yeah Thank You Jim Jonathan for inviting me here for actually turning down the talk that I submitted It's So actually Jonathan said that he wanted to have fog at this conference And you can't do real fog. So we're gonna have sort of virtual conceptual intellectual fog. That's That's what I'm going to provide Valentine and I agreed yet. He will do the informative talk and I will do the confusing talk So I'm gonna talk about the image of Postgres The way I do talks What I would like to do so this is what I'm attempting to do you'll let me know later if I succeed is to say something That's a cliche That's a platitude that is so obviously true that it doesn't even bear saying or repeating except I want to say it in such a way that You will feel that you can't agree with me and So I I just want to deliver a platitude that You won't be able to agree with because of the way that I say it It's the platitude because it's a postgres conference is Postgres is awesome And the other thing that I do is I talk about Philosophy because the way that you get people to disagree with something that is obviously not disagreeable with is To become wax philosophical about it So the philosophy that I usually try to to specialize in is some asiology and sometimes a little epistemology But I'm sure you will all agree that epistemology is not appropriate for a database And so we're going to talk about ontology because ontology is that branch of philosophy, which is about the classification of things and and databases of course about classification of things and Some asiology is the is the study of the change the meaning of symbols over time is sort of the first derivative of semiotics So where do we start with classification? We start with pasta We start with pasta because I'm married to a Sicilian and we used to fight about pasta all the time Because my view is it's all the same stuff All right, you make pasta the same ingredients. You just make different shapes of pasta And then you get it argued how which is the best pasta to say which pasta should I serve? It's like it's all the same stuff. What difference does it make? All right pasta is pasta. What's the difference in the proper down the macaroni? and we had this argument for years and she could never explain to me what the difference was and Finally just the other night as I was preparing for this talk and we were arguing about pasta She explained it to me in a way that I finally understood and she said is the problem and it's an ontological insight The problem is if you think that pasta is food You're mistaken Pasta is a sauce delivery platform It's all about the sauce, but then if you know if you have a cheese sauce You're talking macaroni or maybe vermicelli depending on the consistency, right? So it's all about the consistency and the texture of the sauce and based on that you pick the pasta But it's not about the pasta. It's about the sauce So if you're thinking that it's about the wrong thing if your ontology is wrong Then you come up with the wrong conclusions and so the reason this is important is because we say postgres is awesome We don't mean that it's awesome as a sauce delivery platform right It's awesome as a database so we should amend the platitude to postgres is an awesome database and We could leave it at that if we weren't waxing philosophical because then the question is what is a database and As with pasta if we think that a database is something that it is not Will be misrepresenting the awesomeness of it So lest you think that this is about philosophy and not about computer science The one book that I want to recommend for those people who want to get further into this is I mean this book was was once on the list of the ten most influential computer science books of all time understanding computers and cognition by Terry Winnigrat and he talks about it this sort of philosophical struggle about what things mean and And you know how that relates to computers and whatnot and in particular the insight that comes away from this book It's what I'm going to be focusing on today is his definition of communication is that communication is the thing that happens When you realize that the thing that you said is not the thing that the other person heard so What is a database and just like with pasta I? Think people look at the word database and they say oh database You know it's like an army base an army base is where you keep your army a database where you keep your data Right, it's about it's about the data And so people think the mundane right this place full of data and you're organizing the data And it's about the ontology of the data and where you keep the data and how you retrieve the data and that was what? Databases look like in the 1930s This is what databases look like today. They haven't changed very much except you notice the person is gone from the picture It's like all automated now All right databases databases are a Place to keep your stuff and a place to keep your stuff as any computer scientist knows if it's global mutable shared state is a bad thing All right programming language research is all about getting rid of your global mutable shared state All right So if a database is global mutable shared state then it's a bad thing to begin with so being an awesome bad thing It's not such a good thing. We don't want to be an awesome place to store your data All right, cuz cuz that's not really what a database is So I want to ask the question a different way. It's not what is a database? What's the purpose of the database? All right, that's how that's how we got the insight into pasta All right not is pasta food because you say oh well of course it's food You can't argue with that but that what's the purpose of pasta is to deliver the sauce So what's the purpose of the database? What is the purpose of the purpose of a database is to obstruct access to data Everybody knows this. How do we know this? All right, because if you if you think so Because a file system is where you store data All right, if you just wanted to store stuff you put it in the file system So why would you get a database instead of just using a file system? Well file systems don't do a bunch of things that databases do much better And what are those things you know and these are the things that database people are always talking about I'll just pick one at random here Transaction isolation and if you think about all of these things on this list, what are these things about these things are about saying? Oh transaction isolation that means that you know There's certain things that you should not be allowed to look at at certain times All right, so it's about obstructing your access to the data at certain points Everything about a database about obstructing your access to data So you it's sort of like a file system only with more obstructions and why is that a good thing? So I submit that a database is not a place to keep your data I Submit that the difference between a database and a file system is a database is a platform for enforcing your business rules Because this is what people talk about when they're talking about databases. Also, they talk about schemas default values Constraints and these things are all business rules and I learned this I learned this in Nashville Jim was talking about my commutes to Nashville and whereas I because because I took this job to be to Work on the data warehouse in in Nashville and during the interview process This I one of the questions I asked was so what's your biggest problem? and the answer was The business guys are always upset because they want to know how many customers we have and we can't tell them So this doesn't sound like a very hard problem, right? It's so let count star from customer table All right And they say oh, no, you don't understand the problem. I said okay, so illuminate me. What's the problem and and he said What depends what you mean by customer Because if you're selling cell phone insurance is like is the customer the person who has the cell phone account What if they have two handsets and they both insured that to customers? What if it's a family account and he's got kids on the plant do they count as customers? They're not kind of how it's a business account And then you have like multiple people and you have like a thousand people covered in the business But you only have actually 700 people using it's so how many customers you have that's a business rule So figuring out what your scheme is figuring out how you organize the stuff and what do you do in the database? That's all part of enforcing your business rules. You have to decide what these things meet. It's it's an ontological problem All right, you have to classify your knowledge and then enforce your business rules Just want to take a check here because my objective was to only say things that are patently true and hardly bear repeating Is this patently true and hardly bears repeating? I Guess so And all right, so this is patently true and hardly bears repeating Let us think about the typical web application architecture and this this architecture is called the three-tier architecture because it has four tiers You have your browser your web server the thing that runs Python or PHP or JavaScript or Ruby or Java code and then the database And that's always how you do it and why do you do it that way? well Because well a that's how everybody does it I once saw somebody give a talk that says history teaches us that this is the only right way to do it Which as a philosopher I had to sort of admire the logic that led to that conclusion and Because because most people will say oh well see the database that's the place where you keep your stuff and then and then you know in this thing that runs your Ruby and PHP and Python code. That's where you have your business logic because you don't want to put it in your UI layer right which is because you know NBC you separate those things But you know we're talking where the Postgres conference. So so this thing Runs Python and JavaScript and Java 2 right so So why doesn't your web architecture look like that other than the fact that that would make it a two-tier architecture? Which we know is old-fashioned and wrong and you shouldn't do it that way Thoughts. I mean this is this is what stumped me over here. It's like so one theory is because that Postgres doesn't run PHP and that that would fix the problem except You know, maybe that's maybe that's not the issue right so so why isn't you know? Why don't we why don't we do things this way well because you know There was a time when the browser was kind of dumb You couldn't put any logic in there and the databases were kind of dumb and you couldn't put any logic in there Right and so okay, so I understand that there was a time when you needed that extra that the third tier In that old architecture, but those you know, that's so 1990s All right, we could do it this way and The reason this works is because Postgres lets you run Python and JavaScript and Java code right in the database We're gonna force your business rules just the same way as we do somewhere else and every so well that would never work Why would that never work well because it wouldn't scale why wouldn't it scale? Well, because you know if you're running Python inside Postgres That wouldn't scale as much as you were running Python inside Django You know because they're different because one's a database one's an application server So if you think of your database as the place where you force your business rules Then Postgres is an awesome database and that is what I call Some as theology so now I said the same thing Now as I said earlier when I originally said Postgres is an awesome database when database of course meant a place to keep your data And now I'm saying exactly the same thing only I mean something completely different by it because its meaning has changed Are we still agreeing with this? And I have to phrase it in some way that you will not agree with it even though I want to say the same thing So the philosopher I'm not happy with the fact that everybody agrees with what I'm saying So I will ask the same question again. Not not what is the purpose of the database? But what thing is a database most like what thing is a database most not like what's the difference between a database and a thing Which is not a database like if a thing was didn't look like a database could you argue that it was a database even though it wasn't? So yeah, so I'm gonna do that. I'm gonna make that argument This is the the bite magazine cover from August of 1981 so in the 70s and the 80s programming languages had this sort of unique perspective that's completely lost to history like The way it worked was a Programming environment was a virtual machine image It was a complete copy of your entire virtual machine memory And that was called the image and then you loaded that up and it had all your functions in your data You in in it and then you ran that for a while until you were sort of done and then you saved it out And this wasn't just small talk lists work that way APL work that way programming environments work that way, you know It was kind of like Docker Only it wasn't a separate thing because everything worked that way And so you didn't worry very much about persistence because it was implied Like if you had a programming environment, it saved everything that you were doing In the programming environment, you didn't have to separate that part out So a programming environment was a place where you kept all your data and business logic Forever is that Not the same thing as what Postgres does today Keeps your data and your business logic. Hopefully forever. So then Postgres is kind of like small talk only different Then what's the difference? Well, we took the UI out of small talk and put it in the browser And then the rest of it is the same So really Postgres is an application delivery platform, you know Just like we had back in the 80s Is it awesome at that? Because if it's a place where you keep in your business rules, you say, yeah, small talk got it, right? Right sort of this environment where you can write your business rules You can debug your business rules you can version your business rules, right? You can you can use it as an application development and delivery platform and So this is the part this is the part where I say all of these things that you say he doesn't know what he's talking about Which is true because these things change very fast So one of the things I was going to point out is I oh so it's a big difference between small talk and Postgres Of course is that small talk had this awesome debugger and there is no debugger in Postgres How many people are familiar with the debugger in Postgres that lets you debug stored procedures graphically? Oh This is the first time I've gotten hands going up. Yes, we have some hands going up, but not very many So either the rest of you are shy or you didn't know that there was a built-in graphical debugger somewhere in there Because it's sort of a carefully guarded secret and my hypothesis So why this is a carefully guarded secret is because everybody thinks oh Postgres is a database which is a place to keep your data. So why would you debug anything in there? It's not a debugging environment All right, so it's okay. So we'll move on. So what did we have back in 1991? You can see it there at the bottom there. This is this is a version browser here 1991 1992 Built into programming environments be they small talk or LISP or APL way back in the 70s and 80s was any time You changed anything it versioned it obviously so that you could revert to the previous version You could deaf between these versions So obviously when you change a stored procedure in Postgres it would do that And it could like how hard is that right? It keeps the stored procedures in in PG proc. It's just a table right you could have a version number a time stamp and You know select the most recent or the previous or whatever you could use a foreign function extension All right a foreign a foreign data wrapper, right? Yes a foreign data wrapper and just talk to a get Repository or a subversion repository as if it were just data right there in the system There's no reason that couldn't work, but we don't do that Why don't we do that while my hypothesis is we don't do that because we say well what why would you want to You can't version data versioning is like an application development programming business rule business logic thing You would do that to your code, but you know Postgres is It's not a code so I think that's that's a that's another ontological error that people have so this was my list that I came up with of those things that I would want in my application development environment my Two-tier architecture, right? I'd want a direct HTTP interface obviously which you could get maybe by by having like an Apache module Anybody wants an Apache module that goes directly into Postgres. I'm sure what does one exist There's one on github so if anybody's interested, you know got one there mod PG You know sort of a JSON rest interface is a bunch of companies that do that There's a slash DB I came across and is one of this kind next DB. I think Bunch of people who do this kind of thing where they expose sort of Postgres directly as a rest interface to the web because you don't need that You don't need Django sort of creating the JSON for you, right? I mean you can create JSON directly in Postgres because it is an application development environment Right. You've got you've got Python. You've got you've got You've got pearl you've got tickle All right, you don't have PHP which I guess is a huge problem But not for me because you know, but I but I like to have a Haskell All right, and so if anybody's interested in working on a on a on a Haskell add-in You know extension so that you can write stored procedures in Haskell that that would be an awesome project I'd love to work with you on it that check and call me Version control. I think there's a number of ways you could solve that That's sort of a problem. That's sort of not solved in the core EDB may have a solution for all I know I don't know But but it seems like you should expect that it would be there Then to be able to diff They you know psyched out I got two databases like are the stored procedures the same between the two of them Can I just dip that like I do a get dip I should be able to a PG diff There's one of those on GitHub for you know these but you know, they're not they're not in the core and of course the debugger Which exists, but I haven't been able to figure out where to get it or how to use it But but I'm working on it because that would be cool. Anyway, and if you had all of this stuff You could think about postgres in a completely different way I call it transgress But postgres Is an awesome database is where I started out It was the platitude that I was going to work with and it would almost work except if it's missing all of these things Then then I think what I'm really trying to say is Postgres would be so much more awesome if only and and and and the Finishing that sentence is the part where we're gonna get more disagreement. So I'm just gonna sort of leave it at that Because I think you know I Think that's why we sort of gather at this conference is is is to figure out ways to make postgres better And not to rest on our laurels even though Michael stonebreaker just got the touring award. So so a little that reflected glory. I think cast upon postgres and That was all I had to say postgres would be so much more awesome if only thanks