What is the best way to get to offline client-side media storage with Meteor? - media

I am unsure of the mongolitedb persistence lifecycle on the client-side. Is it possible to store binary data in there and later reference in html? Or perhaps the best way is to use html5 persistence through localstorage. Any thoughts or suggestions?

The amplify package gives a nice interface for localStorage. Minimongo doesn't persist anything on the client. It's only stored in memory. If you want to persist some of the documents in local storage you'll need to do it yourself for now.

Related

Should I use Redis to cache the response of queries?

I have a social app on a Parse Server (Ubuntu) and I need to cache server-side the users' content, like their main feed and chat, in order to speed things up. Is Redis suitable for that kind of caching? If not, what would you recommend?
Also, I was thinking a way to minimize my db reads and I came up with an idea of an up-to-date cache, where I'll have triggers on new post saves and there, I'll be refreshing my cache. Is that a good practice?
Redis can deifnitely be used to cache stuff. Twitter uses (or at least used to) Redis to cache the timeline. This blog post can give you more insight as to how they use it. Lot of good snippets of information for why Redis was chosen.

Setting up multiple network layers in Relay Modern

I am using a react-native app with relay modern.
Currently our app's fetchQuery implementation, just does a fetch on the network (like in https://facebook.github.io/relay/docs/en/network-layer.html),
Although there is a possibility of another local-network layer like https://github.com/relay-tools/relay-local-schema which returns data from a local-db like sqlite/realm.
Is there a way to setup offline-first response from local-network layer, followed by automatic request to real network which also populates the store with fresher data (along with writing to local-db)?
Also should/can they share the same store?
From the requirements of Network.create(), it should return a promise containing the payload, there does not seem a possibility to return multiple values.
Any ideas/help/suggestions are appreciated.
What you trying to achieve its complex, and ill go for the easy approach which is long time cache.
As you might know relay modern uses a local storage and its exact copy of the data you are fetching, you can configure this store cache as per your needs, no cache on mutations.
To understand how this is achieve the best library around to customise Relay Modern or Classic network layer you can find in https://github.com/nodkz/react-relay-network-modern
My recommendation: setup your cache and watch your request.... (you going to love it)
Thinking in Relay,
https://facebook.github.io/relay/docs/en/thinking-in-relay.html

GraphQL caching mechanism

I want to use GraphQL to access data from different data sources (CSV, SQL Server, Web Server) . I want to know if caching mechanism is supported, so that when the connection is lost the data is still available? I see the data loader which is data batching to increase the performance of the query, but I do not know how data loader can do caching?
Thanks.
There's no built-in support, but you need to remember that graphql-js (which I assume you're using) isn't a framework, it's just a library. You'd implement caching exactly the same as you'd do it with anything else - by surrounding your data-fetching functions with caching get/set behaviour.
I don't use caching very heavily with graphql-js, but if you've ever implemented caching before, it's exactly the same principle.

Whats the best way of persisting data to Isolated Storage on Windows Phone 7?

I want to persist objects into Isolated Storage, so far I could think of these ways:
Serialize them into an xml file when saving and then serialize them back when saving.
Use an Object DB. Doubt abounds about a good or recommended one (Examples are Perst, winphone7db and Sterling DB)
Anyone can suggest some best practices?
As a basic guideline:
If you need the functionality of a database (relations, transactions, search, etc.) then you should use a database.
If you just need an object store, then you should just save your objects into Isolated Storage directly (serialising where necessary).
I haven't used each of the different DB options available but would probably go with Perst as it's the most established (there's also a good guide here), winphone7db is also not available yet.

Best way to cache persistent data (e.g. code books) in Spring?

I have a series of code books in my database, and I am using plain JDBC calls to fetch them and store them in a collection. I would like to put these in some kind of a cache at application startup time in order to save time later.
I don't need any fancy stuff like automatic object invalidation, TTL etc - the code books change rarely, so I'll trigger the update myself and just reload the whole cache when the need arises.
The project where I need this uses Spring, and this is my first project using it. Is there a standard/elegant way to do this in Spring?
Thanks.
Check out Spring-cache.
Supports EHCache, OSCache and a memory cache, but allows pluggable cache providers too.

Resources