Skip to content

Software Development News: .NET, Java, PHP, Ruby, Agile, Databases, SOA, JavaScript, Open Source

Methods & Tools

Subscribe to Methods & Tools
if you are not afraid to read more than one page to be a smarter software developer, software tester or project manager!

Feed aggregator

What Is #DevOps Intelligence? | @DevOpsSummit #AI #ContinuousDelivery

Latest News from AJAX & RIA Journal - Fri, 02/17/2017 - 20:00
One of my favorite parts of the novel The Phoenix Project is when Bill Palmer, DevOps hero and VP of IT Operations for the fictional company “Parts Unlimited” has a light bulb moment about the central importance of IT to the business. The moment comes as the company’s CFO lays out for Bill how he strives to align the goals of his department with the goals of the business. It’s here Bill starts to realize he must take a similar approach with IT. He ultimately turns to data about his delivery process to improve IT’s effectiveness and save his team from outsourcing—and a DevOps team is born.

read more

Categories: Media, RIA

Verizon Buys Skyward to Expand Drone, IoT Offerings

eWeek - Application Development - Fri, 02/17/2017 - 19:03
Skyward's drone management software helps businesses monitor, track and organize their drone operations.
Categories: Media

Effective Ways for Enterprises to Boost Employee Productivity

eWeek - Application Development - Fri, 02/17/2017 - 18:38
Workplace productivity continues to decline, but enterprises can do something about it. Here are eight steps they can take to make employees more productive.
Categories: Media

SQL Server next version CTP 1.3 now available

Microsoft is excited to announce a new preview for the next version of SQL Server (SQL Server v.Next). Community Technology Preview (CTP) 1.3 is available on both Windows and Linux. In this preview, we added several feature enhancements to High Availability and Disaster Recovery (HADR), including the ability to run Always On Availability Groups on Linux. You can try the preview in your choice of development and test environments now: www.sqlserveronlinux.com.

Key CTP 1.3 enhancement: Always On Availability Groups on Linux

In SQL Server v.Next, we continue to add new enhancements for greater availability and higher uptime. A key design principle has been to provide customers with the same HA and DR solutions on all platforms supported by SQL Server. On Windows, Always On depends on Windows Server Failover Clustering (WSFC). On Linux, you can now create Always On Availability Groups, which integrate with Linux-based cluster resource managers to enable automatic monitoring, failure detection and automatic failover during unplanned outages. We started with the popular clustering technology, Pacemaker.

In addition, Availability Groups can now work across Windows and Linux as part of the same Distributed Availability Group. This configuration can accomplish cross-platform migrations without downtime. To learn more, you can read our blog titled “SQL Server on Linux: Mission Critical HADR with Always On Availability Groups”.

Other Enhancements

SQL Server v.Next CTP 1.3 also includes these additional feature enhancements:

  • Full text search is now available for all supported Linux distributions.
  • Resumable online index rebuilds enables users to recover more easily from interruption of index builds, or split an index build across maintenance windows.
  • Temporal Tables Retention Policy support enables customers to more easily manage the amount of historical data retained by temporal tables.
  • Indirect checkpoint performance improvements. Indirect checkpoint is the recommended configuration for large databases and for SQL Server 2016, and now it will be even more performant in SQL Server v.Next.
  • Minimum Replica Commit Availability Groups setting enables users to set the minimum number of replicas that are required to commit a transaction before committing on the primary.
  • For SQL Server v.Next technical preview running on Windows Server, encoding hints in SQL Server Analysis Services is an advanced feature to help optimize refresh times with no impact on query performance.

For additional detail on CTP 1.3, please visit What’s New in SQL Server v.Next, Release Notes and Linux documentation.

Get SQL Server v.Next CTP 1.3 today!

Try the preview of the next release of SQL Server today! Get started with the preview of SQL Server with our developer tutorials that show you how to install and use SQL Server v.Next on macOS, Docker, Windows and Linux and quickly build an app in a programming language of your choice.

Have questions? Join the discussion of SQL Server v.Next at MSDN. If you run into an issue or would like to make a suggestion, you can let us know through Connect. We look forward to hearing from you!

Categories: Database

SQL Server on Linux: Mission-critical HADR with Always On Availability Groups

This post was authored by Mihaela Blendea, Senior Program Manager, SQL Server

