https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
d

Daniele B

07/12/2023, 3:50 AM
is there a multiplatform library to connect to a remote mysql database?
j

jw

07/12/2023, 6:09 AM
Over what protocol?
d

Daniele B

07/12/2023, 8:33 AM
I don't have any specific requirements, but I guess TCP/IP should do?
I guess it's not the most secure way. Any alternative for a multiplatform client? Currently I am querying the database from a webservice, and my multiplatform client connects to the webservice with basic authentication. Considering it's a CMS with very few individual users, I was considering removing the webservice layer and connect to the mysql database directly from the client.
o

Oliver.O

07/12/2023, 11:57 AM
Don’t do that. Don’t expose a database to the internet. Keep your attack surface as small as possible.
d

Daniele B

07/12/2023, 12:00 PM
Yes, I guess you are right, there are security implications. I was really thrilled by the idea of removing the webservices layer, and make the architecture much simpler, especially now that Kotlin Multiplatform makes it so simple to build even for non-web platforms. But probably not the smartest idea.
o

Oliver.O

07/12/2023, 12:10 PM
It's tempting to do stuff like that, as it can reduce moving parts of an application. But databases are often complex beasts and notoriously hard to secure.
4 Views