Best Solution for Busy WCF Service to Database

I have a WCF service that writes log records to a database for several applications. It logs sometimes 200K+ an hour. I am using entity framework currently to create the records and each is created independently (per call). That means a connection
is getting created for each one. I've found that because of the heavy amount of connections (this database is shared with another application), that I'm having max connection issues. Since this application is consistently writing to the database, I didn't
know if there was a better way of limiting its connections (maybe sharing them) as the inserts are done asynchronously so the requestor is not held up, and they don't have to be immediately inserted. Since immediately having them isn't a must have, I've also
considered writing the logs to a file then building a batch insert to occur every so often so that only one connection is open when that occurs. Just wondering what may be some suggestions on the best way to go about the creation and handling of the database
connections for a system like this? Thanks.

Hello acfalcon2001,
From my experience, in your case, it is not recommended to call SaveChange() for every record because as you also mentions, it would cause a the heavy amount of connections.
>>I've also considered writing the logs to a file then building a batch insert to occur every so often so that only one connection is open when that occurs
This is the way I would suggest you could do for your case, for using the batch insert in Entity Framework, you could set a static variable to count added the number of entities, if it reaches a limit number(you could set it to 100 or 1000 or others) and
then call the SaveChange() method(this method actually perform a batch insert operation even for one record). For this way, you could refer to the link below to check a detail usage and there is 
detail test information:
http://stackoverflow.com/a/5942176
Or you could use another method:EntityFramework.BulkInsert
https://efbulkinsert.codeplex.com/
And from your description, it seems that your service would only perform an insert operation, if so, you could set:
yourContext.Configuration.AutoDetectChangesEnabled = false;
yourContext.Configuration.ValidateOnSaveEnabled = false;
This coudl improve performance of insertion.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Best solution for replication of 8.16 database

    We have an Oracle 8.16 database running on Windows NT 4.0 and
    would like to replicate to an identical Windows NT 4.0 box.
    We would like to have this replication to be as close to
    real time as possible. If the first box crashes, we would like
    to be able to come up and running on the second box as soon as
    posssible.
    There are some third party products that will do this:
    Legato Octopus and Legato Co Standby Server.
    Can this replication be done entirely within Oracle? What
    are some recommended solutions?
    Scott Almburg
    The Ann Arbor News
    Ann Arbor, Michigan
    [email protected]

    You could make the second database a hot standby database.
    Bev

  • SQL Server 2012 - Wat Is The Best Solution For Creating a Read Only Replicated/AlwaysOn Database

    Hi there I was wondering if someone may have a best recommendation for the following requirement I have with regards setting up a third database server for reporting?
    Current Setup
    SQL Server 2012 Enterprise setup at two sites (Site A & Site B).
    Configured to use AlwaysOn Availability groups for HA and DR.
    Installed on Windows 2012 Servers.
    This is all working and failover works fine and no issues. So…
    Requirement
    A third server needs to be added for the purpose of reporting, to be located on another site (Site C) possibly in another domain. This server needs to have a replicated read only copy of the live database from site A or Site B, whichever is in use. The Site
    C reporting database should be as up-to-date to the Site A or Site B database as possible – preferably within a few seconds anyway….
    Solution - What I believe are available to me
    I believe I can use AlwaysOn and create a ReadOnly replica for the Site C. If so do I assume Site C needs to have the Enterprise version of SQL server i.e. to match Site A & Site B?
    Using log shipping which if I am correct means the Site C does not need to be an Enterprise version.
    Any help on the best solution for this would be greatly appreciated.
    Thanks, Steve

    for always on - all nodes should be part of one windows cluster..if there site C is on different domain - I do not think it works.
    Logshipping works --as long as the sql on site C is is same or higher version(sql 2012 or above).  you can only do read only.
    IMHo, if you can make site C in the same domain then, Always is better solution else log shipping
    also, if your database has enterprise level features such as - partitonin, data compression -- you cannot restore the database on lower editions- so you need to have enterprise edition.
    Hope it Helps!!

  • What is teh best solution for my Problem??

    hello everyone
    i'am planing to develop a Patient Management System (PMS)
    since i 'm not that guru in the J technologies i would like you to get me some help with this decision:
    what is the best solution for developeing an intranet "PMS" which should handles data (connection to postgresql) and runs some algorithm (for planing puropose) im background ??
    1 developeing a web based solution (servlet and jsp and and ..)
    2 developeing an application wich will be manging everything ??? (a kind of programm with its own GUI)
    3 you may have an other idea solution and ill be gald for any advices
    ps sorry for my english its not that great ;)

    Web applications are all the rage these days and IMO rightly so as they greatly reduce deployment cost and headaches.
    They do have some drawbacks though which for you might be important.
    I can imagine that sooner or later (probably sooner in my experience) a requirement to interface with hardware installed on the client machines will emerge.
    Whether this is a barcode scanner or a chipcard reader to get client information from some form of card issued to the client, or maybe a label printer to print out labels for medication bottles doesn't matter, you need to access the client machine directly.
    Web applications have great difficulty with that (in fact, it's all but impossible).
    You could go for an applet solution but that's contrived at best and still leaves the same problems.
    So in your situation an old-fashioned client/server application (maybe using web services to communicate with the serverside application) is likely the best longterm solution.
    You'd have the database remote so everyone has access to the same data, being accessed through processes run on the server and called by the clients. These can also do most of the business logic, leaving the clients relatively dumb responsible mainly for data validation and entry and presentation of the results.

  • Best Practice for Securing Web Services in the BPEL Workflow

    What is the best practice for securing web services which are part of a larger service (a business process) and are defined through BPEL?
    They are all deployed on the same oracle application server.
    Defining agent for each?
    Gateway for all?
    BPEL security extension?
    The top level service that is defined as business process is secure itself through OWSM and username and passwords, but what is the best practice for security establishment for each low level services?
    Regards
    Farbod

    It doesnt matter whether the service is invoked as part of your larger process or not, if it is performing any business critical operation then it should be secured.
    The idea of SOA / designing services is to have the services available so that it can be orchestrated as part of any other business process.
    Today you may have secured your parent services and tomorrow you could come up with a new service which may use one of the existing lower level services.
    If all the services are in one Application server you can make the configuration/development environment lot easier by securing them using the Gateway.
    Typical probelm with any gateway architecture is that the service is available without any security enforcement when accessed directly.
    You can enforce rules at your network layer to allow access to the App server only from Gateway.
    When you have the liberty to use OWSM or any other WS-Security products, i would stay away from any extensions. Two things to consider
    The next BPEL developer in your project may not be aware of Security extensions
    Centralizing Security enforcement will make your development and security operations as loosely coupled and addresses scalability.
    Thanks
    Ram

  • Best practice for consuming web services

    Hi
    we are consuming web service in orchestration by "Add Generated Item".By using this option it creates 1 orch,1xsd file and some bindings.
    we have different projects for schemas,maps and orchestration under our solution in visual studio.
    Now i need to know that what will be the best practice for consuming web service in orchestration i mean in which project should i use "add generated item" (in orchstration project or in schemas project) coz it generates both 1 orch and 1
    schema.
    thanks

    From a service orientation perspective you should abstract the service artifacts from the other artifacts. Otherwise it will be very difficult to update the service interface without affecting the other artifacts. For example you don't want to have to redeply
    your entire application if only one field changes in the service you consume.
    So I typically generate the items, remove the unnecessary stuff, and put them in a separate project.
    Depending on the control you have over the services you want to consume, it would even be better to create another layer of abstraction. By that I mean create your own interface (schema) and map that one to the one the service exposes. This basically
    is only necessary if you consume external services that are beyond your control. By abstracting the interface it exposes, you limit the impact of changes of that interface on the rest of your system. All changes are abstracted behind your own interface.
    If you consume internal services, you can probably control the way the interface is defined. In a service oriented world all internal services expose a well known interface, based on the domain objects you have within your organisation.
    Jean-Paul Smit | Didago IT Consultancy
    Blog |
    Twitter | LinkedIn
    MCTS BizTalk 2006/2010 + Certified SOA Architect
    Please indicate "Mark as Answer" if this post has answered the question.

  • What is best solution for backup ?

    Our environment consisted of RAC (2 nodes). we are trying to back up our database using RMAN with NetBackup.
    we also have other different databases need to be backed up.
    In RAC case, what is best solution for backing up the database ?
    As I mentioned above, we are using RMAN for backup our RAC with NetBackup.
    Actually, the RMAN is not simple utility for me.
    Is there any other way to back up the database in our situation without rman.
    I need some advice from all of you.
    Thanks in advance.

    Hi Justin
    There are many possible ways to backup your database. You must decide the one that suits your environment.
    Following is the list of options that you have.
    1. Take Online Backups
    Issue this command to freeze tablespaces
    SQL> ALTER TABLESPACE tblspcname BEGIN BACKUP;
    Copy all the files belonging to this tablespace to your backup location using OS commands.
    Release the tablespace by using this command.
    SQL> ALTER TABLESPACE tblspcname END BACKUP;
    To find the data files belonging to a particular tablespace you can issue this statement
    SQL>SELECT file_name, tablespace_name FROM dba_data_files ORDER BY tablespace_name;
    2. If your db size is not BIG then you can take logical backups. Logical Backups can be FULL or incremental. In 10g you can have filesets to spilit your logical backups in more than one file with specified sizes. (By Logical Backups I mean EXPORT).
    To take export for example issue this command.
    ORACLE_HOME\bin\exp file=fullpath+filename.dmp log=fullpath+logfilename.log FULL=Y userid=system/pwd@dbconnectstring
    To get full list of export parameters type
    ORACLE_HOME\bin\exp help=y
    3. RMAN (Strongly recommended) but you ruled out its possibility so I won't elaborate on that.
    4. COLD BACKUP
    To perform this type of backup you will need to shutdown your database by issuing this command.
    SQL>SHUTDOWN IMMEDIATE;
    (On RAC you will need to shutdown all the instances before copying files to the backup location).
    Use OS copy command to copy files to backup location.
    (This method is not recommended as it will flush your SGA and your client will complain about performance for the first few hours).
    Let me know if you need more details.
    Hopefully this helps.
    Rgds
    Adnan

  • Best solutions for artwork that is missing?

    What are the best solutions for artwork that is missing? I've heard of Rinse. Are there any risk of damage to my music database if I use any of theses?

    Compressors and limiters are great tools . . . just be careful not to overuse them.
    Too much will squeeze the life out of your sound, especially if it is going to be broadcast and therefore compressed/limited again.

  • TA24002 My 500 GB can't verify nor repair. I have photoshop work that I need to recover. I would like to know which erase option would be the best solution for this problem.

    My 500 GB can't verify nor repair. I have photoshop work that I need to recover. I would like to know what option would be the best solution for this problem?

    You appear to have two issues: 1) a hard drive that is not working properly and 2) files you wish to recover.
    Re 1) you need to answer Kappy's questions.
    Re 2) does the drive load and can you see your photo files? If so can you copy them to another drive?
    Do you not have a backup of the photo files?

  • I have problems in the initiation of the Encore process when opening presents the following error message : "Encore CS6 Cannot Run in Non-Royalty Serialized".... What is the best solution for this problem ?

    Help Me.
    What is the best solution for this problem ?

    Encore is activated when you activate Premiere Pro... so, as Stan asked, how did you install P-Pro?
    Ask for serial number http://forums.adobe.com/thread/1234635 has a FAQ link
    -and a fix for Encore http://forums.adobe.com/thread/1421765?tstart=0 in reply #7
    -plus more Encore http://helpx.adobe.com/encore/kb/cant-write-image-fie-larger1.html

  • What is the best solution for me to run Microsoft Access on my brand new iMAC?  Assume I'm a casual user.

    What is the best solution for me to run Microsoft Access on my brand new iMAC?  Assume I'm a casual user.
    I am lead to believe by some real smart guys on the Apple site that If I have the Apple Store partition my iMAC and add the full suite of Office products on that partition, I can run the few Access programs I have and need to run.
    Comments encouraged.  Thank you in advance for your consideration and help.

    You would have to install Windows, then install Microsoft Office Professional for Windows on it  To install Windows you will have to choose between Boot Camp (faster, free) and a Virtual Machine (simpler, slower, easier to backup)
    You should try LibreOffice (free), it can open Access files, it may not have all Access's feature set though, worth a try.
    www.libreoffice.org

  • Best solution for media storage

    Hi Everyone,
    I am looking for suggestions/how-to on the best setup for media storage. We have two editors (and two computers - Mac Pro PowerPC and iMac Intel). We are currently using an internal 500 GB slot on the Mac Pro along with 1 additional external 1.5 TB drive. Then, on our iMac we use a 1.5 TB external drive. We use, for external drives, LaCie.
    Here's our problem. We are running out of space. So, what is the best solution for media storage? Should we get a small rack for our external drives from LaCie and daisy chain them? Or, should we get a server? The only problem I have with a server is connection speed...we, most of the time, have a slow connection at our college.
    p.s. here is a link to LaCie's website listing a rack...and we have the d2 drives. So, do you daisy chain them or plug each one in individually?
    http://www.lacie.com/us/products/product.htm?pid=10172
    Any ideas/thoughts/suggestions are greatly appreciated!!
    Thanks in advance.
    zanm
    Message was edited by: zanfardinom

    Hi Everyone!
    Thank you all for your suggestions. I agree...Drobo looks great, but I am finding more and more bad news when it comes to editing. It looks like a great solution for archiving. I received another solution with great reviews from one of my colleagues contacts. They work for a big company.
    Hope this helps...something else to add to the mix.
    *Our edit suite storage solution is a Facilis Terrablock 24EX unit. (http://www.facilis2.com/24ex.html) It has 18TB of space and is connected on 4GB Fibre channel to both suites. On top of that we have an Apple X-Serve running Final Cut Server that sorts and catalogs all the video we put in so network users (Mac and PC) can search and look at media from their workstations. We just put this in a few months ago. Before that we had a Rorke Data Galaxy HDX with 6TB of space on a 2GB Fibre Channel connection. ( http://www.rorke.com/av/galaxy-hdx.cfm ) It’s now a backup storage unit. Both systems have excellent performance though, we upgraded mostly for space and the server software.*
    Again, thank you all for your help. I will research all suggestions.

  • Best Solution for Archiving Table data

    Hi All,
    I have a table with huge data. It is not partitioned table.
    On an average per day 10000 records will be inserted into this table. Now I want to archive(backup)
    every one years data manually and keep in safe location and hence delete those archived rows
    from the table. Whenever required it should be easily imported back to this table. All this happens through
    Application.
    One appraoch in my mind right now, is transferring the data from table to flat file with comma separted,
    and whenever required again importing back to the table from Flat file using external tables concept.
    Can any body suggest what is best solution for this.
    Thanks

    The best solution would be partitioning.
    Any other solution requires DML - running DELETE and INSERT transactions to remove a data set and to add a data set (if need be) again.
    With partitioning this is achieved (in sub-seconds) using DDL by exchanging a partition's contents with that of a table. Which means that after the archived data has been loaded (SQL*Loaded, Import, etc) into a table (and indexes created), that table (with indexes) is "swapped" into the partition table as a partition.

  • What is the best solution for migrating from Maverick to Yosemite?

    What is the best solution for migrating from Maverick to Yosemite? Anyone have suggestions?

    Back up all data. Update all third-party software to the latest version and remove any you don't need. Download the Yosemite installer from the App Store. Run it.

  • Is there a list of best practices for Azure Cloud Services?

    Hi all;
    I was talking with a Sql Server expert today and learned that Azure Sql Server can take up to a minute to respond to a query that normally takes a fraction of a second. This is one of those things where it's really valuable to learn it when architecting as
    opposed to when we go live.
    Cloud Services are not Sql Server (obviously) but that led to the question - Is there a list of best practices for Azure Cloud Services? If so, what are they?
    We will be placing the cloud services in multiple datacenters and using traffic manager to point people to the right one. The cloud service will set between an IMAP client & server, pretending to be the mail client to the server, and the server to the client.
    Mostly it will pass all requests & responses across from one to the other.
    thanks - dave
    What we did for the last 6 months -
    Made the world's coolest reporting & docgen system even more amazing

    hi dave,
    >>Cloud Services are not Sql Server (obviously) but that led to the question - Is there a list of best practices for Azure Cloud Services? If so, what are they?
    For this issue, I have collected some blogs and document about best practices for azure cloud service, you can view them, but I am not sure they are your need.
    http://msdn.microsoft.com/en-us/library/azure/xx130451.aspx
    http://gauravmantri.com/2013/01/11/some-best-practices-for-building-windows-azure-cloud-applications/
    http://www.hanselman.com/blog/CloudPowerHowToScaleAzureWebsitesGloballyWithTrafficManager.aspx
    http://msdn.microsoft.com/en-us/library/azure/jj717232.aspxhttp://azure.microsoft.com/en-us/documentation/articles/best-practices-performance/
    >>The cloud service will set between an IMAP client & server, pretending to be the mail client to the server, and the server to the client. Mostly it will pass all requests & responses across from one to the other.
    For your scenarioes, If you'd like to communicate with each instances, I recommend you refer to this document (
    http://msdn.microsoft.com/en-us/library/azure/hh180158.aspx ). And generally, if we want connect the client to server on Azure, the service bus is a good choice (http://azure.microsoft.com/en-us/documentation/articles/cloud-services-dotnet-multi-tier-app-using-service-bus-queues/
    If I misunderstood, please let me know.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • New Airport express not finding wireless network

    I just got a new AX plugged it in it was recognized did the set up and said to update. It went through the update but the amber light kept flashing. After the update I also lost my internet connection. I have to re-establish my internet connection ea

  • PO-GR-IR Link

    Hi All, I have a requirement where in i have to develop a report, for which PO-GR-IR needs to be displayed. We get the hostory of PO from EKBE, and we get GR from MSEG and IR from RSEG. But the problem is if a PO has 4 GRs and 3 IRs then how to know

  • Clone Stamp and Healin Brush not Working

    I am also having problems with this healing brush and clone stamp tool I am running Windows 7 (64 bit on a powerful computer with 6 Gb Ram and pleanty of HDD space.) I am using a wired mouse and do not have a tablet connected. I have duplicated the B

  • Can't Use Scroll Wheel to Turn Pages

    How do I get iBooks to use the scroll wheel on my Logitech mouse to turn pages in iBooks. Seems like it should be an option but I can't seem to find an answer anywhere. It's getting frustrating.

  • Excise Declartion T code /N/BEV2/EDTR

    Hi, We have beverage specific excise duty declaration T code /N/BEV2/EDTR . This SAP standard tcode. This tcode is working only standard excise duty type BI and this tcode not working for our new customized Z excise duty type. In sap any standard opt