A friends table is the cornerstone of social applications. Its
purpose is to define relationships and help answer the question
what are my friends doing.
Here is an example friend’s table:
CREATE TABLE `friends` (
`user_id` bigint(20) unsigned NOT NULL,
`friend_id` bigint(20) unsigned NOT NULL,
`auto_ts` timestamp NOT NULL DEFAULT
CURRENT_TIMESTAMP,
PRIMARY KEY (`user_id`,`friend_id`),
KEY `user_id-auto_ts` (`user_id`,`auto_ts`),
KEY `friend_id-auto_ts` (`friend_id`,`auto_ts`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_unicode_ci
With the table above we can get a list of
user_ids a user follows (following), or a list of people who
follow said user (followers), or get a list of mutual follows.
This is a very simple table structure yet very powerful.
…
We are excited to announce that VividCortex now supports Redis, a popular open source database. After announcing PostgreSQL support in January, our brainiacs continue to create a unified solution for diverse systems.
Baron Schwartz explains the product development further. “Redis is an important database for VividCortex, both strategically and commercially, due to its incredible popularity and our own usage. We rely on Redis to help analyze the massive amounts of time-series data we receive from agents running on customer systems. Although it is a high-performance and reliable system that generally just works, that doesn’t mean it can’t be improved. We were able to significantly optimize our usage of Redis with the network-traffic visibility built into our agents. Most of our …
[Read more]
Most of the time I like pt-kill
, but sometimes it gets a
little overzealous and kills a query that I need. That's why I'm
glad Percona created pt-reanimate
so I can bring
those important queries back to life. Of course the queries are
not exactly the same when they come back, but at least they come
back.
Here's an example of pt-reanimate
in action. First I
add a column to a large table:
alter table big_table add column new_col int;
Here is my DDL in the processlist table:
+---------+------+----------------+----------------------------------------------+
| command | time | state | info |
+---------+------+----------------+----------------------------------------------+
| Query | 146 | altering table | alter table big_table add column
new_col int | …
I have done a lot of benchmarks of MySQL Cluster on large servers
which
is obviously very interesting. As mentioned in a previous blog I
have
an Intel NUC machine now easily accessible. So I thought it would
be
fun to make some benchmarks on this machine to see how fast MySQL
Cluster
runs on small HW.
First a little description of the HW. The CPU is an Intel Core
i5-4250
CPU. It runs at 1.3GHz and have a turbo frequency of 2.3 GHz. The
CPU
has two cores and each core can run two threads
simultaneously
(called hyperhtreading in Intel CPUs). It comes with the box
containing
the motherboard and the CPU. Then you buy one or two DRAMs to it
and an
SSD drive. I installed two DDR3L DRAMs which gives me a total of
16GByte
memory in the machine. In addition I installed an SSD drive of
256GByte.
The box fits nicely into the palm of your hand.
On …
A Quick Security Update
Starting with MySQL 5.7.6, the following functions are now deprecated:
DES (Data Encryption Standard) is known to be less secure and slower than other available encryption methods. There are also many …
[Read more]Yes, after many hours, late nights, hair pulling, some private yelling:
core@master ~/mysql_replication_kubernetes/galera_sync_replication $ kubectl get pods
POD IP CONTAINER(S) IMAGE(S) HOST LABELS STATUS
pxc-node1 10.244.72.7 pxc-node1 capttofu/percona_xtradb_cluster_5_6:latest 172.16.230.136/172.16.230.136 <none> Running
pxc-node2 10.244.15.2 pxc-node2 capttofu/percona_xtradb_cluster_5_6:latest 172.16.230.134/172.16.230.134 <none> Running
pxc-node3 10.244.42.2 pxc-node3 capttofu/percona_xtradb_cluster_5_6:latest 172.16.230.135/172.16.230.135 <none> Running
mysql> show status like 'wsrep_incoming_addresses';
+--------------------------+----------------------------------------------------+
| …
[Read more]
Wed, 2015-04-01 10:28guillaumelefranc
Upgrading a running MariaDB Galera Cluster from 5.5 (previous stable) to 10.0 (stable) is a question which comes up frequently with Remote DBA customers. Although a standard migration from 5.5 to 10.0 is well covered in the Knowledge Base, Galera Cluster upgrades haven’t been really documented in detail now. This howto will cover upgrades on CentOS or RHEL 6 but a similar logic can be applied to Ubuntu/Debian as well.
Prerequisites
It is indeed possible to do a rolling cluster upgrade if the Galera API and provider versions are compatible. Please refer yourself to my previous blog article (https://mariadb.com/blog/deciphering-galera-version-numbers) if you need to understand more about Galera versioning. A simple way to ensure Galera compatibility is to upgrade first to the latest 5.5 Galera …
[Read more]Recently Todd Farmer shared an interesting story about the mysql command line prompt in MySQL 5.7: how it was changed to provide more context and why the change was finally reverted. This made me think that after using the command line client for MongoDB for awhile, I would love seeing a much more modern mysql shell prompt. Here are a few examples of what a modern command line client can do.
Add dynamic information to the prompt
If you use replication with MongoDB, you have probably noticed a nice feature of the prompt: it is replication aware. What I mean is that for a standalone instance, the prompt is simply:
>
When you configure this instance to be the primary of a replica set named RS, the prompt automatically becomes:
RS:PRIMARY>
and for secondaries, you will see:
…[Read more]1) Update_time not accurate in information_schema.tables
Information_schema.tables has a field called update_time and in 5.6 you will notice that it is always NULL. Future versions of MySQL will fix this problem
2) Multiple instance manager
Currently creating , managing and dropping instances in MySQL requires many DBA hours. mysqld_multi is there to help you but it requires initial configuration and there are other third party utilities that could come to your rescue
It would be better to have built in utilities to help us in this regard.. For example db2 has db2icrt that creates an instance , db2ilist to list instances and db2idrop to drop an instance
3) Quiesce database in MySQL
There is no built in quiesce option to block all activity on the database/instance. Although method mentioned in below URL will help you in doing manual quiesce …
[Read more]
Everything seemed complete after configuring my standalone MySQL instance to a LAMP
installation, but last night I started playing with the image
files. It turns out that I failed to install the
php-gd
library.
There’s very little feedback when you try to troubleshoot why you
can’t read an image. In fact, the error message for reading the
BLOB
from MySQL was only available on the local
Firefox browser:
The image "http://localhost/ConvertMySQLBlobToImage.php" cannot be displayed because it contains errors. |
The fix requires root
to install the
php-gd
library with the yum
utility:
yum install php-gd |
You’ll need to answer …
[Read more]