Sometimes we get an instant Karma. In other cases it takes time for Karmic fruits to ripen. I want to know in later case where does the Karma get stored or how is it remembered.
If you throw a rock at a window, there is the expectation of it hitting the window. Where is this expectation stored?
Likewise with all intention, intending one acts, throwing a rock is an action which begets results. Where are the expected results stored?
If you analyzed the properties of the rock mid flight along with all of the relevant circumstances in the entire world, you could for sure deduct it's trajectory and arrive at it eventually hitting the window.
So the information about the world [incl the result of actions] is the world and is in the world and nowhere else.
In the Dhamma that which perceives & conceives the world is called the world.
If you conceive & perceive someone throwing a rock at a window, you quickly deduct the consequences in as far as you understand the circumstances which the senses present and the more you know the more you can deduct about the outcomes.
If you knew everything about everything you could know everything that is going to happen as a result of a particular action but this is impossible because samsara is beginningless.
Not everything is caused by karma. Some things are caused by other reasons, like the weather. The Sivaka Sutta talks about this. There's a summary at the bottom:
Bile, phlegm, and also wind,
Imbalance and climate too,
Carelessness and assault,
With kamma result as the eighth.
To quote the sutta in detail:
“Some feelings, Sīvaka, arise here originating from phlegm disorders … originating from wind disorders … originating from an imbalance of the three … produced by change of climate … produced by careless behaviour … caused by assault … produced as the result of kamma: that some feelings arise here produced as the result of kamma one can know for oneself, and that is considered to be true in the world. Now when those ascetics and brahmins hold such a doctrine and view as this, ‘Whatever a person experiences, whether it be pleasant or painful or neither-painful-nor-pleasant, all that is caused by what was done in the past,’ they overshoot what one knows by oneself and they overshoot what is considered to be true in the world. Therefore I say that this is wrong on the part of those ascetics and brahmins.”
The Acintita Sutta states that you can't work out karma and its results precisely:
"The [precise working out of the] results of kamma is an unconjecturable that is not to be conjectured about, that would bring madness & vexation to anyone who conjectured about it.
Karma is not like the recording of merits and sins, and the meting out of justice by a divine judge. It's cause and effect, that begins with intentions.
If you knock your head on the wall, you feel pain. This is immediate.
If you don't take care of your health, you may become ill in the long term. This takes time.
If you allow anger, hatred, jealousy and greed to overcome your mind, this will affect your decisions and actions. If you break the law, you will get caught and punished. If you wronged others, people will remember you and react to you. They will not trust you. This also takes time.
The memory of karma is in your body, your mind, the memory and thoughts of people around you, media (books, blogs, social media, mass media etc.), genetics and also the environment.
If I take care of my health, my body "remembers" that. If I help people, people remember that. If I am a good employee, my employer will remember that. If I speak kind words and act in a trustful manner, people would trust me. If I feed and take care of a dog, it will remember that and react positively to me and may protect me. If I plant trees, it will grow taller and create shade for me.
The thing about karma is that it starts with your states of mind, and your intentions, that results in thoughts, words and actions. This then cascades into chain reactions around you. It's the Buddhist version of butterfly effect and chaos theory.
Take the benefits of metta from AN 11.16:
"Monks, for one whose awareness-release through good will is cultivated, developed, pursued, handed the reins and taken as a basis, given a grounding, steadied, consolidated, and well-undertaken, eleven benefits can be expected. Which eleven?
"One sleeps easily, wakes easily, dreams no evil dreams. One is dear to human beings, dear to non-human beings. The devas protect one. Neither fire, poison, nor weapons can touch one. One's mind gains concentration quickly. One's complexion is bright. One dies unconfused and — if penetrating no higher — is headed for the Brahma worlds.
Do you think a mystical karma force will remember metta and protect the metta practitioner from fire, poison and weapons?
No. It's simply that someone who cultivates the metta state of mind, will not get into a situation that results in harm from fire, poison and weapons. He doesn't make enemies. Who would want to harm him? Also, with a well-concentrated mind, he would avoid accidents.
Karma (Pali: kamma) can be understood as an intentional action, a deed.
MN61:9.2: ‘yannu kho ahaṁ idaṁ kāyena kammaṁ kattukāmo idaṁ me kāyakammaṁ attabyābādhāyapi saṁvatteyya, parabyābādhāyapi saṁvatteyya, ubhayabyābādhāyapi saṁvatteyya—
MN61:9.1: When you want to act with the body, you should check on that same deed: ‘Does this act with the body that I want to do lead to hurting myself, hurting others, or hurting both?
Here we see that bad kamma can hurt oneself or others or both. For example, if we spray the fields with DDT, we harm ourselves and others. The kamma of DDT ripens as the crops ripen and are eaten. And DDT persists--it is stored in the body. That is quite heavy kamma indeed. The farmer ends up poisoning the children.
Kamma is an observed principle. There really isn't anybody "keeping score". However, the strength of the intention does affect the fruition. It took us years to brew and spray DDT. It took us more years to disentangle ourselves from that bad kamma. Bad kamma is unskillful.
Good kamma operates on the same principle as bad kamma, but is skillful, with happiness as its fruit:
MN61:9.8: ‘This act with the body that I want to do doesn’t lead to hurting myself, hurting others, or hurting both. It’s skillful, with happiness as its outcome and result.’ Then, Rāhula, you should do such a deed.
Farmers who take care of the land are fed by the land. For generations. Here too, there's nobody "keeping score", no "battery". But the skillful application of intention inevitably leads to happiness for ourselves and others.
Seeing kamma, we can become obsessed with kamma. Understanding the short-sightedness of bad kamma, we can become obsessed with good kamma and even try to acquire merit sufficient for a divine afterlife.
DN33:3.1.131: ‘The Gods of Brahmā’s Host are long-lived, beautiful, and very happy.’ They think: ‘If only, when my body breaks up, after death, I would be reborn in the company of the Gods of Brahmā’s Host!’ They settle on that thought, concentrate on it and develop it. As they’ve settled for less and not developed further, their thought leads to rebirth there. But I say that this is only for those of ethical conduct, not for the unethical. And for those free of desire, not those with desire. The heart’s wish of an ethical person succeeds because of their freedom from desire.
And here too we are cautioned and encouraged to go beyond kamma, to not "settle for less".
AN4.233:5.1: And what are neither dark nor bright deeds with neither dark nor bright results, which lead to the ending of deeds? It’s the intention to give up dark deeds with dark results, bright deeds with bright results, and both dark and bright deeds with both dark and bright results.
Intention drives kamma and assessing perceives its fruit.
Karma is not stored anywhere unless court case is involved nor is it remembered by anyone. Law of Karma is not an absolute Truth like the other Truths which are part of Dhamma. Suppose someone slaps you then it is not necessary that you will hit him back. It is possible that nobody is going to avenge you infact if anyone thinks of avenging you , you might stop him or her. The point is Karma operates in a space which is made up of people like you and me. There are no definite cause and effect. Nobody keeps a score always. By default Karma is not stored anywhere just as memory is not stored anywhere. In a flute there is no memory of music but when we play it , music arises. Similarly memory of karma is not stored anywhere but when we play the flute called consciousness(this is my guess) it arises.