Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1398
  • Last Modified:

Accessing Blob objects from Java client using RBS / FILESTREAM in SQL 2008

Hi,
I came to know that SQL 2008 support RBS and SharePoint 2010 recommends it for better performance and eliminate limitations on db record size. However, I am interested in implementing the same for my web application written in Java and running on Unix. Has anyone implemented RBS or FILE STREAM Data type from Java? If yes, can you point me to the right article/sample implementation.

One of my friend told me that FILESTREAM can be used only from a .Net client. Is this true? I hope it is not, as SQL server is not designed for only .Net.

Best Regards,
Venkat
0
deshaw
Asked:
deshaw
  • 5
  • 5
1 Solution
 
RimvisCommented:
This might help:Working with SQL Server 2008 Filestream using v1.2 JDBC driverhttp://blogs.msdn.com/b/jdbcteam/archive/2008/10/03/working-with-sql-server-2008-filestream-using-v1-2-jdbc-driver.aspx
0
 
deshawAuthor Commented:
Hi,
Thanks for the quick reply.
As per http://msdn.microsoft.com/en-us/library/cc949109.aspx it seems this method of accessing through TSQL gives you low throughput compared to using varbinary. Our quick test also proved the same. This method has the lowest throughput.
Does it mean that we should store the blobs in db rather than file system?
Thanks,
Venakt
0
 
RimvisCommented:
Sorry, I didn't have hands-on experience with FILESTREAM, so I can't comment on that. In my opinion, it depends, how are you using these fields. If performance is critical, then I would use FILESTREAM, if not, I would stay with VARBINARY. FILESTREAM has some limitations. You can't use database mirroring, you can't use it in temp tables/table variables, and some more. You should consider this.
Here's  a good article on this topic:
http://www.simple-talk.com/sql/learn-sql-server/an-introduction-to-sql-server-filestream/

IMHO storing files on file system is never a good idea. No transactional consistency, no backup consistency. We had one project, where thousands of files were stored in single directory. There were performance problems because of number of files. Of course, it was Windows 2000 server, but I wouldn't risk to use such setup even on current OS'es
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
deshawAuthor Commented:
>>IMHO storing files on file system is never a good idea. No transactional consistency, no backup consistency.
Hi,
If this is correct, howcome Microsoft is recommending to use RBS for SharePoint?
From out tests, we found that accessing FILESTREAM objects using TSQL is very slow compared to reading varbinary objects from both Java and native windows client. Now I am confused about what are the usecase / scenarios where we should go FILESTREAM or RBS.
 
Thanks,
Venakt
0
 
RimvisCommented:
By "storing files on file system" I meant "storing files separately from database". Consider photo album application, where path to photo is stored in database, but actual file is on file system.

I'm not familiar with RBS, but most likely this is much more sophisticated solution that simply "storing files on file system" .
0
 
deshawAuthor Commented:
>>I meant "storing files separately from database".
Do you mean using FILESTREAM object does not provide you the  transactional consistency? If so, how is it different from storing the file in filesystem from our code and hten store the file path in the database, which is very fast when compared to using FILESTREAM object.
Presently we are storing the files into file system from our service layer, but we want to avoid this multi step process and make use of the SQL feature to store the blobs on file system as it takes care of transactions and we don't need to worry about the file handling.
Am I doing something wrong here?
Thanks,
Venkat
0
 
RimvisCommented:
>>Do you mean using FILESTREAM object does not provide you the  transactional consistency?
No, you got me wrong. FILESTREAM DOES provide  transactional consistency.

>> we want to avoid this multi step process and make use of the SQL feature to store the blobs on file system
I think you are going in right direction by trying to store files on database. The question is should you store them on FILESTREAM or simple VARBINARY field? Please see my post above (ID:33611798)


0
 
deshawAuthor Commented:
Sorry,
I could not see your reply for a long time.  We tried the JDBC driver option, but found that it takes more than 5 times when compared to storing the file directly in the database.
Even with native windows api, FILESTREAM method is slower than reading the files directly from a blob field.
It is little weired to me that why FILESTREAM is slower than reading blob from database directly. I am not sure whether I am missing something here.
Best,
Venkat
0
 
RimvisCommented:
Hi deshaw,

Sorry, I don't think I could help you any further.
i suggest you open a new question regarding that specific problem (FILESTREAM being slower than BLOB).


0
 
deshawAuthor Commented:
Unfortunately the provided solution is not optimal.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now