How to do background scheduling (like Hangfire/Quartz) in a packaged WinUI 3 app that still passes the Store WACK?
See the question and my original answer on StackOverflowAs stated in Windows App SDK app lifecycle
Windows App SDK apps, like UWP apps, are started and stopped. They are either running or not running. [...] unlike UWP apps, they cannot be suspended and resumed
So if you run your background work in-process, you're fine, depending on what you really need, even a PeriodicTimer is ok.
If you must run out-of-process, the easiest is probably to write another .exe doing your cron work, add it to the package, and declare it as a Startup Task for example:
<Package
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
IgnorableNamespaces="desktop">
<Applications>
<Application>
<Extensions>
<desktop:Extension
Category="windows.startupTask"
Executable="bin\MyStartupTask.exe"
EntryPoint="Windows.FullTrustApplication">
<desktop:StartupTask
TaskId="MyStartupTask"
Enabled="false"
DisplayName="My App Service" />
</desktop:Extension>
</Extensions>
</Application>
</Applications>
</Package>
See here to programmatically enable or disable your startup task: StartupTask example
As for local database storage, as long as you store it in the official package-relative ApplicationData.Current.LocalFolder, it should be accessible by both applications.