/    Sign up×
Community /Pin to ProfileBookmark

More than one

This is simply a hypothetical problem. Let’s say I have a web server and it stores general user information (PW, email, age etc…). Now let’s say that the harddrive is full to the brim with this data and I need to expand to a second server so new users can sign up. What tools do I need to achieve this?

to post a comment

12 Comments(s)

Copy linkTweet thisAlerts:
@coleioauthorJul 06.2019 — Bump
Copy linkTweet thisAlerts:
@Steve_R_JonesmoderatorJul 06.2019 — Seems like adding a second hard drive to the first server would be easier.
Copy linkTweet thisAlerts:
@coleioauthorJul 06.2019 — I don't think so, an extra server can handle extra user requests. One server with twice the amount of users would crash. I'm talking about a scalable distributed database. It's hard to find info on the website regarding this topic
Copy linkTweet thisAlerts:
@NogDogJul 06.2019 — First: put all that data into a database, and run that database in its own server (not the web server).

Second: if you ever reach a state where you actually have so much data that one database server is not enough in terms of storage size (and these days that's a _lot_ of data), search on "database sharding" as an option. If it's not storage that's the issue, but database performance due to high user load (likely from multiple web servers behind your load-balancer(s)), then maybe search on "database read-only replicas".
Copy linkTweet thisAlerts:
@coleioauthorJul 06.2019 — Thanks nogdog. What if it's not replicated data though. What if each new entry is unique. And yes I would say it's to suit better dB performance and not storage capacity
Copy linkTweet thisAlerts:
@NogDogJul 08.2019 — "Replication" in the context I was describing has nothing to do with the uniqueness of the data. It has to do with the entire database being replicated across 1 or more other database servers so that database reads can be load-balanced across them much the same as HTTP requests can be load-balanced across multiple web servers. In read-heavy contexts (which is typical for most web apps), one DB server will be the target of all database write requests, which will then be propagated by the replication system to the read-only databases. Read requests are then load-balanced to the read-only replicas to spread the load.
Copy linkTweet thisAlerts:
@coleioauthorJul 08.2019 — How does that determine the way the business logic is performed? If there is one server for writing to a database does it effect the cgi scripts design?
Copy linkTweet thisAlerts:
@NogDogJul 08.2019 — @coleio#1606014

It can be done in the application code by hitting a different database host for write requests than it does for read-only requests, or it can be done by a load-balancing tool that the application uses as it's "database host", which then decides which actual DB host to use depending on the type of query being sent.
Copy linkTweet thisAlerts:
@coleioauthorJul 08.2019 — which method is more suitable for a large scale application?
Copy linkTweet thisAlerts:
@NogDogJul 09.2019 — > @coleio#1606022 which method is more suitable for a large scale application?

It may depend on the DBMS you choose, and what tools are available for it. If you can let some sort of smart middleware handle it, then you don't have to worry about it in the application code itself. The app I work on uses PostgreSQL on an Amazon RDS DB service, which handles the master/replication database piece, but we decide in the application code whether to hit the master or the replicant (basically only sending our most-used read queries to the replicant, and sending everything else to the master).
Copy linkTweet thisAlerts:
@coleioauthorJul 09.2019 — im going to go with mysql and probably AWS but, that is a long way down the line still. any idea where i can learn about this type of stuff? what would you even call it, server administration?
Copy linkTweet thisAlerts:
@coleioauthorJul 11.2019 — Bump
×

Success!

Help @coleio spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...