[{"data":1,"prerenderedAt":158},["ShallowReactive",2],{"seo-verification":3,"blog-postgresql-vs-mysql-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"id":7,"slug":8,"title":9,"excerpt":10,"readTime":11,"views":12,"isPinned":13,"publishedAt":14,"category":15,"categories":20,"featuredImage":22,"bgImage":23,"posterImage":24,"relatedSolution":25,"intro":28,"sections":29,"ctaTitle":111,"ctaBody":112,"ctaButton":113,"ctaUrl":114,"relatedPosts":115},100,"postgresql-vs-mysql","PostgreSQL vs MySQL: Which Database for Your VPS?","PostgreSQL vs MySQL on a VPS: data types, JSON, transactions, replication, and performance compared to choose your self-hosted database.",8,300,false,"2026-03-12T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":18},5,"Comparison","comparatif","bg-info\u002F10 text-info",[21],{"id":16,"name":17,"slug":18,"color":19,"icon":18},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fpostgresql-vs-mysql-poster.svg",{"categorySlug":26,"appSlug":27},"bases-de-donnees","postgresql","Choosing your database means committing your schema for years. PostgreSQL bets on rigor and extensibility, MySQL on simplicity and ubiquity. Here's how to decide and self-host it cleanly on a VPS.",[30,34,44,47,69,108],{"type":31,"title":32,"body":33},"h2","Why Host Your Database on Your Own VPS","Self-hosting your database on a VPS gives you total control over the engine version, tuning parameters, encryption, and network latency to your application. Rather than putting up with connection limits and the extra cost of a managed database, you co-locate the database and the app on the same private network for sub-millisecond responses. PostgreSQL excels at complex schemas, strict constraints, indexable JSONB, analytical queries, and extensions (PostGIS, pg_trgm, full-text search). MySQL (or MariaDB) remains unbeatable for simplicity, very well supported by CMSs and PHP frameworks, with fast reads. The right choice depends on the nature of your data, not on a matter of principle.",{"type":35,"title":36,"items":37},"ul","What Self-Hosting Brings to Your Database",[38,39,40,41,42,43],"Minimal latency by placing the database on the same private network as the application","Full control over tuning: `shared_buffers`, `innodb_buffer_pool_size`, max connections","Free choice of the version and the update schedule","Logical and physical backups scheduled according to your real needs","Replication and distributed reads configured your way","Encryption at rest and access restricted to the VPS internal network only",{"type":31,"title":45,"body":46},"Prerequisites for a Database on a VPS","A development database or a small site lives comfortably on 1 vCPU and 1 GB of RAM. In production, the golden rule is to size the RAM so that the working index fits in cache: aim for 2 to 4 GB for PostgreSQL (`shared_buffers` around 25% of RAM) and an `innodb_buffer_pool_size` covering your active dataset for MySQL. An SSD\u002FNVMe disk is non-negotiable for writes. Plan for Docker and Compose, a persistent volume dedicated to the data, and above all: never expose the database port to the Internet. Access happens through the internal Docker network or an SSH tunnel.",{"type":48,"title":49,"steps":50},"steps","Deploy PostgreSQL (or MySQL) on a VPS with Docker",[51,54,57,60,63,66],{"title":52,"body":53},"Create a Persistent Volume","Define a named volume `pgdata` (or `mysqldata`) in Compose. Never store data in the container's ephemeral layer: a `docker compose down` must not destroy your database.",{"title":55,"body":56},"Configure the Service and the Secrets","Declare the `postgres:16` or `mysql:8` image, inject the credentials via a `.env` file (never in plaintext in the compose), and bind the port locally only: `127.0.0.1:5432:5432`. The database must not be reachable from outside.",{"title":58,"body":59},"Start and Verify","Run `docker compose up -d`, then test the connection internally with `docker compose exec db psql -U app -d maBase` (or `mysql -u`). Check the encoding (`UTF8`\u002F`utf8mb4`) at creation time to avoid surprises.",{"title":61,"body":62},"Apply Tuning","Mount a custom config file to adjust `shared_buffers`, `work_mem`, and `max_connections` (PostgreSQL) or `innodb_buffer_pool_size` and `max_connections` (MySQL) according to the VPS's actual RAM. Restart the service to apply.",{"title":64,"body":65},"Set Up Backups","Schedule a regular dump via cron: `pg_dump` or `mysqldump`, compressed and copied off the VPS. Test the restore: a backup that has never been restored is not a backup.",{"title":67,"body":68},"Secure Application Access","Have the app and the database communicate through the internal Docker network only. For remote admin access, use an SSH tunnel rather than opening the port. Create an application user with limited privileges, separate from the superuser.",{"type":70,"headers":71,"rows":75},"comparison",[72,73,74],"Criterion","PostgreSQL","MySQL \u002F MariaDB",[76,80,84,88,92,96,100,104],[77,78,79],"Data model","Rich: custom types, arrays, JSONB","Solid, more classic",[81,82,83],"JSON support","Indexable and high-performance JSONB","JSON present, more limited indexing",[85,86,87],"SQL compliance \u002F constraints","Very strict (CHECK, types, DDL transactions)","More permissive",[89,90,91],"Full-text \u002F geo search","Native + PostGIS, pg_trgm","Basic, third-party extensions",[93,94,95],"Simple high-frequency reads","Very good","Excellent, highly optimized",[97,98,99],"Replication","Streaming, logical","Master-slave, simple to set up",[101,102,103],"CMS\u002FPHP ecosystem","Good","The reference (WordPress, etc.)",[105,106,107],"Memory footprint","Moderate","Light to moderate",{"type":109,"body":110},"tip","Whatever the engine, never let a web application open a direct connection per request: on PostgreSQL, put PgBouncer in front as a pooler, and on MySQL, adjust `max_connections` with an application-side pool. A VPS that collapses under load almost always has a problem of unpooled connections rather than a lack of raw power.","A High-Performance Database, Self-Hosted","With a ServOrbit Cloud VPS and its Docker template, deploy PostgreSQL or MySQL on an NVMe disk, isolated from the public network and ready for your automated backups.","Configure My Database VPS","\u002Fvps-cloud",[116,130,144],{"id":117,"slug":118,"title":119,"excerpt":120,"readTime":11,"views":121,"isPinned":13,"publishedAt":122,"category":123,"categories":124,"featuredImage":22,"bgImage":23,"posterImage":126,"relatedSolution":127},4,"coolify-vs-dokploy","Coolify vs Dokploy: which tool should you choose to deploy on your VPS?","A complete Coolify vs Dokploy comparison: features, simplicity, use cases. Which tool should you choose to host and deploy your applications on a VPS?",2600,"2026-06-07T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":18},[125],{"id":16,"name":17,"slug":18,"color":19,"icon":18},"\u002Fblog\u002Fcovers\u002Fcoolify-vs-dokploy-poster.svg",{"categorySlug":128,"appSlug":129},"deploiement","coolify",{"id":131,"slug":132,"title":133,"excerpt":134,"readTime":11,"views":135,"isPinned":13,"publishedAt":136,"category":137,"categories":138,"featuredImage":22,"bgImage":23,"posterImage":140,"relatedSolution":141},93,"n8n-vs-node-red","n8n vs Node-RED: which self-hosted automation tool to choose?","n8n or Node-RED to automate your workflows on a VPS? Technical comparison, Docker prerequisites and self-hosted deployment guide.",641,"2026-03-19T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":18},[139],{"id":16,"name":17,"slug":18,"color":19,"icon":18},"\u002Fblog\u002Fcovers\u002Fn8n-vs-node-red-poster.svg",{"categorySlug":142,"appSlug":143},"automatisation","n8n",{"id":145,"slug":146,"title":147,"excerpt":148,"readTime":149,"views":150,"isPinned":13,"publishedAt":151,"category":152,"categories":153,"featuredImage":22,"bgImage":23,"posterImage":155,"relatedSolution":156},94,"supabase-vs-appwrite","Supabase vs Appwrite: which self-hosted backend for your VPS?","Supabase or Appwrite self-hosted on a VPS? Backend comparison (auth, DB, storage), Docker prerequisites and complete deployment guide.",9,678,"2026-03-18T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":18},[154],{"id":16,"name":17,"slug":18,"color":19,"icon":18},"\u002Fblog\u002Fcovers\u002Fsupabase-vs-appwrite-poster.svg",{"categorySlug":26,"appSlug":157},"supabase",1785628457649]