Mistakes Beginners Make When Working with Databases
craigkerstiens.com
Mistakes Beginners Make When Working with Databases
1–10 of 209 posts
Re: Mistakes Beginners Make When Working with Databases
#2I've seen so many bone headed decisions (EAV "schemas" being a recurring one) because it was easier to program around the DB than learn how to use it proper. It's not because a few classes insulate you from the bone headed SQL that it's a good idea.
Re: Mistakes Beginners Make When Working with Databases
#3Re: Mistakes Beginners Make When Working with Databases
#4I think this isn't a question of ints being a mistake and UUIDs being better, it's about using the most appropriate type based on requirements.
Re: Mistakes Beginners Make When Working with Databases
#5Re: Mistakes Beginners Make When Working with Databases
#6Not sure about point 3 ("use UUIDs instead of integer PKs"). Exhausting a 32-bit int takes a lot of usage; exhausting a 64-bit one is completely out of reach for almost everyone. 128-bit UUIDs will take more space to index than ints or bigints and are less human-readable. Depending on what UUID version you use you may or may not lose ordering, which can be a nice-to-have. I think this isn't a question of ints being a…
Re: Mistakes Beginners Make When Working with Databases
#7Not sure about point 3 ("use UUIDs instead of integer PKs"). Exhausting a 32-bit int takes a lot of usage; exhausting a 64-bit one is completely out of reach for almost everyone. 128-bit UUIDs will take more space to index than ints or bigints and are less human-readable. Depending on what UUID version you use you may or may not lose ordering, which can be a nice-to-have. I think this isn't a question of ints being a…
That said, the default SERIAL type in postgres is 32-bit signed integer so it can be surprising when you exceed 2B items.
Re: Mistakes Beginners Make When Working with Databases
#8Re: Mistakes Beginners Make When Working with Databases
#9Not sure about point 3 ("use UUIDs instead of integer PKs"). Exhausting a 32-bit int takes a lot of usage; exhausting a 64-bit one is completely out of reach for almost everyone. 128-bit UUIDs will take more space to index than ints or bigints and are less human-readable. Depending on what UUID version you use you may or may not lose ordering, which can be a nice-to-have. I think this isn't a question of ints being a…
If you want to use uuids, uuid1 may be a better bet.
Re: Mistakes Beginners Make When Working with Databases
#10What they really MEAN is don't store images in your general purpose database, in particular as long strings.
There are however databases with first party support for image storage, which is useful because now you can store the image and metadata about the image together (as well re-using existing solutions like replication, authentication, etc).
Additionally their "solution" is bizarre, they've jumped from using a database to a paid service by a third party, which is itself backed by a database. That seems very "apples & oranges" to me, I mean it would obviously work, but is a big jump from in-house development using a general purpose database.
To give one specific example have they not heard about Oracle Multimedia? That's exactly what it is designed to offer.