In keeping with our goal to enable the same High Availability and Disaster Recovery solutions on all platforms supported by SQL Server, today Microsoft is excited to announce the preview of Always On Availability Groups for Linux in SQL Server v.Next Community Technology Preview (CTP) 1.3. This technology adds to the HADR options available for SQL Server on Linux, having previously enabled shared disk failover cluster instance capabilities.

First released with SQL Server 2012 and enhanced in the 2014 and 2016 releases, Always On Availability Groups is SQL Server’s flagship solution for HADR. It provides High Availability for groups of databases on top of direct attached storage, supporting multiple active secondary replicas for integrated HA/DR, automatic failure detection, fast transparent failover, and read load balancing. This broad set of capabilities is enabling customers to meet the strictest availability SLA requirements for their mission- critical workloads.

Here is an overview of the scenarios that Always On Availability Groups are enabling for SQL Server v.Next:

Run mission-critical application using SQL Server running on Linux

Always On Availability Groups make it easy for your applications to meet rigorous business continuity requirements. This feature is now available on all Linux OS distributions SQL Server v.Next supports — Red Hat Enterprise Linux, Ubuntu and SUSE Linux Enterprise Server. Also, all capabilities that make Availability Groups a flexible, integrated and efficient HADR solution are available on Linux as well:

  • Multidatabase failover – an availability group supports a failover environment for a set of user databases, known as availability databases.
  • Fast failure detection and failover – as a resource in a highly available cluster, an availability group benefits from built-in cluster intelligence for immediate failover detection and failover action.
  • Transparent failover using availability group listener – enables client to use single connection string to primary or secondary databases that does not change in case of failover.
  • Multiple sync/async secondary replicas – an availability group supports up to eight secondary replicas. The availability mode determines whether the primary replica waits (synchronous replica) or not (asynchronous replica) to commit transactions on a database until a given secondary replica has written the transaction log records to disk.
  • Manual/automatic failover with no data loss – failover to a synchronized secondary replica can be triggered automatically by the cluster or on demand by the database administrator.
  • Active secondary replicas available for read/backup workloads – one or more secondary replicas can be configured to support read-only access to secondary databases and/or to permit backups on secondary databases.
  • Automatic seeding – SQL Server automatically creates the secondary replicas for every database in the availability group.
  • Read-only routing – SQL Server routes incoming connections to an availability group listener to a secondary replica that is configured to allow read-only workloads.
  • Database level health monitoring and failover trigger – enhanced database-level monitoring and diagnostics.
  • Disaster Recovery configurations – with Distributed Availability Groups or multisubnet availability group setup.

Here is an illustration of a HADR configuration that an enterprise building a mission-critical application using SQL Server running on Linux can use to achieve: application-level protection (two synchronized secondary replicas), compliance with business continuity regulations (DR replica on remote site) as well as enhance performance (offload reporting and backup workloads to active secondary replicas):

clip_image002

Fig. 1 Always On Availability Groups as an Integrated and Flexible HADR Solution on Linux

On Windows, Always On depends on Windows Server Failover Cluster (WSFC) for distributed metadata storage, failure detection and failover orchestration. On Linux, we are enabling Availability Groups to integrate natively with your choice of clustering technology. For example, in preview today SQL Server v.Next integrates with Pacemaker, a popular Linux clustering technology. Users can add a previously configured SQL Server Availability Group as a resource to a Pacemaker cluster and all the orchestration regarding monitoring, failure detection and failover is taken care of. To achieve this, customers will use the SQL Server Resource Agent for Pacemaker available with the mssql-server-ha package, that is installed alongside mssql-server.

Workload load balancing for increased scale and performance

Previously, users had to set up a cluster to load balance read workloads for their application using readable secondary replicas. Configuring and operating a cluster implied a lot of manageability overhead, if HA was not the goal.

Users can now create a group of replicated databases and leverage the fastest replication technology for SQL Server to offload secondary read-only workloads from the primary replica. If the goal is to conserve resources for mission-critical workloads running on the primary, users can now use read-only routing or directly connect to readable secondary replicas, without depending on integration with any clustering technology. These new capabilities are available for SQL Server running on both Windows and Linux platforms.

clip_image008

Fig. 2 Group of Read-Only Replicated Databases to Load Balance Read-Only Workloads

Note this is not a high-availability setup, as there is no “fabric” to monitor and coordinate failure detection and automatic failover. For users who need HADR capabilities, we recommend they use a cluster manager (WSFC on Windows or Pacemaker on Linux).

