Forums Register Login

Regarding file and database system

+Pie Number of slices to send: Send
Hi,
I m a new user of java.
I want to create a chat application.Which storage system shall i use file system or database system and why?
thanks
+Pie Number of slices to send: Send
Hi, welcome to the ranch!

A neat idea in design is to defer any decision as long as possible. If you build a whole system that hasn't decided between files or databases, you likely won't build any dependency on files or databases.

So far I have no idea what you need to store, so I'm making stuff up. But imagine an interface like:

You could start working on your project with the simplest possible implementation of this interface. Maybe one that just has a Map object and only holds data while you are testing. Then later you can choose to make another implementation that uses files or databases. You can even make many implementations and choose between them in configuration.

Any of that make sense? I think you have a lot of other things to worry about first, and you can afford to defer the details of storage for a while. Like, what's the rest of your design like?
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 697 times.
Similar Threads
Unique File Name when uploading using FormFile
database alternatives?
how to get LastModified time of a file system file and webserver file
how to get LastModified time of a file system file and webserver file
how to get LastModified time of a file system file and webserver file
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 02:52:42.