Caveats using Sqlite on JFFS2 ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Caveats using Sqlite on JFFS2 ?

Ward Willats
Happy New Year folks.

Subject says it all. Any things to look out for when using Sqlite on a JFFS2 filesystem? I see some old stuff from 2011 about WAL mode and MMAP_SHARED, but suspect that is no longer germane? Anything else to watch out for? (This would be for an Open-WRT style embedded Linux on MIPS.)

Thanks

-- Ward

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Caveats using Sqlite on JFFS2 ?

David Woodhouse
On Mon, 2016-01-04 at 13:17 -0800, Ward WIllats wrote:
> Happy New Year folks.
>
> Subject says it all. Any things to look out for when using Sqlite on
> a JFFS2 filesystem? I see some old stuff from 2011 about WAL mode and
> MMAP_SHARED, but suspect that is no longer germane? Anything else to
> watch out for? (This would be for an Open-WRT style embedded Linux on
> MIPS.)

JFFS2 still doesn't support shared writeable mmap; that kind of thing
is discouraged on flash. But other than that, there should be nothing
that's really specific to JFFS2. You want to avoid doing too many
writes, obviously, but that's true for *all* flash-based storage, even
the ones which are pretending to be spinning rust and hiding the
details from the OS.

--
David Woodhouse                            Open Source Technology Centre
[hidden email]                              Intel Corporation


_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Caveats using Sqlite on JFFS2 ?

Stelling Carsten
Additionally, to prevent early wearout of your persistent storage, make sure to configure SQLite, such that temporary files are stored in RAM rather than Flash. Compile with SQLITE_TEMP_STORE=3 or use PRAGMA temp_store (https://www.sqlite.org/tempfiles.html). In an embedded system, you should prefer the compiler switch. Furthermore, you like to tune SQLite's page cache and other memory optimization parameters to adapt SQLite to your constrained memory resources. At least, consider to use UBIFS over JFFS2 if possible. SQLite in normal journaling mode and UBIFS on NAND-Flash is fast and very reliable, even in cases of sudden power loss during transactions.


______________________________________
 Carsten Stelling
F&E Hardware / R&D Hardware

GÖRLITZ Aktiengesellschaft | August-Thyssen-Straße 32 | D-56070 Koblenz
T: +49-261-9285-336 | M:  | F: +49-261-9285-190
Mail to: [hidden email] | www.goerlitz.com

Vorstand | Executive Board: Jörg Figge
Vorsitzender des Aufsichtsrates | Chairman of the supervisory board: Norbert Wagner
Registergericht | Court of registration: Amtsgericht Koblenz HRB 5346
Sitz der Gesellschaft | Registered office: Koblenz
Sind Sie bereit für das Schlüsselerlebnis? www.goerlitz.com/e-world-2016
Member of the IDS-Group

-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von David Woodhouse
Gesendet: Dienstag, 5. Januar 2016 23:50
An: Ward WIllats; General Discussion of SQLite Database
Betreff: Re: [sqlite] Caveats using Sqlite on JFFS2 ?

On Mon, 2016-01-04 at 13:17 -0800, Ward WIllats wrote:
> Happy New Year folks.
>
> Subject says it all. Any things to look out for when using Sqlite on
> a JFFS2 filesystem? I see some old stuff from 2011 about WAL mode and
> MMAP_SHARED, but suspect that is no longer germane? Anything else to
> watch out for? (This would be for an Open-WRT style embedded Linux on
> MIPS.)

JFFS2 still doesn't support shared writeable mmap; that kind of thing
is discouraged on flash. But other than that, there should be nothing
that's really specific to JFFS2. You want to avoid doing too many
writes, obviously, but that's true for *all* flash-based storage, even
the ones which are pretending to be spinning rust and hiding the
details from the OS.

--
David Woodhouse                            Open Source Technology Centre
[hidden email]                              Intel Corporation

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users