Does using mysql's api belong to Embedded database?

268 Views Asked by At

I am confused about "Does using mysql's api belong to Embedded database?",cuz I think using mysql's api only belongs to "Remote connection to the database".For example,I use mysql's api in python code below, does it belong to using embedded database?

import pymysql
import random
import time
connect = pymysql.connect(host='localhost', port=3306, user='root', passwd='******', db='***')
cursor = connect.cursor()
...

At the same time, I want know the difference between "embedded sql and embedded database",Is embedded sql a example of "embedded database"? Thank you for your assistance in advance!

1

There are 1 best solutions below

1
danblack On

embedded mysql is a library that is linked to the application. Everything from the creation of the database and all the data manipulation is contained within the application (hence embedded). Its C/C++ interface contains 4 extra library calls on top of what is normally in the C/C++ interface for talking to a detached/standard/remote database server (aka the mysqld process though a IPC mechanism).

The PyMySQL however is a pure python network only and cannot be embedded. https://github.com/PyMySQL/mysqlclient might be able to link to the embedded library (that MariaDB still makes available) and run as an embedded server if there was a requirement to do so in python.