Use aw-server with MySQL backend


#1

I am trying to use the aw-server component with a MySQL backend but cannot seem to find out where to configure this. I would prefer to use an .ini file, but where would that need to be placed with which settings?

Also: is it correct that I need both aw-core and aw-server to only create a listening server with database-storage if I don’t want to track activity on that server itself? With some modifications I was able to compile those two components on FreeBSD but I have trouble with some of the other ones. So I would prefer not to invest more time if it isn’t necessary in this Use Case.


#2

Also: is it correct that I need both aw-core and aw-server to only create a listening server with database-storage if I don’t want to track activity on that server itself? With some modifications I was able to compile those two components on FreeBSD but I have trouble with some of the other ones. So I would prefer not to invest more time if it isn’t necessary in this Use Case.

We have not tested it at all on FreeBSD so if something doesn’t work you are on your own, but yes you are correct that only aw-server and aw-core should be needed. There’s nothing platform specific in aw-core and aw-server so technically it should be able to run on FreeBSD, but my guess is that there are likely a few issues just as when we ported the project to windows and mac.

I am trying to use the aw-server component with a MySQL backend but cannot seem to find out where to configure this. I would prefer to use an .ini file, but where would that need to be placed with which settings?

The only official database we have official support for is peewee (a SQLite wrapper). We have experimental support for mongodb and raw SQLite (which has some performance improvements over peewee, will hopefully be default later), but we do not recommend using these either.

You could of course code support for MySQL/Postgres yourself (see the aw-core/aw_datastore files), but that would probably take 10+hrs to develop for someone with python and SQL experience.


#3

Yes, I am aware and prepared.

Your documentation reveals this just fine, however, I thought that peewee is a DB wrapper, like an ODBC!? (ref: http://docs.peewee-orm.com/en/latest/) Couldn’t I just tell peewee that instead of using SQLite, it should use MySQL on IP, Port, User, Pass? According to their documentation, that should be possible, but I have no idea where to provide a config (.ini for example) file to tell peewee not to use the default database backend. I would prefer not to hardcode a MySQL connection instead of the SQLite default one.


#4

Ah, that is true. Should be possible to modify our peewee code to connect to a MySQL backend instead, but we have not written any code to support that so it’s not as easy as just changing the aw-server.ini file.
We could possibly add that pretty easily, but considering that we are hoping to avoid peewee in the future (for performance reasons) that’s not a sustainable way to solve the issue.


#5

Hmm, I always thought that a “full blown” database server (like MySQL) would deliver more performance than SQLite. So am I correct to deduct that the throttling factor in your equation is peewee? If that’s the case I think I’ll have to stick to SQLite after all, although I prefer to keep all my DBs in a central location instead of collecting data from SQLite files in containers, vms, machines, etc.


#6

A full-blows database server will give better performance yes, but in our current peewee implementation that is not the bottleneck but not batching rows in transactions is (so migrating to MySQL would probably slightly improve performance, but nothing compared to the 50x performance we now have in the sqlite datastore). We are also switching to sqlite due to more flexibility in case we need to change the DB format in the future, so migrations will be easier to do.

The reason why we don’t prioritize “real” databases is because we don’t expect most users to actually care about installing and setting up a database themselves.