Mysql vs. Sqlite
Mysql vs. Sqlite
Mysql vs. Sqlite
You have 1 free member-only story left this month. Sign up for Medium and get an extra one.
Member-only story
Listen Share
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 1/15
21/06/2023, 12:14 MySQL vs. SQLite. As a change of pace, I decided to take… | by Mike Wolfe | Towards Data Science
As a change of pace, I decided to take a trip back to Databases. This time though, I
wanted to do a little comparison instead of another tutorial-style post. Thinking
about my time in college, I remember a particular class where we discussed using
either MySQL or SQLite. In the end, we used SQLite due to the portability, but this
got me thinking. The conversation would suggest that MySQL and SQLite were very
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 2/15
21/06/2023, 12:14 MySQL vs. SQLite. As a change of pace, I decided to take… | by Mike Wolfe | Towards Data Science
similar, however, I know that is not the case. So how are they different? And are
there any areas they are very similar? So in this post, we will be discussing just that.
How different are MySQL and SQLite? And which is better to use for your project?
Next, we can take a look at how it runs or what it runs on. MySQL uses a database
server to run on a network, which can then be accessed by the client. SQLite,
however, is what is known as an embedded database. This means that the structure
is stored on the application itself. By storing on the application, SQLite is portable
and easy to move, as all table information is located in the file. That being said, it
also means that no other application on a network has access to the database.
Being SQLite is portable, it must then also be very lightweight. In fact, the required
space, although depending on the system, can be less than 600 KiB. SQLite also
requires no prior installation nor setup. Additionally, it is also entirely self-
contained and therefore has no external dependencies. SQLite is also sometimes
referred to as an “out-of-the-box” RDBMS, as it does not require configuration such
as starting or stopping the program. MySQL, on the other hand, does require
installation. It also runs much heavier. The required space to function is around 600
Mb. That being said, MySQL also supports replication and scalability.
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 3/15
21/06/2023, 12:14 MySQL vs. SQLite. As a change of pace, I decided to take… | by Mike Wolfe | Towards Data Science
correct type if selected well. On the other hand, SQLite does not support nearly as
many types. In fact, SQLite supports only NULL, integer, real, text, and blob. As you
can see, data may not always find the best fit within one of these types. Such a
setback is required to keep SQLite so beginner-friendly and lightweight.
In terms of scalability, there are a few different factors to consider. First, MySQL is
able to handle a large volume of data. This could be in having a large variety of
tables, or it could be having many entries for each table. With SQLite, it is built to
run lightweight and small, and so the more data is stored the less efficient and the
worse performance is. One small feature that MySQL contains that SQLite does not
is the support of XML format. Another very large factor is the matter of
authentication. With MySQL, users with permissions may be created, which means
those users need to be authenticated. One such form would be usernames and
passwords. This is to prevent outside users from being able to either alter or access
any information within the database. In SQLite, however, there is no built-in
authentication that is supported. This means that not only can anyone access the
database, but that entries or even entire tables may be added, updated, or removed
by anyone.
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 4/15
21/06/2023, 12:14 MySQL vs. SQLite. As a change of pace, I decided to take… | by Mike Wolfe | Towards Data Science
This is because SQLite is embedded, and therefore does not have the same bug
prevention other important security features that MySQL has as a server-side
database.
SQLite is more commonly used when data is predefined and used on applications
such as on mobile. For such applications, being confined in the files of the device is
not a problem, and a network is not needed. That being said, there are times where
SQLite may be the choice. Such a time is if a small amount of space remains, or if
small amounts of data need to be stored for an application that will minimally
access the database and not require heavy calculations. I know when I was making
small projects in college, SQLite was a good way to get a database created quickly.
Those little stand-alone applications may not need users, or even the ability for
more than the application to reach the database, which is when SQLite may be the
decision for you.
All-in-all, it really comes down to what you’re comfortable using, and what you
think seems like the better fit. After all, no one will know your project as well as you
do.
Conclusion
As a change of pace, I thought comparing two different RDBMS, MySQL and SQLite,
was an interesting dive. It gave not only a little background on each but more of an
understanding of how each worked. We also looked at a few major differences
between the two, and that they really are less similar than what you may be lead to
believe. In the end, we took a short look at when you may want to use one over the
other, although that is more up to the user and your particular project. I hope you
learned something from this, and that you found the information useful. I know I
found it interesting. Until next time, cheers!
Readinall
Open appmy articles for free with my weekly newsletter, thanks! Sign up Sign In
MongoDB
From Installation to Implementation: Part 6
towardsdatascience.com
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 6/15
21/06/2023, 12:14 MySQL vs. SQLite. As a change of pace, I decided to take… | by Mike Wolfe | Towards Data Science
References:
Follow
Software Developer, Tech Enthusiast, Runner. Current project http://sqlcheater.com/ Connect with me on
LinkedIn: www.linkedin.com/in/michael-wolfe-176212125
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 7/15
21/06/2023, 12:14 MySQL vs. SQLite. As a change of pace, I decided to take… | by Mike Wolfe | Towards Data Science
51 7
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 8/15
21/06/2023, 12:14 MySQL vs. SQLite. As a change of pace, I decided to take… | by Mike Wolfe | Towards Data Science
4K 50
1.5K 19
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 9/15
21/06/2023, 12:14 MySQL vs. SQLite. As a change of pace, I decided to take… | by Mike Wolfe | Towards Data Science
27
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 10/15
21/06/2023, 12:14 MySQL vs. SQLite. As a change of pace, I decided to take… | by Mike Wolfe | Towards Data Science
3.7K 23
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 11/15
21/06/2023, 12:14 MySQL vs. SQLite. As a change of pace, I decided to take… | by Mike Wolfe | Towards Data Science
25K 435
Lists
New_Reading_List
173 stories · 1 save
2.6K 26
6.2K 63
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 13/15
21/06/2023, 12:14 MySQL vs. SQLite. As a change of pace, I decided to take… | by Mike Wolfe | Towards Data Science
1.1K 16
22K 357
https://towardsdatascience.com/mysql-vs-sqlite-ba40997d88c5 15/15