I'm refactoring an older online catalog system where the various messages sent to users - things like 'Thank you for registering with our store', 'Thank you for your order', 'Your order has shipped' - were all stored as text fields in the database.
我正在重构一个较旧的在线目录系统,其中发送给用户的各种消息 - 诸如“感谢您注册我们的商店”,“感谢您的订单”,“您的订单已发货”等 - 都存储为文本字段在数据库中。
It's worked well enough and it's nice to have the CMS subsystem be able to simply pull a db field into a browser-based editor for updates. But a browser-based editor is also a downside if I want a richer editor to handle more complex layout functions.
它运行良好,让CMS子系统能够简单地将db字段拉入基于浏览器的编辑器进行更新是很好的。但是,如果我想要一个更丰富的编辑器来处理更复杂的布局功能,那么基于浏览器的编辑器也是一个缺点。
Should I give consideration to moving the messages to the filesystem and just store a URI in the db?
我应该考虑将消息移动到文件系统并只在数据库中存储一个URI吗?
thx
1 个解决方案
#1
It sounds like you're already considering it! :)
听起来你已经在考虑它了! :)
Well, doing that will add complexity won't it, because information will have to be looked up. You'll have to look in the database anyway to find where the file is, so what's the point. It'll probably go wonky over time, unless you're very careful, you'll end up with URI's in the database where the file is missing, or files without a URI in the database.
那么,这样做会增加复杂性,因为信息必须被查找。你无论如何都要查看数据库以找到文件的位置,所以重点是什么。随着时间的推移,它可能会变得不稳定,除非你非常小心,否则你最终会在缺少文件的数据库中找到URI,或者在数据库中没有URI的文件。
I'm assuming your richer editor works on files, and that's why you're considering switching to file based?
我假设您的更丰富的编辑器适用于文件,这就是您考虑切换到基于文件的原因?
How about, when you get the record out of the db, just extract the data to temporary file then. Then edit it in the rich editor, then when you've finished and saved it, write it back to the db.
怎么样,当你从数据库中获取记录时,只需将数据提取到临时文件中。然后在富编辑器中编辑它,然后在完成并保存它之后,将其写回数据库。
To be honest, I don't really know enough to answer this. What editor are you considering using?
说实话,我真的不知道回答这个问题。你在考虑使用什么编辑器?
#1
It sounds like you're already considering it! :)
听起来你已经在考虑它了! :)
Well, doing that will add complexity won't it, because information will have to be looked up. You'll have to look in the database anyway to find where the file is, so what's the point. It'll probably go wonky over time, unless you're very careful, you'll end up with URI's in the database where the file is missing, or files without a URI in the database.
那么,这样做会增加复杂性,因为信息必须被查找。你无论如何都要查看数据库以找到文件的位置,所以重点是什么。随着时间的推移,它可能会变得不稳定,除非你非常小心,否则你最终会在缺少文件的数据库中找到URI,或者在数据库中没有URI的文件。
I'm assuming your richer editor works on files, and that's why you're considering switching to file based?
我假设您的更丰富的编辑器适用于文件,这就是您考虑切换到基于文件的原因?
How about, when you get the record out of the db, just extract the data to temporary file then. Then edit it in the rich editor, then when you've finished and saved it, write it back to the db.
怎么样,当你从数据库中获取记录时,只需将数据提取到临时文件中。然后在富编辑器中编辑它,然后在完成并保存它之后,将其写回数据库。
To be honest, I don't really know enough to answer this. What editor are you considering using?
说实话,我真的不知道回答这个问题。你在考虑使用什么编辑器?