1 00:00:00,000 --> 00:00:04,854 [MUSIC] 2 00:00:04,854 --> 00:00:08,420 Rails apps use SQLite as their database by default. 3 00:00:08,420 --> 00:00:11,310 This is great when you're just starting out because you don't need to install and 4 00:00:11,310 --> 00:00:14,620 run a separate server process on your development machine. 5 00:00:14,620 --> 00:00:17,700 Your Rails process is able to use the SQLite libraries to read and 6 00:00:17,700 --> 00:00:20,560 write the database file that lives right there in your app directory. 7 00:00:21,730 --> 00:00:25,020 But when it comes time to release a serious app that will have thousands of 8 00:00:25,020 --> 00:00:28,920 users to production, SQLite is no longer sufficient. 9 00:00:28,920 --> 00:00:31,920 Only one thing can be written to a SQLite database at the time. 10 00:00:31,920 --> 00:00:36,290 Meaning slower performance if you have many users trying to save data at once. 11 00:00:36,290 --> 00:00:39,870 SQLite also lacks certain features used for performance optimization. 12 00:00:40,940 --> 00:00:44,670 Rails can easily be configured to work with a wide variety of other databases. 13 00:00:44,670 --> 00:00:49,318 But the two that are most popular for production use are MySQL and PostgreSQL or 14 00:00:49,318 --> 00:00:51,180 Postgres for short. 15 00:00:51,180 --> 00:00:53,440 Which of the two is better depends on your needs, but 16 00:00:53,440 --> 00:00:55,050 the general consensus seems to be. 17 00:00:55,050 --> 00:00:58,950 That MySQL is easier to use while Postgres has more features and 18 00:00:58,950 --> 00:01:02,360 is more compliant with the standards for SQL. 19 00:01:02,360 --> 00:01:05,370 In this workshop, we're going to cover using Postgres with the Rails app. 20 00:01:06,520 --> 00:01:10,260 By the way in case you're wondering where the crazy name PostgreSQL came from. 21 00:01:10,260 --> 00:01:14,239 Back to the 1980s, there was a database system called Ingress which used its own 22 00:01:14,239 --> 00:01:15,820 query language rather than SQL. 23 00:01:15,820 --> 00:01:18,474 One of the developers split off from that project and 24 00:01:18,474 --> 00:01:20,680 started work on another database. 25 00:01:20,680 --> 00:01:25,670 Since it came after his work on Ingress, he called it Postgres. 26 00:01:27,790 --> 00:01:30,630 It still used its own query language at that point. 27 00:01:30,630 --> 00:01:31,280 When support for 28 00:01:31,280 --> 00:01:35,240 SQL was added later, the name was changed to reflect that, PostgreSQL.