I am working through a MySQL design issue. I have a server with a database of phone numbers used in nuisance calls, like robocallers. I also have remote clients that are provisioned. I want the remote clients to submit their data to the server.

A client can use mysql_connect to connect to the server's database but it seems like the wrong tool for the job. There's no real need for TCP's reliable, stream oriented connection because the connection is not kept alive. (Not to mention support for TLS Client Authentication using PKIX mostly sucks in web protocols and applications).

I think a UDP datagram sent by the client with the tuples {client id, caller id, datetime, signature} is the most appropriate tool for the job. It does not need the 3-way handshake and it does not rely on web protocols. And if the message gets lost it is no big deal because there are plenty of other clients generating plenty of other data points.

I'm having trouble figuring out how to make it work with MySQL.

Is there a way to configure a MySQL server to handle fire-and-forget UDP or DTLS datagrams sent by provisioned clients?

Or do I need to build a proxy that knows how to handle a message {client id, caller, datetime, signature}, and then performs the insert on behalf of the client?

Or maybe something else?

1 Answer 1


Clients should not connect directly to the database.

Protect your database with an API which exposes methods the client can call with your desired protocol

  • Thanks Ewan. Is it common to build a front end and API for this case?
    – user118658
    Mar 27, 2019 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.