steliadeg
Posts: 2
Joined: Thu Aug 27, 2015 7:02 am

Raspberry Pi 2 as a Database Server?

Thu Aug 27, 2015 9:14 am

Hello,

I am looking to buy a Raspberry Pi 2, which I intend to use it as a database server for a small business.
The database will be PostgreSQL and the OS, Raspbian. "Small business" means that will be used in a school (small one), where students can view classes and check their grades. There will be 50-100 user accounts.

What I am afraid, and I would like to ask for your opinions, is if the Raspberry Pi 2 can handle scenarios like:
- 10 users (or less than 30) send queries at the same time
- 20 users (or more) are connected at the same time
- ... and other scenarios that are focused on connectivity or database operations.

At the beginning, users will have only the permission to read from database (but in future they might add or update data).
All in all, can Raspberry Pi 2 be used as a database server with low to medium traffic? (and maybe with the scenario mentioned above?)

Thank you!

User avatar
realies
Posts: 43
Joined: Fri Jul 18, 2014 9:27 am

Re: Raspberry Pi 2 as a Database Server?

Fri Aug 28, 2015 10:28 am

It would depend on what amount of traffic are these users going to generate, but from experience I would say that this is possible. Make sure you get a decent SD card to minimise the data I/O bottleneck and I would personally not use storage mediums for the server on any of the USB ports, because the ethernet connection and the USB hub share their bandwidth to the SoC. Here are some SD card performance tests. And apparently if you use a gigabit USB LAN instead of than the internal 10/100 LAN you are supposedly going to get better speeds as reported here.

drgeoff
Posts: 10364
Joined: Wed Jan 25, 2012 6:39 pm

Re: Raspberry Pi 2 as a Database Server?

Mon Aug 31, 2015 5:28 pm

SD cards have a limited life. If storing important data on one, ensure you have a backup strategy that will really save your bacon when the inevitable happens.

steliadeg
Posts: 2
Joined: Thu Aug 27, 2015 7:02 am

Re: Raspberry Pi 2 as a Database Server?

Mon Aug 31, 2015 5:36 pm

Is it a good practice to use USB memory stick instead of SD card ?

User avatar
rpdom
Posts: 16398
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Raspberry Pi 2 as a Database Server?

Mon Aug 31, 2015 5:42 pm

steliadeg wrote:Is it a good practice to use USB memory stick instead of SD card ?
Some have said that USB memory sticks are more reliable that SD cards. I have insufficient data to support that. If your data is important then you'd be better off using a USB hard disk.

But, above all: Do regular backups of your data and test those backups to make use they worked.

User avatar
mikronauts
Posts: 2750
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Raspberry Pi 2 as a Database Server?

Mon Aug 31, 2015 6:04 pm

Depends on the amount of data base traffic, and the complexity of the queries.

I would NOT attempt to do this with either SD card or USB flash drive.

Get a nice USB3 SATA enclosure, and put an SSD on the system - one with high IOP and small block transfer rate.

You may find the following articles useful:

http://www.mikronauts.com/raspberry-pi/ ... erry-pi-2/

http://www.mikronauts.com/raspberry-pi/ ... ter-tests/

http://www.mikronauts.com/raspberry-pi/ ... ent-howto/
steliadeg wrote:Hello,

I am looking to buy a Raspberry Pi 2, which I intend to use it as a database server for a small business.
The database will be PostgreSQL and the OS, Raspbian. "Small business" means that will be used in a school (small one), where students can view classes and check their grades. There will be 50-100 user accounts.

What I am afraid, and I would like to ask for your opinions, is if the Raspberry Pi 2 can handle scenarios like:
- 10 users (or less than 30) send queries at the same time
- 20 users (or more) are connected at the same time
- ... and other scenarios that are focused on connectivity or database operations.

At the beginning, users will have only the permission to read from database (but in future they might add or update data).
All in all, can Raspberry Pi 2 be used as a database server with low to medium traffic? (and maybe with the scenario mentioned above?)

Thank you!
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Return to “Networking and servers”