What is currently the best free SQL database engine (with built-in data security/encryption) that can be used to develop standalone Windows desktop applications?

I want to create a simple Windows desktop application in C# for Invoicing. Users will have the option to connect to remotely hosted MySQL servers or to run fully standalone/offline. Hence the need to embed a database engine.

I have considered but ruled out SQLite because it does not have built-in security and because it does not support the complete set of ALTER TABLE features that I am likely to need for future application updates. e.g. ALTER COLUMN, ADD CONSTRAINT, and others are not supported.

Microsoft's SQL Server Compact would have been good for what I need, but it was depreciated many years ago and support actually ended this month.

  • See this article. It discusses the same problem you have in detail, along with the options (but no perfect solution) available to you: Databases for Windows Desktop Development: Welcome to the Jungle Jul 21, 2021 at 16:34
  • 2
    When you talk about security do you mean database encryption or something different?
    – Robert
    Jul 21, 2021 at 20:20
  • @Robert yes, primarily database encryption to offer some data protection if the file ends up in the wrong hands. Unsure whether any embedded database would support built-in user accounts and authentication, if so that would be a major plus. Jul 21, 2021 at 23:04

1 Answer 1


One possible solution is Oracle Database Express Edition (XE). This is free database engine, you can distribute it with your product. It have some limitations, the major of them (for you) can be limit of 12GB of data.

Also you can consider Db2 Community Edition. The limitations are mostly about RAM and CPU, not the size of data itself.

P.S. No affiliate with Oracle or IBM

  • 1
    Never heard about either of these before, but both sound very promising. I'm not going to get anywhere near the 12GB data limit of XE and as long as Db2 does not have huge RAM and CPU requirement, it won't be an issue for me. I will look into both in the next couple of days and will accept this answer if either will work for me. Thank you. Jul 22, 2021 at 13:13
  • I have downloaded and installed Oracle XE version 18c. While they clearly promote that you can "Embed in your software", I have not been able to find any articles (zero), help reference or samples online on how to begin doing that. Finding it very difficult to believe that SQLite (with its lack to encryption) is now the only widely used and currently maintained embeddable SQL database. Jul 23, 2021 at 20:30
  • @GabrielDelLeonés AFAIK you will need to install (as separate process) Oracle and IBM databases. At the end they are enterprise class software with so many options... Jul 24, 2021 at 5:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.