Skip to content
loading...

Worst things you can do, with database architecture

github logo ・1 min read  

So as I was scurrying around the internet for database architecture based questions as I usually do with my free time on a Saturday afternoon, a thought came across my mind, all these blog posts and articles point to what TO DO. But not any single one of them describe a what NOT to do.

Both MySQL and NoSQL. but please indicate as to which. Im certain each will have its own set of topics.

Im just wondering if anyone here can share their experiences.

twitter logo DISCUSS (1)
markdown guide
 

Good to hear I'm not the only one spending their Saturday learning more about databases :)

While not strictly DB architecture here are some thoughts

  • Exhausting primary key space by using an int. You will then be in the impossible situation of having to take a scheduled outage to change this if your table grows to millions or billions of rows. Even if you don't get to this stage inserts will fail once you run out of keys. Use a bigint instead.

  • Not using staging tables when performing ETL. The bigger your database becomes the longer the table will be out of action if you are going to TRUNCATE or DROP it to update your table.

  • Creating an API that allows third parties to infer your growth by seeing your primary keys. Create an alternate key or mapping table instead.

  • Overnormalising your tables. Normal form is great, but don't go overboard or you'll be using too many JOINs and slowing down performance.

  • Not sharding your database and having to commit to more and more outages for any fixes as your database grows.

  • Consider your indexes and how the data will be queried. Not maintaining indexes, or alternatively, overindexing slows performance.

Classic DEV Post from Sep 9 '19

What I learned after applying to 100 jobs

Between August 2014 and July 2019 I applied for just over 100 jobs. Like most people, I find job hu...

Richard Anthony B. Abear profile image
Im a fullstack web engineer of 7 years. I engage myself with new and exciting projects and technologies that challenge my skills.
JOIN DEV NOW

What are you waiting for?