[Python-ideas] Application awareness of memory storage classes

R. David Murray rdmurray at bitdance.com
Tue May 24 09:55:00 EDT 2016


On Tue, 24 May 2016 12:35:26 +1000, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 24 May 2016 at 05:33, R. David Murray <rdmurray at bitdance.com> wrote:
> > On the other hand, the fact that *all* in-block persistent object state
> > gets restored on block abort, regardless of where the exception occurred,
> > could be somewhat confusing to Python programmers.
> 
> It occurs to me that you may want to talk to Mike Bayer and start
> digging into the way SQL Alchemy session objects work, as what you're
> describing here is starting to sound a *lot* like working with the SQL
> Alchemy ORM:
> 
> - you have stateful objects declared as classes (SQL Alchemy models)
> - you have volatile state in memory (the SQL Alchemy session)
> - you have transactional commits to persistent storage (also the session)
> 
> The difference would be that instead of working with a backing
> relational data store, you're working directly with persistent memory.

There are similarities, so yes it will probably be helpful to look
over sqlalchemy transactions in some detail.  I've certainly been
thinking about them while working on the design of the python layer.

> It would also be interesting to see how much of this could be emulated
> with mmap and memoryview, permitting such code to have a slower
> fallback in cases where actual NVRAM wasn't available.

The underlying library itself handles the no-NVRAM fallback using
regular mmapped files.

--David


More information about the Python-ideas mailing list