• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding file and database system

 
Ashutosh Mehta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!