Seamless cross-platform migration

By setting up a cross-platform Distributed Availability Group, users can do a live migration of their SQL Server workloads from Windows to Linux or vice versa. We do not recommend running in this configuration in a steady state as there is no cluster manager for cross-platform orchestration, but it is the fastest solution for a cross-platform migration with minimum downtime.

clip_image010

Fig. 3 Cross-Platform Live Migration Using Distributed Availability Groups

Please visit our reference documentation on business continuity for SQL Server on Linux for more specifics on how integration with Pacemaker clustering is achieved in all supported OS flavors and end-to-end functional samples.

Today’s announcement marks the first preview of new Always On Availability Groups capabilities: Linux platform support for HADR as well as new scenarios like creating a cluster-independent group of replicated databases for offloading read-only traffic. Availability Groups are available on all platforms and OS versions that SQL Server v.Next is running on. In upcoming releases, we are going to enhance these capabilities by providing high-availability solutions for containerized environments as well as tooling support for an integrated experience. Stay tuned!

Get started

You can get started with many of these capabilities today:

Learn more
Categories: Database

Eclipse Newsletter - Top Eclipse Marketplace Plugins

Eclipse News - Fri, 02/17/2017 - 17:52
What are the top Eclipse Marketplace plugins? How can you benefit from them? Find out!
Categories: Open Source

Black Duck Hub

Date Created: Fri, 2017-02-17 11:04Date Updated: Thu, 2017-02-23 14:53Black Duck SoftwareSubmitted by: Black Duck Software

Black Duck Hub plugin for Eclipse.

Manage your open source security and license compliance.

Categories: Open Source

Why Data Privacy is Losing Its War Against IT Innovation

eWeek - Application Development - Fri, 02/17/2017 - 16:39
NEWS ANALYSIS: It is quite possible that there is no such thing as personal data privacy anymore--especially when it comes to video.
Categories: Media

How Google Defends Gmail Users From Attacks

eWeek - Application Development - Fri, 02/17/2017 - 15:50
At the RSA Conference, Elie Bursztein anti-fraud and abuse research team lead at Google, explains the many technologies in place to protect Gmail users.
Categories: Media

Find Which Port Is Being Used by a Process

DevX: Open Source Articles - Fri, 02/17/2017 - 15:33
Language: Enterprise||Expertise: Advanced
Categories: Open Source

Find Which Port Is Being Used by a Process

Devx: Latest Published Articles - Fri, 02/17/2017 - 15:33
Language: Enterprise||Expertise: Advanced
Categories: Media

SDK Features – New For Couchbase 4.6

NorthScale Blog - Fri, 02/17/2017 - 08:02

Along with this week’s Couchbase Server 4.6 release we have a super packed release with several new SDK features to help you streamline development. From efficiently managed Data Structures to the latest support for .NET Core, it is time to update to the latest libraries!  We have also released significant updates to our Big Data connectors for Spark and Kafka.

Data Structures

By bringing Native Collection bindings to the Couchbase SDK, it is now even easier to map your document data into structures your language understands.  All the languages support it through simple functions and .NET and Java have extra special support using their Collections Frameworks.  Structures include List, Map, Set, and Queue – each with specific functions for add/remove, push/pop and more.

They are built to be as efficient as possible as well.  Behind the scenes it uses our network-friendly sub-document processes keeping traffic to a minimum while making atomic updates to documents on the server – all while you simply update the collections in your code.

No extra upserts or pulling down the whole document just to modify part of an array.  This is a great way to reduce the amount of document handling you need to do in your application.

.NET Core Integration

Microsoft’s push to cross platform development via .NET Core is extremely important for our community.  So we wanted to make sure you could get .Net Core support for Couchbase as soon as possible.  All .NET applications will benefit from moving to this latest platform – especially for those wanting cross operating system support straight out-of-the-box.

For example, write apps on Windows, deploy on OS X and Linux without having to change your code.  

As usual we push all our .NET libraries to NuGet to make it as simple as possible to integrate Couchbase into your application.

There are way more improvements in the latest .NET SDK release – read about them in the release notes.

Kafka 3.x Updates

Couchbase integration with Kafka has taken a major leap forward.  The 3.x updates bring support for both Sink and Source connector options, allowing you to read from and write to Couchbase using Kafka.  You can also easily process Couchbase events using Kafka Streams technology.

