Re: ZEO as a kind of memcache
Rafael Oliveira <[email protected]> Tue, 8 Aug 2017 13:37:05 -0300
| Newsgroups | gmane.comp.web.zope.zodb |
|---|---|
| Message-ID | <CAP+kbOxLOiAAJtgOMBJGgiYOCkXCPjv+XO=1J2jwy6QZ15yfKQ@mail.gmail.com> |
On Mon, Aug 7, 2017 at 6:22 PM, Jim Fulton <[email protected]> wrote: > > It kind of works. I haven't tested it much yet. A problem I already found >> is that when I restart the ZEO server the Zope instances complain with this >> message: ClientStorageError: [('127.0.0.1', 3100)] Client has seen newer >> transactions than server! >> > > This is because the client has a replica of a database that doesn't exist > anymore. > > If you truly want this to be memory only, I think you'd want to find a way > to signal to the clients that they should all discard their caches. Or, as > Sean suggested, store your results persistently. > I thought the "drop-cache-rather-verify" option would do that, but it didn't work as expected. > > >> I'd like your feedback: >> >> - Is this a very crazy idea? Why? >> > > I don't think it's a crazy. > > >> - What are the cons, comparing to memcache? >> > > IDK but a potential major benefit is that it's easy to keep the cache > current, because it's essentially a replica. > > >> - Should I use other storage type, like mappingstorage? >> > > IDK if anyone is maintaining tempstorage any more. But you may want to > have something more persistent than an in-memory storage. > Why would I want that? I want to store computed things, that can be discarded and recalculated any time. > You might be able to get around the client cache issue by creating a > slightly customized mapping storage that initializes itself with a new > transaction on startup. There's a dance between the clients, server, and > storage such that when you restarted the server, the clients would discard > their caches. > > See https://github.com/zopefoundation/ZEO/blob/ > master/src/ZEO/interfaces.py#L101 > and https://github.com/zopefoundation/ZEO/blob/ > master/src/ZEO/StorageServer.py#L769 > Will look into it if I decide to go that road. Thanks. -- You received this message because you are subscribed to the Google Groups "zodb" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.