Earlier quoted context omitted.
I work with locations and addresses on an international system. They are not anywhere near as standardized as to allow this. And also at scale, you'll get things that seem like they shouldn't be addresses but are. One of our addresses that caused trouble is literally: "The yellow sign across the street from the Seven-Eleven at ". We have one address that's legally in two countries at the same time. One address is jus…
I understand these issues. That's precisely why a custom type seems appropriate -- it should be able to cover all the alternatives while not burdening you with the problem of storing a discriminated union as a set of disparate relations. Or, at the very least, if this approach still has some issues remaining, it should still have fewer issues than any other approach I can think of, because there's nothing you can't d…
Relational databases aren’t dinosaurs, they’re sharks
71–80 of 135 posts
Re: Relational databases aren’t dinosaurs, they’re sharks
#72Earlier quoted context omitted.
> Some VP will ask "what weekday do users comment the most". This is why people invented read models. Because the data model that works for the app and makes it easy to work with there might not necessarily work for analytics. Generate analytics data from you app model so that both world can move independently. > Need an admin portal? With blobs you are coding all these custom admin pages. Admin portal with direct ac…
or logic is in db, with validation triggers and constraints constraints, but that is not always the case.
Re: Relational databases aren’t dinosaurs, they’re sharks
#73Earlier quoted context omitted.
I understand these issues. That's precisely why a custom type seems appropriate -- it should be able to cover all the alternatives while not burdening you with the problem of storing a discriminated union as a set of disparate relations. Or, at the very least, if this approach still has some issues remaining, it should still have fewer issues than any other approach I can think of, because there's nothing you can't d…
> I understand these issues. I seriously doubt you do. The closest you can get to “standard address format” is: Address Line 1 Address Line 2 Address Line n Postal code (which can be blank) Postal Area (which can be blank) Country There is no way to build “first-class” support for addresses. Because theres no such thing as a valid or invalid address, only whether or not someone can find the correct location by readin…
> there’s no standard, it’s entirely dictated by local conventions, which can change street-to-street, city-to-city
Well, that may be an international issue. In my country's case, it's quite clearly defined by law. A type for an international case might by necessity be a union of unions.
Re: Relational databases aren’t dinosaurs, they’re sharks
#74The choice of technology by developers and their managers is guided in large part by trends rather than by wholly rational decision process. The type of database should be dictated by the application requirements. Relational databases provide some exceptional guarantees while also being able to run quite large systems. This means, when you have: 1. Relational data, 2. Queries that are not known beforehand, 3. Data th…
The answer to questions like 'what is the best DB' is online always 'depends on your use case', but in enterprises is usually 'what upstairs decided'.
Re: Relational databases aren’t dinosaurs, they’re sharks
#75Earlier quoted context omitted.
I work with locations and addresses on an international system. They are not anywhere near as standardized as to allow this. And also at scale, you'll get things that seem like they shouldn't be addresses but are. One of our addresses that caused trouble is literally: "The yellow sign across the street from the Seven-Eleven at ". We have one address that's legally in two countries at the same time. One address is jus…
I understand these issues. That's precisely why a custom type seems appropriate -- it should be able to cover all the alternatives while not burdening you with the problem of storing a discriminated union as a set of disparate relations. Or, at the very least, if this approach still has some issues remaining, it should still have fewer issues than any other approach I can think of, because there's nothing you can't d…
You're right in that there's nothing you can do with JSONB that you can't do with a custom type, but the larger problem is "do I even know how to make a custom type that might fit all of the various inconsistencies that I might face with this data?"
The answer, for me, is no. I have no idea, and I'm not going to pretend. I can throw it all into a giant chunk of JSON and leave explicit note that address handling isn't, and at least that way no one actually thinks that it is, which is probably safer for everyone involved.
Re: Relational databases aren’t dinosaurs, they’re sharks
#76Earlier quoted context omitted.
I've come around to this view, too. Also like names, the best solution is to avoid using them for analysis. Run them through an address geocoding service and store the coordinates next to the address. Use the original address for sending mail or filling out forms, and coordinates for analysis. Unless cleaning, parsing, and geocoding addresses is one of your core business values, let somebody else do it. It's a lot of…
My idea is not in contradiction with your idea. In fact your idea is a part of my idea.
> I've come around to this view, too.
I don't think they were disagreeing with you.
Re: Relational databases aren’t dinosaurs, they’re sharks
#77Earlier quoted context omitted.
I work with locations and addresses on an international system. They are not anywhere near as standardized as to allow this. And also at scale, you'll get things that seem like they shouldn't be addresses but are. One of our addresses that caused trouble is literally: "The yellow sign across the street from the Seven-Eleven at ". We have one address that's legally in two countries at the same time. One address is jus…
I've come around to this view, too. Also like names, the best solution is to avoid using them for analysis. Run them through an address geocoding service and store the coordinates next to the address. Use the original address for sending mail or filling out forms, and coordinates for analysis. Unless cleaning, parsing, and geocoding addresses is one of your core business values, let somebody else do it. It's a lot of…
Despite the address and postcode being both correct and unambiguous the driver followed a pin to a badly geocoded coordinate, and didn't even look at the street name.
I'd encourage anyone (especially Deliveroo) to make more effort to model addresses in the correct locale (UK in my case) rather than taking these shortcuts.
Re: Relational databases aren’t dinosaurs, they’re sharks
#78The choice of technology by developers and their managers is guided in large part by trends rather than by wholly rational decision process. The type of database should be dictated by the application requirements. Relational databases provide some exceptional guarantees while also being able to run quite large systems. This means, when you have: 1. Relational data, 2. Queries that are not known beforehand, 3. Data th…
Re: Relational databases aren’t dinosaurs, they’re sharks
#79Earlier quoted context omitted.
My idea is not in contradiction with your idea. In fact your idea is a part of my idea.
Given that the person started their comment with: > I've come around to this view, too. I don't think they were disagreeing with you.
Re: Relational databases aren’t dinosaurs, they’re sharks
#80Earlier quoted context omitted.
I understand these issues. That's precisely why a custom type seems appropriate -- it should be able to cover all the alternatives while not burdening you with the problem of storing a discriminated union as a set of disparate relations. Or, at the very least, if this approach still has some issues remaining, it should still have fewer issues than any other approach I can think of, because there's nothing you can't d…
This sounds to me like a "just draw the rest of the owl" solution. You're right in that there's nothing you can do with JSONB that you can't do with a custom type, but the larger problem is "do I even know how to make a custom type that might fit all of the various inconsistencies that I might face with this data?" The answer, for me, is no. I have no idea, and I'm not going to pretend. I can throw it all into a gian…