To help simplify development and deployment there is now Kafka Connect support – plug and play without having to write custom connectors between your Buckets and Topics.  This is especially easy via integration with Confluent Control Center – providing many powerful features, including real time monitoring, through a web UI.

Other features worth checking out include Dynamic Topology for rebalance and failover and much more.

Spark 2.x Updates

As with Kafka, our Spark connector has had many significant improvements recently.  The latest improvements include support for Spark 2.0 and related features.  We have even implemented some of the latest leading edge improvements including Structure Streaming (both source and sink!).  Dynamic Topology is now supported to help with failover and rebalance needs in an easy manner.

Other Language Updates

There are many other updates across the Couchbase SDK this month – check out the latest changes in each of them below.  Now is the time to upgrade!

Release notes: .NETJavaNode.js – Go – PHPPythonC

You can keep informed of these releases by following the projects in Github but a better way is to sign up to our Community Newsletter – keep informed of new releases, blogs and community training events that show off the latest new features.

The post SDK Features – New For Couchbase 4.6 appeared first on The Couchbase Blog.

Categories: Architecture, Database

Data Structures: Native Collections New in Couchbase 4.6

NorthScale Blog - Fri, 02/17/2017 - 06:40

Data Structures in Couchbase 4.6 is our newest time-saving SDK feature.  These allow your client applications to easily map your array-based JSON data into language specific structures.

Leveraging native collections support in Couchbase will save you time and hassle:

  • Easily map JSON arrays into language specific structures
  • Couchbase Server manages the document efficiently – automatically using sub-document calls
  • You choose the data structure type you need and start coding

Support for Data Structures is available for all our languages: Java, .NET, Node.js, Go, PHP, Python, and C.  Including powerful Java and .NET implementations via Collections Frameworks and all other languages have a wide range of functional options.

This post shows how to get started using Data Structures, with specific examples in Java (using the Map type) and Python (using List and Queue types).  Video and reference links follow below.

Couchbase Data Structure Types

Four specific kinds of structures have been added to Couchbase client libraries: Map, List, Set, and Queue.  They are all variants of JSON arrays in the database but presented as native types to your client application.

  • List – an array that stores values in order
  • Map  – also known as a dictionary – stores values by key
  • Set – a variant of list that only retains unique combination of values
  • Queue – a variant of a list that offers push and pop operations to add/remove items from the queue in a first-in-first-out (FIFO) manner
Java Collections Examples – Map & List

The Java and .NET APIs have the tightest native Collections interfaces.  This short example edits a user profile document as a Map and adds or updates the email contact information.

As the Map gets updated, so does the Document in the background – no manual saving or upserting is required!

See many more beautiful Couchbase .NET Data Structures examples in Matthew Grove’s blog post.

Map<String, String> userInfo = new CouchbaseMap<String>("user:mnunberg", bucket); 
userInfo.put("email", "mark.nunberg@couchbase.com");

Similarly the List is accessible through the CouchbaseArrayList and easily appended to.

List<String> ll = new CouchbaseArrayList<String>("user:mnunberg_list", bucket); 
ll.add("msg1"); 
ll.add("msg2");

Python Data Structures Examples – Queue

Here is a simple message Queue in Python, including a dictionary of timestamp, sender and some content.  Populate the queue using push to put new messages into it and then use pop to retrieve the first or next entry in the queue, while also removing it from the queue.

All this is done automatically behind the scenes when you use these functions.  No additional calls to the server are required to save the changed Queue.

>>> cb.queue_push("messages::tyler", {'timestamp': 1485389293, 'from':'user::mark', 'content':'Dear Tyler'}, create=True) 
>>> cb.queue_push("messages::tyler", {'timestamp': 1486390293, 'from':'user::jody', 'content':'Dear John...'}) 
>>> cb.queue_pop("messages::tyler").value 

{u'content': u'Dear Tyler', u'timestamp': 1485389293, u'from': u'user::mark'}

Python Data Structures Examples – List

The following example shows a simplified Python example using the List type.  In each case a new document is also created at the same time that it is populated with values.  See the Couchbase Python documentation for examples of the other types.

In an IoT use case you may have sensors recording specific timestamped activities and related data values.  Here, a sensor has its own document and a vehicle ID and timestamp are recorded when detected by the sensor.

