00:00
00:00
Newgrounds Background Image Theme

LimeIsHere just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Database Stuff

10,235 Views | 33 Replies
Respond to this Topic

Response to Database Stuff 2012-08-02 14:10:39


Basically the way it works is we have a master database server and a batch of slave servers. The idea is on pages where you only need to read data (especially slower lookups like keyword searches), we use the slave server. These servers are load balanced so if one is busy, it uses a different one, thus keeping page loads nice and efficient.

When we need to add any information, like posting a message, or submitting content, it writes to the primary database. We never directly write data to the slave servers, rather, they use a sort of query queue. When the master database gets a new item added, it adds that query to the slave queue and those all get run in order.

The problems we have been experiencing come from an issue where this queue on the slave servers is falling radically far behind the master. Typically they run immediately, but some of our big automated jobs take a little longer and the slaves fall behind. The site still runs fact because everything is doing what it's supposed to, but new data (such as a newly submitted movie) doesn't exist on the slave server yet, so the submission page throws an error. After a few minutes, the slave catches up and the submission magically works.

Anyway, this latency was something that obviously should not have been happening, so that's why we had the downtime yesterday.

Response to Database Stuff 2012-08-02 17:30:13


At 8/2/12 02:10 PM, PsychoGoldfish wrote: Anyway, this latency was something that obviously should not have been happening, so that's why we had the downtime yesterday.

so the big problem was a few larger things getting moved into the slaves?

hm. What was the fix, simply not allowing people to do anything until the servers caught up, or did you wait and then reboot the machines the DBs were on?


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to Database Stuff 2012-08-03 12:03:21


Crud, I was hoping it was maintenance so projects (I've made a couple I'd like to remove) could be deleted. Ah well...


Find me on: Facebook, Twitter, or Soundcloud.

Response to Database Stuff 2012-08-04 12:02:25


At 8/3/12 12:03 PM, Ectohelix wrote: Crud, I was hoping it was maintenance so projects (I've made a couple I'd like to remove) could be deleted. Ah well...

Well, there was another update recently, so that might count as maintenance.


You know the world's gone crazy when the best rapper's a white guy and the best golfer's a black guy - Chris Rock