I am currently working on a small scale web application in Django, which will be integrated with a microcontroller.
All the data gathered by the application is saved in an SQL database.
Some of the data will be changed and accessed frequently (e.g. user data, permissions etc.), however - other data (microcontroller configuration for example) will be changed rarely, and accessed frequently by the backend code which works with the microcontroller.
I don't want the microcontroller code to access the database each time to sample its configuration parameters. However, I also don't want to change it directly from the web application (this will break the interface through which I update all other entries in the site).
So far I thought about caching, however - there might be a simpler solution I'm missing...
我目前正在研究Django中的小型Web应用程序,它将与微控制器集成。应用程序收集的所有数据都保存在SQL数据库中。一些数据将被频繁更改和访问(例如用户数据,权限等),但是其他数据(例如微控制器配置)很少会被更改,并且通过与微控制器一起工作的后端代码经常访问。我不希望微控制器代码每次都访问数据库来采样其配置参数。但是,我也不想直接从Web应用程序更改它(这将破坏我更新站点中所有其他条目的界面)。到目前为止,我考虑过缓存 - 可能有一个更简单的解决方案,我想念...
1 个解决方案
#1
0
Use DB caching :
使用DB缓存:
https://docs.djangoproject.com/en/1.9/topics/cache/#database-caching
or memcache in the same article
或同一篇文章中的memcache
#1
0
Use DB caching :
使用DB缓存:
https://docs.djangoproject.com/en/1.9/topics/cache/#database-caching
or memcache in the same article
或同一篇文章中的memcache