>>> cb.list_append("garage1", ['vehicle::1A', '2017-01-24 08:02:00'], create=True) 
>>> cb.list_append("garage1", ['vehicle::2A', '2017-01-24 10:21:00']) 
>>> cb.list_append("garage1", ['vehicle::1A', '2017-01-25 17:16:00'])

The resulting document is an array with each entry holding two values in an array.

[ [ "vehicle::1A", "2017-01-24 08:02:00" ],
  [ "vehicle::2A", "2017-01-24 10:21:00" ],
  [ "vehicle::1A", "2017-01-25 17:16:00" ] ]

Retrieving the values into a Python list is done easily.  Just grab the document and it’s instantly available to iterate over.

>>> garage1 = cb.get('garage1') 
>>> for rec in garage1.value: print rec 

[u'vehicle::1A', u'2017-01-24 08:02:00'] 
[u'vehicle::2A', u'2017-01-24 10:21:00'] 
[u'vehicle::1A', u'2017-01-25 17:16:00']

Next Step

As you can see, the syntax is easy and predictable. By offloading management of these structures to Couchbase Server it simplifies a lot of the communications required to manage dynamic documents. In no time you can be using Couchbase 4.6 as a Data Structure server for your applications.

 

The post Data Structures: Native Collections New in Couchbase 4.6 appeared first on The Couchbase Blog.

Categories: Architecture, Database

Researchers Turn Table on Fraudster Using Own Phishing Tricks

eWeek - Application Development - Fri, 02/17/2017 - 06:20
SecureWorks researchers used social engineering techniques to trick a phishing fraudster into revealing account numbers and ID information that allowed them to shut down the scam.
Categories: Media

Small but Significant Changes to Project Pages

SourceForge.net: Front page news - Fri, 02/17/2017 - 06:03

Continuous improvement is something that drives us here at SourceForge. We’re always looking for ways to improve our site and service in ways both big and small. In the past couple of months, we’ve made a few small but important changes that we think projects can really benefit from. These changes include:

  • HTTPS for git and svn code checkouts – Now all project developers can make use of the more secure https protocol.
  • HTTPS on all our download mirrors
  • High resolution project icons – Large, high resolution icons can now be uploaded to project pages. While these icons may look the same on your desktop, they will appear a lot clearer and better on phone screens and Retina/hi-dpi laptops, and when zooming in on a page.
  • Support for newer, more secure SSH keys – SourceForge now supports the new ed25519 and ecdsa formats.

We hope everyone will find these new enhancements useful and beneficial. Should you have any inquiries or issues regarding these changes, or would like to request other enhancements, please refer to our support page. We’ll do our best to make sure you continue to have a positive experience with SourceForge.

Categories: Open Source

IoT Exploits, Ransomware Among 7 Most Dangerous New Cyber-Attacks

eWeek - Application Development - Fri, 02/17/2017 - 01:55
SANS Institute Researchers detailed a range of cyber-threats, including internet of things exploits and ransomware that enterprises are currently dealing with.
Categories: Media

Introducing Couchbase .NET 2.4.0 – .NET Core GA

NorthScale Blog - Fri, 02/17/2017 - 01:38

This release is the official GA release for .NET Core support for the Couchbase .NET SDK! .NET Core is the latest incarnation of the .NET framework and its described as “.NET Core is a blazing fast, lightweight and modular platform for creating web applications and services that run on Windows, Linux and Mac”

Wait a minute…read that again: “.NET Core is a blazing fast, lightweight and modular platform for creating web applications and services that run on Windows, Linux and Mac. Microsoft .NET applications running on OSX and Linux? What kind of bizzaro world are we living in? It’s the “New” Microsoft for sure!

In this blog post, I’ll go over what is in the 2.4.0 release, changes to packaging (NuGet), and what version of .NET the SDK supports. We’ll also demonstrate some of the new features such as Datastructures.

What’s in this release?

2.4.0 is a large release with over 30 commits. When you consider that we released 3 Developer Previews leading up to 2.4.0, there are actually many, many more commits leading up to this release over the last 6 months. Here is an overview of some of the more impressive features – you can see all of the commits in the “Release Notes” section below:

.NET Core Support

Of course the most significant feature of 2.4.0 is .NET Core support, which from the opening paragraph, means you can now develop on Mac OS or Windows and deploy to Linux (or vice-versa, but the tooling is a bit immature still). This is great stuff and a major change for the traditional Windows developer.

