DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Databases
  4. Your own MySQL Database Server on an Android Tablet

Your own MySQL Database Server on an Android Tablet

Peter Zaitsev user avatar by
Peter Zaitsev
·
Mar. 03, 13 · Interview
Like (0)
Save
Tweet
Share
27.22K Views

Join the DZone community and get the full member experience.

Join For Free

This post comes from Vadim Tkachenko at the MySQL Performance Blog.

Percona Server on the Nexus 7: Your own MySQL Database Server on an Android Tablet

Following Roel’s post, Percona Server on the Raspberry Pi: Your own MySQL Database Server , I thought what other crazy gadget can I run Percona Server on? And having an Asus Nexus 7 Android tablet I decided to give it a try.

Anything below contains a risk that you break your tablet if you do not know what you are doing, so be advised.

First, we need rooted tablet, most likely with custom ROM. I personally use SmoothROM which already comes with root and a proper kernel.

Next, we install Linux environment, I used Linux Deploy App to deploy Ubuntu 12.04 LTS. It does not remove current ROM and works pretty must as a regular Android App. The process is easy, but time consuming. It took about 30 mins to download and install all needed packages. When installation is done and Linux started we are able to SSH to the tablet and get familiar Linux shell.

From now it looks totally like a regular Linux installation, with a difference that this is an ARMv7 architecture, so we won’t be able to download regular 32 or 64bit binaries built for Intel architecture. And we do not have ARM binaries of Percona Server, so we will need to build from sources.

So we install build environment

apt-get install build-essential cmake libncurses5-dev bison libaio-dev

download Percona Server source code

wget http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-5.5.29-29.4/source/Percona-Server-5.5.29-rel29.4.tar.gz

unpack and build. Not, not so simple, unfortunately there is a bug Non-portable code in client plugin (fails on ARM) which will not allow to build from plain sources.
We need to apply a small patch to source, which is available here.

After that to build binaries:

cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF
make -j2
make install

and if everything goes as expect we will have binaries in /usr/local/mysql, which we start

mysql> show variables like 'version%';
+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| version                 | 5.5.29                       |
| version_compile_machine | armv7l                       |
| version_compile_os      | Linux                        |
+-------------------------+------------------------------+

And a quick useless CPU benchmark just to understand some level of performance of tablet CPUs:

Processor       : ARMv7 Processor rev 9 (v7l)
processor       : 0
BogoMIPS        : 1993.93

mysql> SELECT BENCHMARK(10000000,ENCODE('hello','goodbye'));
+-----------------------------------------------+
| BENCHMARK(10000000,ENCODE('hello','goodbye')) |
+-----------------------------------------------+
|                                             0 |
+-----------------------------------------------+
1 row in set (5.12 sec)

to compare with Cisco UCS server:

model name      : Intel(R) Xeon(R) CPU           X5670  @ 2.93GHz
bogomips        : 5851.73

mysql> SELECT BENCHMARK(10000000,ENCODE('hello','goodbye'));
+-----------------------------------------------+
| BENCHMARK(10000000,ENCODE('hello','goodbye')) |
+-----------------------------------------------+
|                                             0 |
+-----------------------------------------------+
1 row in set (1.46 sec)

The next steps is to combine two tablets and run Percona XtraDB Cluster, but there is another bug Can’t build galera on ARM architecture which should be fixed before.

Now I have a hard time thinking about a practical application of running database on a tablet, but it was more to check capabilities of mobile gadgets, which are quite impressive I may say.



Database server Android (robot) MySQL Database

Published at DZone with permission of Peter Zaitsev, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Spring Cloud: How To Deal With Microservice Configuration (Part 1)
  • Top Authentication Trends to Watch Out for in 2023
  • Automated Performance Testing With ArgoCD and Iter8
  • Kubernetes vs Docker: Differences Explained

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: