Prithvi

Commands

SET | GET | DEL

These are the building blocks of working with Prithvi. Lightweight and efficient, they mirror classic key-value store operations.

- SET <key> <value>: Stores the value under the given key.
- GET <key>: Fetches the current value for the key.
- DEL <key>: Removes the key (and its value) from the store.

Terminal

1  SET language Sanskrit

2  GET language

   Sanskrit

3  DEL language

4  GET language

(null)

Key Points

  • SET creates or updates a key with a value.
  • GET fetches the current value — returns null if not found.
  • DEL removes the key entirely from memory.
  • Works with strings, numbers, and all Prithvi data types.

LPUSH | RPUSH | LPOP | RPOP

Prithvi supports list operations similar to Redis. You can push values to either end and pop them from either side as well.

- LPUSH <key> <value>: Pushes to the *left* of the list (start).
- RPUSH <key> <value>: Pushes to the *right* of the list (end).
- LPOP <key>: Removes and returns the *first* element.
- RPOP <key>: Removes and returns the *last* element.

Terminal

1  LPUSH tasks Code

2  RPUSH tasks Sleep

3  RPUSH tasks Repeat

4  LPOP tasks

   Code

5  RPOP tasks

   Repeat

Key Points

  • Lists are ordered — supports queue and stack behavior.
  • LPUSH/RPUSH add to front/back respectively.
  • LPOP/RPOP remove from front/back respectively.
  • Can be used to build task queues, job pipelines, etc.

SADD | SMEMBERS | SREM

Prithvi supports native Set operations — useful for collections of unique elements. Elements are stored unordered and without duplicates.

- SADD <key> <element>: Adds an element to the set under the given key.
- SMEMBERS <key>: Lists all unique elements in the set.
- SREM <key> <element>: Removes an element from the set.

Terminal

1  SADD fruits Mango

2  SADD fruits Banana

3  SADD fruits Mango

4  SMEMBERS fruits

   Banana

   Mango

5  SREM fruits Mango

6  SMEMBERS fruits

   Banana

Key Points

  • SADD adds only if the element doesn't exist (no duplicates).
  • SMEMBERS returns all unique values (unordered).
  • SREM removes a specific value from the set.
  • Useful for tags, memberships, and uniqueness tracking.

GETLIST | KEYS | FLUSH | EXISTS | HELP | QUIT

Prithvi provides several utility commands to inspect, manage, and interact with the key-value store effectively.

- GETLIST <key>: Fetches all list elements stored under a key.
- KEYS: Displays all keys with their TTL (if any).
- EXISTS <key>: Checks whether a key is present.
- FLUSH: Prompts for confirmation before clearing the store.
- FLUSH FALL: Immediately clears all keys.
- HELP: Lists available commands with syntax.
- QUIT: Gracefully closes the client session.

Terminal

1  GETLIST fruits

Banana

Papaya

2  KEYS

fruits - TTL: 120s

name - TTL: none

3  EXISTS name

true

4  FLUSH

Are you sure? Type FLUSH FALL to confirm.

5  FLUSH FALL

Store wiped.

6  HELP

GET <key>

SET <key> <value>

...

FLUSH FALL

QUIT

7  QUIT

Goodbye.

Key Points

  • GETLIST is for list-type keys only.
  • KEYS helps audit TTLs at a glance.
  • EXISTS is useful before mutation.
  • FLUSH has a safety confirmation layer.
  • FLUSH FALL skips prompt and wipes instantly.
  • HELP offers quick onboarding/debug reference.
  • QUIT shuts down the session cleanly.

Prithvi

An open-source, Java-based key-value store engineered for speed, simplicity, and developer control.

© 2025 Prithvi — Built with Java | PHILKHANA SIDHARTH