If you’re unaware of .NET Core, you can read up more about it over on the .NET Core website. One cool thing about it is that it’s open source (Apache 2.0) and source is all available on Github.

The Couchbase SDK specifically supports the netstandard1.5 or greater. We tested the SDK using 1.0.0-preview2-1-003177 of the Command Line Tools.

Packaging changes

Just like the three developer previews, the NuGet package will contain binaries for both the .NET Full Framework (targeting .NET 4.5 or greater), but also for .NET Core (targeting .NET Core 1.1). Depending on the target project you are including the dependency for, the correct binaries will be used.

So, if your Visual Studio project is a .NET Full Framework application greater than or equal to 4.5, you’ll get the binaries for the full framework version of .NET. Likewise, if your application is a .NET Core application, then the .NET Core version of the binaries will be used. There should be nothing you have to do to enable this.

The older .NET 4.5 version of the packages will no longer be released; 2.3.11 is the last supported release of the 2.3.X series.

MS Logging for Core

For .NET Core we decided to change from using Common.Logging to MS Logging mainly because no 3rd party (log4net for example) have stable support for .NET Core at this time.

Additionally, by moving from

Common.Logging
  to MS Logging we have removed one more 3rd party dependency – which is always nice. Not that Common.Logging wasn’t sufficient, but it makes more sense to use a dependency from Microsoft.

Here is an example of configuring the 2.4.0 client targeting .NET Core and using NLog:

First add the dependencies to the project.json:

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true,
    "copyToOutput": {
      "include": [ "config.json", "nlog.config" ]
    }
  },

  "dependencies": {
    "CouchbaseNetClient": "2.4.0-dp6",
    "NLog.Extensions.Logging": "1.0.0-rtm-beta1",
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.1"
    },
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Microsoft.Extensions.Logging": "1.1.0"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": "dnxcore50"
    }
  }
}

Then, add a nlog.config file to your project with the following contents:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true"
      internalLogLevel="Debug"
      internalLogFile="c:\temp\internal-nlog.txt">

  <!-- define various log targets -->
  <targets>
    <!-- write logs to file -->
    <target xsi:type="File" name="allfile" fileName="c:\temp\nlog-all-${shortdate}.log"
                layout="${longdate}|${event-properties:item=EventId.Id}|${logger}|${uppercase:${level}}|${message} ${exception}" />

    <target xsi:type="Null" name="blackhole" />
  </targets>

  <rules>
    <!--All logs, including from Microsoft-->
    <logger name="*" minlevel="Trace" writeTo="allfile" />
  </rules>
</nlog>

Finally, add the code to configure the Couchbase SDK for logging:

using Couchbase;
using Couchbase.Logging;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;

namespace ConsoleApp2
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var factory = new LoggerFactory();
            factory.AddDebug();
            factory.AddNLog();
            factory.ConfigureNLog("nlog.config");

            //configure logging on the couchbase client
            var config = new ClientConfiguration
            {
                LoggerFactory = factory
            };

            var cluster = new Cluster(config);
            //use the couchbase client
        }
    }
}

Note that the project.json has a

copyToOutput.include
  value for
nlog.config
 . This is required so the tooling will copy that file to the output directory when built.

Now for the .NET 4.5 Full Framework binaries, the dependency on

Common.Logging
 remains and any existing logging configuration should work as it always has.

Datastructures

Datastructures are a new way of working with Couchbase documents as if they are a common Computer Science data structures such as lists, queues, dictionaries or sets. There are two implementations in the SDK; one as a series of methods on

CouchbaseBucket
  which provide functionality for common data structure operations and another as implementations of the interfaces within
System.Collections.Generics
 . Here is a description of each Datastructure class found in the SDK:

  • CouchbaseDictionary<TKey, TValue>
     : Represents a collection of keys and values stored within a Couchbase Document.
  • CouchbaseList<T>
     : Represents a collection of objects, stored in Couchbase server, that can be individually accessed by index.
  • CouchbaseQueue<T>
     : Provides a persistent Couchbase data structure with FIFO behavior.
  • CouchbaseSet<T>
     : Provides a Couchbase persisted set, which is a collection of objects with no duplicates.

All of these classes are found in the

Couchbase.Collections
  namespace. Here is an example of using a
CouchbaseQueue<T>
 :

var queue = new CouchbaseQueue<Poco>(_bucket, "somekey");
queue.Enqueue(new Poco { Name = "pcoco1" });
queue.Enqueue(new Poco { Name = "pcoco2" });
queue.Enqueue(new Poco { Name = "pcoco3" });

