MariaDB vs Memcached: What are the differences?
What is MariaDB? An enhanced, drop-in replacement for MySQL. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry. MariaDB is designed as a drop-in replacement of MySQL(R) with more features, new storage engines, fewer bugs, and better performance.
What is Memcached? High-performance, distributed memory object caching system. Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
MariaDB and Memcached can be categorized as "Databases" tools.
"Drop-in mysql replacement", "Great performance" and "Open source" are the key factors why developers consider MariaDB; whereas "Fast object cache", "High-performance" and "Stable" are the primary reasons why Memcached is favored.
MariaDB and Memcached are both open source tools. It seems that Memcached with 8.99K GitHub stars and 2.6K forks on GitHub has more adoption than MariaDB with 2.82K GitHub stars and 864 GitHub forks.
Facebook, Instagram, and Dropbox are some of the popular companies that use Memcached, whereas MariaDB is used by Grooveshark, Shutterstock, and Geocodio. Memcached has a broader approval, being mentioned in 755 company stacks & 267 developers stacks; compared to MariaDB, which is listed in 496 company stacks and 461 developer stacks.
What is MariaDB?
What is Memcached?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
What are the cons of using MariaDB?
What are the cons of using Memcached?
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions
Around the time of their Series A, Pinterest’s stack included Python and Django, with Tornado and Node.js as web servers. Memcached / Membase and Redis handled caching, with RabbitMQ handling queueing. Nginx, HAproxy and Varnish managed static-delivery and load-balancing, with persistent data storage handled by MySQL.
Airbnb’s web experience is powered by a Rails monolith, called Monorail, that talks to several different Java services. MySQL databases store business data and are partitioned by functionality, with messages and calendar management, for example, stored separately from the main booking flow in their own databases.
As traffic to the site continued growing, though, “one notable resource issue with MySQL databases [was] the increasing number of database connections from application servers.”
Airbnb uses AWS’s Relational Database Service (RDS) to power their MySQL instances, and “RDS uses the community edition of MySQL server, which employs a one-thread-per-connection model of connection management.” With Airbnb’s scale, this meant that their databases would hit the C10K problem, which states that “there is an upper bound in the number of connections that MySQL server can accept and serve without dramatically increasing the number of threads running, which severely degrades MySQL server performance.”
When an RDS MySQL server hits resource limits, users will have trouble connecting to the site.
MySQL does have dynamic thread pooling, but it’s only available in the enterprise edition; AWS MySQL RDS, though, doesn’t offer this feature, meaning Airbnb didn’t have access to dynamic thread pooling out-of-the-box.
After surveying several options, the team chose MariaDB MaxScale, which is “a MySQL database proxy that supports intelligent query routing in between client applications and a set of backend MySQL servers.”
Instead of using the MariaDB MaxScale off-the-shelf, however, they decided to fork it and implement their own version that would include connection pooling. Other MaxScale features, like request throttling and query blocklisting were implemented as well.
To enable horizontal scaling of the web application, the team deployed a MaxScale database proxy service in between app servers and MySQL servers. Through the service discovery system SmartStack, applications now “discover and connect to the database proxy service instead of the MySQL database,” allowing horizontal scaling to meet capacity demands.
Additionally, new Airbnb MaxScale proxy server instances can be launched to further enable horizontal scaling.
As is common in the Rails stack, since the very beginning, we've stayed with MySQL as a relational database, Memcached for key/value storage and Redis for queues and background jobs.
In 2014, we could no longer store all our data in a single MySQL instance - even by buying better hardware. We decided to use sharding and split all of Shopify into dozens of database partitions.
Sharding played nicely for us because Shopify merchants are isolated from each other and we were able to put a subset of merchants on a single shard. It would have been harder if our business assumed shared data between customers.
The sharding project bought us some time regarding database capacity, but as we soon found out, there was a huge single point of failure in our infrastructure. All those shards were still using a single Redis. At one point, the outage of that Redis took down all of Shopify, causing a major disruption we later called “Redismageddon”. This taught us an important lesson to avoid any resources that are shared across all of Shopify.
Over the years, we moved from shards to the concept of "pods". A pod is a fully isolated instance of Shopify with its own datastores like MySQL, Redis, memcached. A pod can be spawned in any region. This approach has helped us eliminate global outages. As of today, we have more than a hundred pods, and since moving to this architecture we haven't had any major outages that affected all of Shopify. An outage today only affects a single pod or region.
At Shopify, over the years, we moved from shards to the concept of "pods". A pod is a fully isolated instance of Shopify with its own datastores like MySQL, Redis, Memcached. A pod can be spawned in any region. This approach has helped us eliminate global outages. As of today, we have more than a hundred pods, and since moving to this architecture we haven't had any major outages that affected all of Shopify. An outage today only affects a single pod or region.
As we grew into hundreds of shards and pods, it became clear that we needed a solution to orchestrate those deployments. Today, we use Docker, Kubernetes, and Google Kubernetes Engine to make it easy to bootstrap resources for new Shopify Pods.
We initially started out with Heroku as our PaaS provider due to a desire to use it by our original developer for our Ruby on Rails application/website at the time. We were finding response times slow, it was painfully slow, sometimes taking 10 seconds to start loading the main page. Moving up to the next "compute" level was going to be very expensive.
We moved our site over to AWS Elastic Beanstalk , not only did response times on the site practically become instant, our cloud bill for the application was cut in half.
In database world we are currently using Amazon RDS for PostgreSQL also, we have both MariaDB and Microsoft SQL Server both hosted on Amazon RDS. The plan is to migrate to AWS Aurora Serverless for all 3 of those database systems.
Additional services we use for our public applications: AWS Lambda, Python, Redis, Memcached, AWS Elastic Load Balancing (ELB), Amazon Elasticsearch Service, Amazon ElastiCache
Since the beginning, Cal Henderson has been the CTO of Slack. Earlier this year, he commented on a Quora question summarizing their current stack.Apps
- Desktop: And Electron to ship it as a desktop application.
- Android: a mix of Java and Kotlin.
- iOS: written in a mix of Objective C and Swift.
- The core application and the API written in PHP/Hack that runs on HHVM.
- The data is stored in MySQL using Vitess.
- Caching is done using Memcached and MCRouter.
- The search service takes help from SolrCloud, with various Java services.
- The messaging system uses WebSockets with many services in Java and Go.
- Load balancing is done using HAproxy with Consul for configuration.
- Most services talk to each other over gRPC,
- Some Thrift and JSON-over-HTTP
- Voice and video calling service was built in Elixir.
- Built using open source tools including Presto, Spark, Airflow, Hadoop and Kafka.
Back in 2014, I was given an opportunity to re-architect SmartZip Analytics platform, and flagship product: SmartTargeting. This is a SaaS software helping real estate professionals keeping up with their prospects and leads in a given neighborhood/territory, finding out (thanks to predictive analytics) who's the most likely to list/sell their home, and running cross-channel marketing automation against them: direct mail, online ads, email... The company also does provide Data APIs to Enterprise customers.
I had inherited years and years of technical debt and I knew things had to change radically. The first enabler to this was to make use of the cloud and go with AWS, so we would stop re-inventing the wheel, and build around managed/scalable services.
For the SaaS product, we kept on working with Rails as this was what my team had the most knowledge in. We've however broken up the monolith and decoupled the front-end application from the backend thanks to the use of Rails API so we'd get independently scalable micro-services from now on.
Our various applications could now be deployed using AWS Elastic Beanstalk so we wouldn't waste any more efforts writing time-consuming Capistrano deployment scripts for instance. Combined with Docker so our application would run within its own container, independently from the underlying host configuration.
Storage-wise, we went with Amazon S3 and ditched any pre-existing local or network storage people used to deal with in our legacy systems. On the database side: Amazon RDS / MySQL initially. Ultimately migrated to Amazon RDS for Aurora / MySQL when it got released. Once again, here you need a managed service your cloud provider handles for you.
Future improvements / technology decisions included:
Caching: Amazon ElastiCache / Memcached CDN: Amazon CloudFront Systems Integration: Segment / Zapier Data-warehousing: Amazon Redshift BI: Amazon Quicksight / Superset Search: Elasticsearch / Amazon Elasticsearch Service / Algolia Monitoring: New Relic
As our usage grows, patterns changed, and/or our business needs evolved, my role as Engineering Manager then Director of Engineering was also to ensure my team kept on learning and innovating, while delivering on business value.
One of these innovations was to get ourselves into Serverless : Adopting AWS Lambda was a big step forward. At the time, only available for Node.js (Not Ruby ) but a great way to handle cost efficiency, unpredictable traffic, sudden bursts of traffic... Ultimately you want the whole chain of services involved in a call to be serverless, and that's when we've started leveraging Amazon DynamoDB on these projects so they'd be fully scalable.
We decided to use MemCachier as our Memcached provider because we were seeing some serious PostgreSQL performance issues with query-heavy pages on the site. We use MemCachier for all Rails caching and pretty aggressively too for the logged out experience (fully cached pages for the most part). We really need to move to Amazon ElastiCache as soon as possible so we can stop paying so much. The only reason we're not moving is because there are some restrictions on the network side due to our main app being hosted on Heroku.
We primarily use MariaDB but use PostgreSQL as a part of GitLab , Sentry and @Nextcloud , which (initially) forced us to use it anyways. While this isn't much of a decision – because we didn't have one (ha ha) – we learned to love the perks and advantages of PostgreSQL anyways. PostgreSQLs extension system makes it even more flexible than a lot of the other SQL-based DBs (that only offer stored procedures) and the additional JOIN options, the enhanced role management and the different authentication options came in really handy, when doing manual maintenance on the databases.
MySQL was founded by Allan Larsson, Michael Widenius and David Axmark in the year 1995, 19 years ago. It was released under the name of co-founder Michael Widenius daughter, ‘My‘. This project was released under GNU General Public License as well as under certain Proprietary License. MySQL was owned by MySQL AB firm until it went into the hands of Oracle Corporation. It is written in Programming Language – C and C++ and is available for Windows, Linux, Solaris, MacOS and FreeBSD.
In the year 2009, Michael Widenius started working on MarisDB as a fork of MySQL. In the year 2012 the bricks of nonprofit MariaDB Foundation was laid. It was named after the founder’s daughter Maria.
MariaDB is a fork of MySQL Relational Database Management System which again is released under GNU General Public License. It is written in Programming Language – C, C++, Perl and Bash and is available for Systems Linux, Windows, Solaris, MacOS and FreeBSD.
Aside from Redis, we use MariaDB to store long-term information like user-data and big-data like regeneration-information for our open-world servers. We extensively use the relational aspects of MariaDB in joins, nested queries and unions.
mysql보다 mariaDB가 join면에서 우수하다는 문서를 읽었습니다. 이 부분은 저의 블로그에서도 다뤘고 저의 word press 블로그는 mysql 대신 mariaDB 를 사용합니다.
특히 limit 기능이 pagenation 처리를 할 때 너무 직관적이고 편해서 mariaDB, mysql을 사랑합니다.
As part of the cacheing system within Drupal.
Memcached mainly took care of creating and rebuilding the REST API cache once changes had been made within Drupal.
Distributed cache exposed through Google App Engine APIs; use to stage fresh data (incoming and recently processed) for faster access in data processing pipeline.
Introduced in computer science course.managing relational database management systems, database analytics, and for data processing
Memcache caches database results and articles, reducing overall DB load and allowing seamless DB maintenance during quiet periods.
수 백만개가 넘는 태그 키워드의 자동완성을 위해서 별도의 데이터베이스를 구축하였습니다. MariaDB 는 MySQL 을 포크한 프로젝트입니다. MySQL 과의 강력한 호환성을 지니며, 큰 튜닝 없이 강력한 성능을 보장합니다.
MariaDB has allowed us to easily scale out our DB cluster. Also has better replication tools than MySQL
Used to cache most used files for our clients. Connected with CloudFlare Railgun Optimizer.