var item = queue.Dequeue();
Assert.AreEqual("pcoco1", item.Name);

Multiplexing IO

The Couchbase SDK has used connection pooling in the past to allow high throughput and scale at the cost of latency and resource utilization. In Couchbase 2.2.4 we introduced a better IO model call Multiplexing IO or MUX-IO, which the client could be configured to use (the default was pooled connections).

In 2.4.0 we are making MUX-IO the default IO model and making connection pooling optional. What this means to you is that some connection pooling properties in your configuration may still be used SDK. For example:

  • PoolConfiguration.MaxSize
      is still used but should be relatively small values – e.g. 5-10
  • PoolConfiguration.MinSize
     should be 0 or 1

To disable MUX-IO it’s simply a matter of setting the 

ClientConfiguration.UseConnectionPooling
to true (the default is false) to use connection pooling:

var clientConfig = new ClientConfiguration{
    UseConnectionPooling = false
 };
var cluster = new Cluster(clientConfig);
 
//open buckets and use the client

Streaming N1QL and Views

Streaming N1QL and Views are a performance optimization in certain cases where the amount of data retrieved is large. To understand why, let’s consider how non-streaming queries work:

  1. A request is dispatched to the server.
  2. The server does it’s processing and returns back the results as a stream after processing the entire response.
  3. The client buffers the entire stream and then de-serializes the stream into a collection of type “T”, where T is the POCO that each result is mapped to.
  4. The server returns back the list to the application within its
    IResult

What can go wrong here? Think about very large results and that memory resources are finite: eventually you will always encounter an

OutOfMemoryException
 ! There are other side effects as well related to Garbage Collection.

With streaming clients the process is as follows:

  1. A request is dispatched to the server
  2. The server does it’s processing and returns back the results as a stream as soon as the response headers are available.
  3. The client partially reads the headers and meta-data and then pauses until iteration occurs.
  4. When the application starts iterating over the
    IResult
     , each item is read one at a time without storing in an underlying collection.

The big benefit here is that the working set of memory will not grow as the collection grows and internally re-sized by .NET. Instead, you have a fixed working size of memory and GC can occur as soon as the read object is discarded.

To use streaming N1QL and views, all that you do is call the

UseStreaming()
 method and pass in true to stream:

var request = new QueryRequest("SELECT * FROM `travel-sample` LIMIT 100;").UseStreaming(true);
using (var result = _bucket.Query<dynamic>(request))
{
    Console.WriteLine(result);
}

Passing in false will mean that the entire response is buffered and processed before returning.

N1QL Query Cancellation

This feature allows long running N1QL queries to be canceled before they complete using task cancellation tokens. For example:

var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMilliseconds(5));

var result = await _bucket.QueryAsync<dynamic>(queryRequest, cancellationTokenSource.Token);
//do something with the result

This commit was via a community contribution from Brant Burnett of CenteredgeSoftware.com!

Important TLS/SSL Note on Linux

There is one issue on Linux that you may come across if you are using SSL: a PlatformNotSupportedException will be thrown if you have a version of libcurl installed on the server < 7.30.0. The work-around is to simply upgrade your libcurl installation on Linux to something equal to or greater than 7.30.0. You can read more about this on the Jira ticket: NCBC-1296.

 

The post Introducing Couchbase .NET 2.4.0 – .NET Core GA appeared first on The Couchbase Blog.

Categories: Architecture, Database

Microsoft Bringing AI and Cloud Innovations to Health Care IT Push

eWeek - Application Development - Fri, 02/17/2017 - 01:08
Microsoft's new Healthcare NExT initiative combines AI and cloud computing to create cutting-edge tools in healthcare IT.
Categories: Media

HPE Releases 'Futureproof' 3PAR Storage Operating System

eWeek - Application Development - Thu, 02/16/2017 - 23:50
Flash users are realizing that pure-play all-flash systems do not address the new requirements that arise from a so-called "third wave" of flash evolution.
Categories: Media

Google Provides Details at RSA Show On Android Security Measures

eWeek - Application Development - Thu, 02/16/2017 - 23:40
DAILY VIDEO: How Google secures over a billion Android users; Amazon moves into teleconferencing business with Chime; Former NSA chief optimistic about cloud security; and there's more.
Categories: Media